HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

special effect removal problem

02-24-2003, 12:57 AM#1
STURMguy22
i have a custom spell, that whenever it is cast, it halfs the life of units around the hero, creates a plague cloud on the units, then 2 seconds later i remove it. The problem is, i cant remove the speical effect once i put it on them. Say i will have 5 ghouls around the dreadlord. The dreadlord would cast infernal, i would do

Events: Unit enters playable map region
Conditions: Triggering unit is an infernal
Events:Remove triggering unit from the game
Pick all units within 512 of triggering unit and do- create special effect attached to the chest of picked unit using plaguecloud
Pick all units within 512 of triggering unit and do- half units life.(i didnt feel like wiritng this out)
Wait 2 seconds
Special effect-remove las created effect from the game

but it doesnt work. it will remove one of the plague clouds, but the rest will stay, will someone plz tell me whats wrong and how to fix it
02-24-2003, 01:03 AM#2
DaKaN
last created only refers to the LAST created effect, the moment the trigger picks a 2nd unit, and creates a special effect, the first one is no longer the last...

you need to think of another way to do that, or set up a array and store the effect each time it is created.. it can get complicated
02-24-2003, 01:06 AM#3
STURMguy22
damn i was afraid of that, well thx anyway
02-24-2003, 01:28 AM#4
MicrosoftXP
try this:
local effect array plagueClouds
pick every unit and add picked unit to unit group (MyUnitGroup)
local integer numUnits = number of units in MyUnitGroup
for 1 to numUnits in MyUnitGroup
pick random unit from MyUnitGroup and set picked unit = Unit
create SEffect "cloud" on Unit
set last created SEffect = plagueClouds[integer A]
half life of Unit
remove Unit from MyUnitGroup
end loop

wait 2 seconds

for 1 to numUnits
destroy plagueClouds[integer A]
end loop



something like that should work
02-24-2003, 02:16 AM#5
STURMguy22
thx microsoft xp