Can I store ActiveMagicEffect instances in Array?

Post » Fri Aug 23, 2013 2:46 am

Scriptname _EFFECTsc extends ActiveMagicEffect_COREsc Property ScriptC AutoFunction RegisterEffect()	_ScriptC.NPClist[_ScriptC.NPClist.Find(none)] = self	;finds+overwrites first "none" EndFunctionFunction UnregisterEffect()	_ScriptC.NPClist[_ScriptC.NPClist.Find(self)] = none	;finds+overwrites self as "none"EndFunction
Scriptname _COREsc extends Quest_EFFECTsc[] Property NPClist Auto

Then I would use NPClist[i] to get access to them? Can it work?

User avatar
stevie trent
 
Posts: 3460
Joined: Thu Oct 11, 2007 3:33 pm

Post » Thu Aug 22, 2013 9:27 pm

I don't see why you not. I know it's possible to store them in a property so I'd assume an array works the same way. I would save the index in an int variable though so you don't have to search for it again to clear it. Also if you're going to call UnregisterEffect() with the magic effect dispels, the Self variable might already be gone. http://www.creationkit.com/OnEffectFinish_-_ActiveMagicEffect

User avatar
Fiori Pra
 
Posts: 3446
Joined: Thu Mar 15, 2007 12:30 pm

Post » Fri Aug 23, 2013 12:23 am

Grrr, thought about using it OnEffectFinish(), yeah.

Curious what they had in mind by "deleted by the game". What is deleted by game? That specific AME instance probably couldnt be deleted yet, because its still running and "self" is basically an instanceID of current script? Can variables be zeroed with script still running? I'm not sure now...

User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm


Return to V - Skyrim