| 08-26-2003, 03:14 AM | #1 |
i want to do this on a map: a normal unit (not a hero) has an ability which is like a modified bear form in which it will transform to a same unit (probly with a new skin) but it have higher stats and new ability. however this will only be activated if IT KILLS A CERTAIN NUMBER OF ENEMIES/CREEPS. well i want it to be a sort of veterancy effect like in other rts games. i know this is possible through triggers but i dont know where to start. anyone there care to share? emote_confused tnx. |
| 08-26-2003, 03:25 AM | #2 |
JESUS IS MY FINAL ANSWER! Well actually this is: Events: Number of Units owned by Neutral Hostile dies Action: Learn ability (Veterancy) For (UnitA) ...Unf :hammer: |
| 08-26-2003, 03:34 AM | #3 |
lunchbox's method won't work very well, first of all, it doesn't concider who's doing the killing, it only counts neutral hostile, and it doesn't concider individual units, so they'll all veteranize at once really what you'd want to do is first of all you'd probably want to either use an array or custom value to keep track of how many kills the unit has made, using the event 'unit - dies' and referencing the killing unit either increment the array referenced to that unit (or just its custom value if u need not have anything else use it), and then check at that point, if the variable is greater than or equal to X, replace the unit with the veteran unit (i see no need to use a transform ability if you can just replace the unit) if theres such an integer comparison as 'kills made by unit' then by all means use it, but to my knowledge there isn't |
| 08-27-2003, 02:31 AM | #4 |
yeah, thats is a problem although i cant think of any reason why they (Bliz) didnt include the "unit kills # of whatsoever units". dont even know how to bend that rule. neways tnx. |
| 08-27-2003, 05:53 AM | #5 |
You'll need two arrays: 1. Units - Unit array. 2. Kills - Integer array. Then, add every Unit to the Units array. Also create a trigger that adds every newly created Unit to the Units array. Then, create a trigger similar to the following: EVENTS: A Unit dies CONDITIONS: -check to make sure the Unit didn't kill an ally ACTIONS: -run a For loop to find the "killing unit" in the Units array, record the index -Kills[index of killing unit]=Kills[index of killing unit]+1 -if Kills[index of killing unit] > (whatever) run Veteran trigger on Units[index of killing unit] |
| 08-27-2003, 06:02 AM | #6 |
Why not use the unit's custom value to count the kills? Much easier. |
| 08-27-2003, 07:14 AM | #7 |
well i said 'or just custom value if you don't need it for anything else', but i usually make the assumption that people have to eventually use the custom value for multiple things, thats why i always just tell them to use it for index referencing |
| 08-27-2003, 08:21 AM | #8 |
What is 'custom value'? Sorry if i missed something obvious. thanks. |
