thesniperdevil Posted March 7, 2016 Share Posted March 7, 2016 Hey guys, is it possible to define a quest alias with a papyrus script, clear it on a specified occasion & then assign a new reference after? For (a simplified) example, lets say I created a quest that turned an alias "the one" into a god after the player completed the main story quest. The player could cast a spell on any NPC which would mark that specific NPC as "the one". (aka the spells aktarget becomes the specific reference alias) However if the NPC died, it would clear the alias. ("the one" alias had a script run on death that would self.clear() ondeath ) The player would then need to cast the spell on a new NPC to make them "the one" I've taken a peek at the follower quests, which suggest that dynamically assigning aliases is possible but I cant figure it out :( Link to comment Share on other sites More sharing options...
Hoamaii Posted March 7, 2016 Share Posted March 7, 2016 Never used this myself so far so I don't know how reliable it may be, but you may want to check "MyAlias.TryToReset()": http://www.creationkit.com/TryToReset_-_ReferenceAlias Link to comment Share on other sites More sharing options...
Terra Nova Posted March 9, 2016 Share Posted March 9, 2016 (edited) Yes and here's an example of one of the ways that's achieved. Let's take your concept and apply a little bit of it. Let's say the following code is the effect for your spell. Scriptname FillAnAliasEffect extends ActiveMagicEffect ReferenceAlias property myAlias auto Event OnEffectStart(Actor akTarget, Actor akCaster) Actor PlayerRef = Game.GetPlayer() ; I'm being lazy and don't feel like making another property. if akCaster == PlayerRef if myAlias.GetReference() == none ; Make sure the alias is empty first. myAlias.ForceRefTo(akTarget) else ; reference already filled. return endif endif EndEventNow let's say the spell worked, and the NPC was added to the alias. Now let's say you want this alias to be cleared if the NPC is killed, like you say: Scriptname AliasFromSpellRefScript extends ReferenceAlias Event OnDying(Actor akKiller) ; This event is faster than OnDeath. Clear() EndEvent Edited March 9, 2016 by Terra Nova Link to comment Share on other sites More sharing options...
thesniperdevil Posted March 13, 2016 Author Share Posted March 13, 2016 Fantastic, thanks so much! This has done the trick nicely! Link to comment Share on other sites More sharing options...
Recommended Posts