Zorkaz Posted March 19, 2022 Share Posted March 19, 2022 So I have an explosion and there's an enchantment attached to it. I want to run a script via the magic effect but the script just won't work on the target inside the explosion. Any ideas? The MagicEffect is set to FireandForget-Contact Scriptname ECElectrChairScr extends activemagiceffect Spell Property CritFire Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Actor Victim = AkTarget CritFire.cast(Victim) If Victim.isessential() Victim.setessential(False) Endif utility.wait(0.1) Victim.setprotected(False) utility.wait(0.1) Victim.kill() EndEvent Link to comment Share on other sites More sharing options...
robotized Posted March 19, 2022 Share Posted March 19, 2022 If you are using Archetype->Script, try Archetype->Value Modifier and Assoc. Item->Health. Set magnitude to 0 and without any damage/recover flags, the magic effect shouldn't tamper with the target's health, but maybe it will be able to run the script. Also try a few values for the duration to see if this can change things(0, 1, 10). Link to comment Share on other sites More sharing options...
SKKmods Posted March 20, 2022 Share Posted March 20, 2022 Dunno about magic stff but you can simplify the script down to this; akTarget.KillEssential() ;kills normal, essential and protected actors Link to comment Share on other sites More sharing options...
Zorkaz Posted March 20, 2022 Author Share Posted March 20, 2022 Thx. Link to comment Share on other sites More sharing options...
robotized Posted May 11, 2022 Share Posted May 11, 2022 So recently I've been doing some experiments with Object Effect for a weapon. The magic effect was used to run a script, and the script to spawn a harmless explosion at the target - just for sound and light effects. The Archetype and flags of the magic effect seemed to matter somehow for the execution of the script, judging from the fact that the explosion didn't get applied all the time. Best results I had with Archetype->Script and flags - Hostile, Detrimental, No Duration. Magnitude, Area and Duration for this magic effect - leave all at 0. Link to comment Share on other sites More sharing options...
Recommended Posts