HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Special Effects problem

05-24-2003, 08:25 PM#1
draconx
Okay heres what i'm trying to do:

A tower, whenever it attacks, creates a special effect at the origin of the attacked unit, using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdx

It works great, EXCEPT: The lightning bolt effect loops, so the attacked unit will keep getting struck by lightning until its corpse finally decays. That doesnt look nearly as cool.

Basically what I need to do is destroy the special effect a certain time after its created, but I'm not entirely sure how to go about doing that. Destroy (last created special effect) won't work simply because in the time it would wait to destroy it, more could have easily been created.

Any help is appreciated, thanks.
05-24-2003, 08:30 PM#2
Guest
you can always store that special effect into a variable and then destroy that specific effect
05-25-2003, 04:24 AM#3
ChrydGod
You need to use a local variable.

if you store the special effect into a global variacle, it will be changed everytime the special effect is created, even before you removed it. I recommend that you convert your trigger in custom text.

Then at the very beginning of the function called "function Trig_*your trigger name*_Actions" , add the line :

local effect tempeffect

then look for the line where it creates the special effect.

then add these lines just after :
set tempeffect = bj_lastCreatedEffect
call TriggerSleepAction( 1.00 )
call DestroyEffect(tempeffect)

Then everytime you create the effect, the trigger will create a local variable for it, and all will work like a charm.

Regards

PS : note that of course you don't have to know anything about custom text to do this ;)
05-25-2003, 08:58 AM#4
Spectralist
or, if you are useing UMSWE you can make the attack animation Doodads\Cinematic\Lightningbolt\Lightningbolt.mdx and set the attack type to instant.
05-25-2003, 09:29 AM#5
ChrydGod
Spectralist, i don't think he meant to have the tower to have a llightning attack like the chimera (it can be done as you said but i think it requires to add the ability 'lightning attack' to the tower) , but rather have a lightning coming from the sky to appear on the targeted units.

Then as i said to destroy the special effect, the only simple method is the one i described.


Regards
05-25-2003, 02:36 PM#6
draconx
Thank you chrydgod! Worked absolutely perfectly! And hopefully I've written the code right to compensate for the wait bug, execute Wait once for each human player in the game?