Jump to content

GetReference and GetActorReference not working on aliases


Recommended Posts

Hi! Trying this again, as my previous attempt at this topic was a little unfocused. I've completely re-done my mod but am still having issues with GetReference() and GetActorReference() being called on quest aliases.

I am making a simple mod that replaces the dead body of Torolf from the tutorial mission with a burned corpse static. The quest is successfully triggered from a quest node once the character is killed. I want to enable a previously placed and disabled burned corpse static, then disable Torolf.

No matter what I try, the burned corpse static appears as expected, but Torolf will not disable.

My code follows:

Scriptname RH_sc_ReplaceCorpseTorolf extends Quest

ObjectReference Property TorolfCorpse Auto
ReferenceAlias Property RH_alias_Torolf Auto

Event OnInit()
    RegisterForSingleUpdate(1.0)
EndEvent

Event OnUpdate()
    ReplaceCorpse()
EndEvent

Function ReplaceCorpse()
	TorolfCorpse.Enable(false)
	RH_alias_Torolf.GetActorReference().Disable()
;	RH_alias_Torolf.GetReference().Disable()
	CompleteQuest()
EndFunction

I have tried both RH_alias_Torolf.GetActorReference().Disable() and RH_alias_Torolf.GetReference().Disable(). In neither case does is the body disabled.

I got this to work previously by using an Actor reference instead of an alias, but I don't want to call Torolf directly as it makes him persistent and I'm trying to keep my mod ESL-eligible.

I've attached images of my quest setup and alias for reference. Any help would be greatly appreciated!

Quest Data.jpg

Quest Aliases.jpg

Torolf Reference Alias.jpg

Link to comment
Share on other sites

Possibly an initialization loop issue.

Is "RH_alias_Torolf" pointing to a different quest?  It could be that the foreign quest is not fully initialized by the time your quest script fills its properties.

You might access that alias with RH.getAliasByName( "Torolf"), and using RH as a quest property.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...