No quest scr necessary - add a script effect update in case the actor dies before the spell finishes
Would that be an issue if it the effect has a one second duration. In the case I am working with, this sword would not ever have this effect longer than one second. The idea, I am working with for my mod is that the player must get the killing blow...
With what you seem to be saying in mind, I am thinking if I did this:
scn TestSoulTraqeffectScriptshort SoulLevelBegin ScriptEffectUpdate If (GetDead) let SoulLevel := GetActorSoulLevel ; Do Stuff EndIfEndBegin ScriptEffectFinish If (GetDead) let SoulLevel := GetActorSoulLevel ; Do Stuff EndIfEnd
... isn't there a potential to "Do Stuff" twice?
Would this work better instead?
scn TestSoulTraqeffectScriptshort SoulLevelshort ActiveBegin ScriptEffectStart set Active to 1EndBegin ScriptEffectUpdate If (Active == 1) If (GetDead) let SoulLevel := GetActorSoulLevel ; Do Stuff set Active to 0 Endif EndIfEndBegin ScriptEffectFinish If (Active == 1) If (GetDead) let SoulLevel := GetActorSoulLevel ; Do Stuff set Active to 0 Endif EndIfEnd
What I am not seeing here is the need for the ScriptEffectUpdate block. Wouldn't GetDead still return true even if the target has been dead for more than one second? How about 180 seconds as an example?
http://cs.elderscrolls.com/constwiki/index.php/GetDead#Notes state that you could call GetDead again and it would be true all the way up to just before it re-spawns. Or I am missing some not-so-obvious issue?
I am a bit curious about the workings of script effects. I can't seem to find much detail for the uninitiated. Are spell effects multiple instances of the same code, maintaining their own variables, etc? Let's say, for an example, that I had a long duration on the effect and I hit several different actors/creatures/mobs in quick succession. Then, somehow I pulled an Area Effect that killed them all, effectively, at the same time and before the duration is up. I know the core of the game processing must be handled in a linear fashion even if, by some chance, threads are returning results, but how could I be certain that they aren't stepping on each other or that, effectively, only one "soul trap" will ever succeed? I suppose I could go test it, thoroughly, but it would be nice to have detailed information, so I don't have to test my every concern. ...or find my self searching my code for a bug. This would not be an issue in my mod, but I had thought about setting up a similar sword for a companion and wondering if I needed a superstate script and/or enchantment for the other sword. Well, maybe it could be an issue if a user of my mod decided to console-add a second sword... Do you see my concern here?
Edit: Spelling