[Trigger] Tacking Individual Units

Status
Not open for further replies.
Level 4
Joined
Aug 23, 2009
Messages
28
What I want is this:
A unit goes within [Region or 300 units] of a unit.
Unit gets infected, adding him to a unit group, and after a period (using 10 seconds for my test), he begins taking damage (by putting him in another unit group). I havn't been able to get this to work, because I'm not sure how to make a unit individually change unit groups.

IE: Unit 1 is infected. Unit 2 is infected 5 seconds after. They change 5 seconds from one another, not at the same time.

Is there any way to do this? I've tried some different ways (timers with huge arrays using custom values, and some others), but none of them worked.

I have Newgen with UMSWE and EGUI, if those functions are of any help.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well there are many ways to do this. You could add a buff to the units in the first group that expires in 5 seconds, and check each unit in the group every small interval to determine whether or not they still have the buff. If they do not have the buff any longer, then they can be added to the next group. This is probably one of the simplest ways of doing it.

You could also use a hashtable to store a value to each unit that represents "time". This value would be reduced on a small interval, and once a unit's "time" value reached 0.00 (or less), you would be able to add that unit from the first group to the second group.

Both processes I have given would operate on a single timer, meaning the accuracy of "time" would be entirely dependent on when the timer expires, so having a lower value would yield more precision, while having a value like "5" would yield very low time accuracy.
 
Level 4
Joined
Aug 23, 2009
Messages
28
Well there are many ways to do this. You could add a buff to the units in the first group that expires in 5 seconds, and check each unit in the group every small interval to determine whether or not they still have the buff. If they do not have the buff any longer, then they can be added to the next group. This is probably one of the simplest ways of doing it.

Is there a way to add buffs without adding abilities?
 
Status
Not open for further replies.
Top