HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

kill question

01-08-2003, 02:18 AM#1
SkylineGT[FB]
is there a trigger that when a player gets 100 kills, that player creats a new unit? because in my new map, i have like 5 units that can be created, all the players start with same unit and then *** they get kills they creat the next unit, and then the next unit. is that possable?
01-08-2003, 02:44 AM#2
Guest
Make a, integer variable called kills
Make a trigger

Event: A unit owned by "enemy of player X" dies
Action: Set variable kills to kills+1
If kills is equal than or greater than 100, then create 5 units of type X, else do nothing
01-08-2003, 03:07 AM#3
rwxr-xr-x
In order to create a different unit at each 100 kills, you would need a few if statements in the trigger...

EVENTS
Unit - A unit owned by (Enemey of Player 1) Dies
CONDITIONS
-none-
ACTIONS
Set kills = kills + 1
if kills equal to 100 then create 1 (whatever next unit is) for Player 1 ....
if kills equal to 200 then create 1 (whatever next unit is) for Player 1 ....

If you want to control this for multiple users, you will need to make kills an Integer Array to keep track of the kills for each player.

EVENTS
Unit - A unit owned by (Enemy of Player 1) Dies
Unit - A unit owned by (Enemy of Player 2) Dies
etc...
CONDITIONS
-none-
ACTIONS
Set kills[Player number of (killing unit)] = kills[Player number of (killing unit)] + 1
for each Integer A from 1 to (number of players) do if kills[Integer A] equal to 100 then create 1 (whatever next unit is) for player number(Integer A]
etc....

and so on. The only problem with this is if a lot of units are dying at the same time. When too much happens, sometimes triggers miss, and you might not actually get a new unit at the 100th kill as expected, but I usually only see this problem on TD type maps. I got around this problem by implementing the equivilant of a FIFO queue, which so far works perfectly.
01-09-2003, 01:55 AM#4
SkylineGT[FB]
hey. for creating a new unit, i made an invulnerable hero for each player and put it in the middle, and so now when the hero gains a lvl. it makes the next unit and stops making the previouse unit. i hope this works. but i have run into one problem, when the next unit is created, it only makes one of the unit like in a while(its not wut i put, i put 2 sec). if u think this will now work, plz tell me now so i dont do all the triggers, and find out there is gona be a bug thx.