Proper syntax to set an alias from a spell script

Post » Tue Jun 19, 2012 3:24 pm

I would like to be able to use a quest alias to store an actor reference from a spell, and could really use some help with the right way to set that up.

More specifically, I want to use GetLeveledActorBase from an active spell effect script. In Oblivion I could do something like set myquest.myreference.

I want to be able to use the base reference stored as the quest alias to spawn new references with PlaceAtMe, then track this new reference and do stuff to it from the quest script.

I am having some trouble hooking the reference I get from the spell script to an alias.

I am also not entirely certain how to reference the stored base reference in the alias from another spell script.
User avatar
Jonathan Braz
 
Posts: 3459
Joined: Wed Aug 22, 2007 10:29 pm

Post » Tue Jun 19, 2012 3:53 pm

Maybe I'm thinking this works like Oblivion when it doesn't? Going by the wiki page, "http://www.creationkit.com/Quest_Alias_Tab" So am I correct in assuming the ONLY way to set a dynamic alias is through the quest script starting a stage, or when the quest itself starts?

In which case, what if I need the quest to start with the player and only grab a reference later when I say? Can this "fill" function be invoked then by a SetStage? So many unknowns...

I really miss the ease and intuitiveness of "set myquest.myvariable to something." But I might just be reading the wiki wrong and it is still just as easy and just as functional as in the past.
User avatar
Siidney
 
Posts: 3378
Joined: Fri Mar 23, 2007 11:54 pm

Post » Tue Jun 19, 2012 4:09 am

You could just add a script to your quest and store the variable in the script, if the quest is set to start on game enabled it will always be there, then just have a property in your spell effect script that points to the quest and you can access variables and functions in the quest script.
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Tue Jun 19, 2012 4:22 am

Try This

Scriptname YourScript extends activemagiceffectReferenceAlias Property YourAlias AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)YourAlias.ForceRefTo(akTarget)EndEvent


And make sure you set your Alias in the properties to point to the Alias in your quest.
User avatar
Baby K(:
 
Posts: 3395
Joined: Thu Nov 09, 2006 9:07 pm


Return to V - Skyrim