IWantMyMod Posted August 12, 2018 Share Posted August 12, 2018 Hello. Lets say I have an active magic effect script with a property like this: Scriptname MyAbiltiy Extends ActiveMagicEffect bool Property CurrentState Auto Then I apply that ability to some actor.Now, If I have a referance to that actor in some other script (like quest script, etc) can I get or change the CurrentState. Something Like this: ObjectReference target = Game.GetCurrentCrosshairRef() Actor targetActor = target As Actor If (targetActor) If (targetActor.HasSpell(MyAbiltiy)) If (targetActor.CurrentState ) .... some code here targetActor.CurrentState = false EndIf EndIf EndIf The above code will not work because the Actor script doesn't have a CurrentState property. Also I can't cast targetActor to MyAbiltiy because an ActiveMagicEffect is not comparable. It isn't even a Form. Is there some way to get a reference to the ActiveMagicEffect for the target actor so I can interact with it's properties? Link to comment Share on other sites More sharing options...
cdcooley Posted August 12, 2018 Share Posted August 12, 2018 No, there's no way to get remote access to the properties of an active magic effect script. Instead you need the active magic effect to look at something else. If that thing needs to be specific to the particular actor you can use factions, inventory items, some of the unused actor values, or even a second magic effect as the general equivalent bool or int properties (or even others in some cases if you're creative). There may be special cases for leveled list generated actors but at least some of those things work. If you need to make sure the active magic effect does something immediately you can make use of default events that get passed through from the ObjectReference or Actor scripts like OnActivate(), OnItemAdded(), OnMagicEffectApply(), etc. Link to comment Share on other sites More sharing options...
IWantMyMod Posted August 13, 2018 Author Share Posted August 13, 2018 Thanks for the reply. I figured that was going to be the answer so I'm looking at either adding another ability to the actor or using a ModEvent. Link to comment Share on other sites More sharing options...
Evangela Posted August 14, 2018 Share Posted August 14, 2018 For properties, that are expected to change/be changed that I would prefer to put on AMEs but can't, I put them on quest scripts. Link to comment Share on other sites More sharing options...
Recommended Posts