HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Special Effects and Unit Group Variables

07-05-2003, 05:00 PM#1
Ultramagnetic
okay, if you trigger a special effect on an entire unit group, how do you go about destroying that effect on every unit if it's a persistant one like say a fire trap or something?

I tried

Units Group - pick every unit in unit group 'variable' and do special effect - destroy special effect 'variable' .

Doesnt seem to work. I got two variables, one's a unit-group var and the other is a special effect var. Both are arrays.

Anybody got any ideas? The trig looks like this

all actions:

unit group - add all units within range blah of 'unit variable' to 'unit-group variable'
unit group = pick every unit in 'group variable' and do create special effect
set fx var = last created fx
wait 3 secs
unit group - pick every unit in 'group var' and do destroy 'fx var'
unit group - remove all units from 'group var'
trigger - run this trigger.

anybody got any ideas?
07-05-2003, 05:13 PM#2
Raptor--
Quote:
unit group = pick every unit in 'group variable' and do create special effect
set fx var = last created fx


i'm not sure if you meant to put the set fx var inside the unit group sub, but what you said there was
'create a special effect on all the units'
'make the VERY last special effect created = variable'

whereas you want

'create a special effect on this unit, make it = variable[x]'
'create a special effect on second unit, make it = variable[x+1]'
etc...

if you didn't get that, then the trigger should look something like

pick every unit in unit group QWERTY and do:
+ loop
++ create special effect on (picked unit)
++ set SFXvar[X] = last created special effect
++ set X = X + 1

to remove them

for loop integer A - 0 to X
+ loop
++ destroy SFXvar[integerA]

if u don't have TFT editor u might have to use a second trigger nested in the initial trigger to get multiple actions in 1 loop statement

also, unless you want multiple unit-groups under the same var name, you don't need a unit-group array
07-05-2003, 07:04 PM#3
Ultramagnetic
Quote:
Originally posted by Raptor--

++ set X = X + 1


does this mean I need another variable? An integer one?



And also do I embed the second loop in the first one?
07-06-2003, 06:07 AM#4
Shiv
Yes. I'm assuming the X is to reference the index number, and what it's doing is simply storing the data, then going up a field. The X variable tells it where it's referencing.
07-06-2003, 03:34 PM#5
Ultramagnetic
actually guys, that's for all the help, but turns out I really didn't even need to make this complicated trigger at all, heh... I just had a model file path set wrong so it wasn't showin' up. :)