Staredit Network

Staredit Network -> UMS Assistance -> Way to count how many times created units?
Report, edit, etc...Posted by LS-Baba on 2005-06-12 at 03:25:00
is there a way to count how many times i created a unit for a player? Heres the deal:

I'm constantly creating units to come out of a spawning area.
I want it so that when a player leaves the game (p12 commands at least 1 unit at the leaving player's designated area) then i would center a location on the spawning place to remove any new units that come out so that the other defenders don't have to kill it. Now I want to know if i can count how many times the units spawned if i have a trigger like this running:


Trigger
Players:
¤ P7
Conditions:
¤ death counter for p7 is at 1 academy
Actions:
¤ create 2 overlord at spawning point
¤ preserve


I know i can count the kills but I dont want to have the left over team mates have to kill them so i want to remove the units instead and then have it count to 360 so i can get the next level started. I start the next level at 360 P7 overlords. Help please?
Report, edit, etc...Posted by (U)Bolt_Head on 2005-06-12 at 03:48:03
It sounds like your going about this backwards.

I belive what you should do is have the units spawn for each player. So your trigger would instead look like this but for every human player.
Trigger
Players:
¤ Player 1
Conditions:
¤ death counter for p7 is at 1 academy
Actions:
¤ Create 2 overlords owned by player 7 at location spawn
¤ Preserve Trigger


Then since the trigger is owned by player 1 it wont' fire when player 1 isn't there.



I think thats what you were talking about. But if you litteraly just want to count how many times your trigger has run add an action to make it into a counter.

So every time you have the "create 2 overlords" action you can do something like "set custom score for player to add 2". I'm not sure why you would need this however, I guess i don't fully understand your situation.
Report, edit, etc...Posted by in_a_biskit on 2005-06-12 at 09:08:46
Do you mean that you want to continuously create overlords for player 7, and then to stop creating overlords when you've created 360 altogether?

In that case,
Trigger
Players:
¤ Player 7
Conditions:
¤ Player 7 has suffered at most 358 deaths of 'counter'
¤ {conditions to start this level}
Actions:
¤ Create 2 overlords at 'location' for Player 7
¤ Modify death counts for player 7: add 2 for 'counter'
¤ Preserve trigger




To make a trigger dependent on a player being present, design the trigger to be owned by that player (as Bolt did), or have a condition that that player commands at least one unit.
Report, edit, etc...Posted by LS-Baba on 2005-06-12 at 19:15:23
LOL omg duh thanks both of u
Next Page (1)