So I was messing around with a simple script, and I got a result I was not expecting:
Here is the script
Scriptname PLZWORK extends ActiveMagicEffect {test spell for scripts}Int Property OMZstage AutoEvent OnEffectStart(actor akTarget, actor akCaster)OMZstage = 0Debug.notification("Spell Started. " + OMZstage)RegisterForSingleUpdate(1.0)endEventEvent OnUpdate()OMZstage += 1Debug.notification("Spell Updated. " + OMZstage)RegisterForSingleUpdate(1.0)endEventEvent OnEffectFinish(actor akTarget, actor akCaster)Debug.notification("Spell Finished. " + OMZstage)endEvent
The script is attached to two separate magic effects on two similar but slightly different concentration spells. I gave myself both spells and started shooting them at a target. I was expecting both spells to increment the same property OMZstage. Instead, when staggering the use of the two spells, I got output like this:
Spell Started. 0
Spell Updated. 1
Spell Updated. 2
Spell Updated. 3
Spell Started. 0
Spell Updated. 4
Spell Updated. 1
Spell Updated. 5
Spell Updated. 2
Spell Updated. 6
Spell Finished. 6
Spell Updated. 3
Spell Updated. 4
Spell Finished. 4
So it looks to me like my property was duplicated. Does this mean that if I have another script that uses the OMZstage property, I will read both values and write to both properties?
Edit: Hmmm, I guess I could check by making a custom scripted shout and using it while running both spells... I feel like this may crash the game though...