demisovereign Posted February 16, 2012 Share Posted February 16, 2012 Description says it all. Can anyone explain how to make a spell that detonates are goes into effect after an x amount of seconds? Link to comment Share on other sites More sharing options...
cscottydont Posted February 16, 2012 Share Posted February 16, 2012 you could do it via script something like... Scriptname DelayedBlast extends ActiveMagicEffect Explosion Property YourExplosionName auto Actor ExplosionBase Event OnEffectStart(actor Target, actor Caster) ExplosionBase = Target RegisterForSingleUpdate(x) ;x is the number of seconds for the delay EndEvent Event OnUpdate() ExplosionBase.PlaceAtMe(YourExplosionName, 1, False, False) EndEvent Link to comment Share on other sites More sharing options...
demisovereign Posted February 16, 2012 Author Share Posted February 16, 2012 (edited) So this would work? Scriptname DeathPrint extends activemagiceffect {Scriptname DelayedBlast extends ActiveMagicEffect Explosion Property Deathprint auto Actor ExplosionBase Event OnEffectStart(actor Target, actor Caster) ExplosionBase = Target RegisterForSingleUpdate(3) ;x is the number of seconds for the delay EndEvent Event OnUpdate() ExplosionBase.PlaceAtMe(Deathprint, 1, False, False) EndEvent} Edited February 16, 2012 by demisovereign Link to comment Share on other sites More sharing options...
cscottydont Posted February 16, 2012 Share Posted February 16, 2012 (edited) I'm not sure if it will like you using the same name for the script as you do for the explosion. I'd give the script a unique name just to be safe. You can also just get rid of the scriptname line from my script bit.If you attach this script to your spell, it should do what you're looking for. Scriptname DeathPrintScript extends activemagiceffect Explosion Property Deathprint auto Actor ExplosionBase Event OnEffectStart(actor Target, actor Caster) ExplosionBase = Target RegisterForSingleUpdate(3) ;x is the number of seconds for the delay EndEvent Event OnUpdate() ExplosionBase.PlaceAtMe(Deathprint, 1, False, False) EndEvent Edit: also I think the spell this effect is attached to would need to have a duration greater than 3, I'm not sure what happens to spell script effects after the spell they're attached to wears off but I would guess they stop running Edited February 16, 2012 by cscottydont Link to comment Share on other sites More sharing options...
demisovereign Posted February 16, 2012 Author Share Posted February 16, 2012 I replaced the code with your set, when the projectile hits the effect is still immediate without any delay. For instance I think it would wait 3 seconds and then have the effect hit, but it instead just triggers the spell right away. Link to comment Share on other sites More sharing options...
TheElderInfinity Posted February 16, 2012 Share Posted February 16, 2012 I replaced the code with your set, when the projectile hits the effect is still immediate without any delay. For instance I think it would wait 3 seconds and then have the effect hit, but it instead just triggers the spell right away. use 'Utility.Wait(3)' before you trigger the effect. Link to comment Share on other sites More sharing options...
cscottydont Posted February 16, 2012 Share Posted February 16, 2012 use 'Utility.Wait(3)' before you trigger the effect. probably a better optionyou could do away with the OnUpdate event and just do everything in the OnEffectStart I replaced the code with your set, when the projectile hits the effect is still immediate without any delay. For instance I think it would wait 3 seconds and then have the effect hit, but it instead just triggers the spell right away. the Magic Effect the script is attached to doesn't have an explosion associated with it does it? did you choose an explosion for it from the drop down menu under Visual Effects? Link to comment Share on other sites More sharing options...
demisovereign Posted February 16, 2012 Author Share Posted February 16, 2012 By the sounds of it, I am putting this script in the wrong place.Picture for reference Link to comment Share on other sites More sharing options...
Sunnie Posted February 16, 2012 Share Posted February 16, 2012 Wait... what exactly are you trying to do? Create a time delayed explosive arrow? Link to comment Share on other sites More sharing options...
demisovereign Posted February 16, 2012 Author Share Posted February 16, 2012 Yeah, among other similar spells. Breakdown of scenario: 1: Player fires projectile2: Projectile hits an NPC3: Nothing happens for ~ 10 seconds.4: Spell detonates, goes into action, npc dies, etc Link to comment Share on other sites More sharing options...
Recommended Posts