PDA

View Full Version : Need help with a counter-like thing


PzikoSnake
06-05-2008, 6:35 AM
I'm making a map for the contest, and I'm missing only 1 thing...

I need a trigger to work like this:

Every 10 kills by Player1 of "Marine" give 1 "Firebat" to Player1

If it can help you, I've got no use of Gas!

thx!

atrocity3010
06-05-2008, 6:44 AM
Is this for multiple players? If so, I can't think of a way to do it infinitely (i.e. not having to have a bunch of triggers saying "player x kills 10 marines", "player x kills 20 marines" etc.).

If it's just one player that needs it, you can say:

(opponent) has suffered at least 10 deaths of Marine

Modify death counts for (opponent): Set to 0 for Marine
Create 1 Firebat for Player 1
Preserve

PzikoSnake
06-05-2008, 7:20 AM
it's a multiplayer map............. :(
I hate to do hundreds of triggers!!!

BlademasterSlsh
06-05-2008, 10:38 AM
You aren't using gas? This is easy enough, I can do it in two triggers.
--Trigger 1--
Player 1

Condition:
Player 1 kills exactly 1 Terran Marine

Action:
Modify resources for Player 1: Add 1 gas
Preserve Trigger

--Trigger 2--
Player 1

Condition:
Player 1 accumulates exactly 10 gas

Action:
Modify resources for Player 1: Subtract 10 gas
Create 1 Terran Firebat at 'Player 1 Firebat Spawn Point' for Player 1
Preserve Trigger

The only problem with this is that it will let people kill their own Marines (I think) and still get the gas. Still, it's better than wasting hours coding the other way.

atrocity3010
06-05-2008, 11:35 AM
Condition:
Player 1 kills exactly 1 Terran Marine

Action:
Modify resources for Player 1: Add 1 gas
Preserve Trigger

This will only work as long as player one has killed their first marine. Then, as long as player 1 doesn't kill any more marines, it'll just accumulate gas continuously. Once player 1 kills another marine, the trigger won't activate anymore. Unfortunately, there's no action for modifying kill count like there is for deaths.

TheNomad
06-05-2008, 12:16 PM
try "At most 10 marines"

Twitch6000
06-05-2008, 12:49 PM
You aren't using gas? This is easy enough, I can do it in two triggers.
--Trigger 1--
Player 1

Condition:
Player 1 kills exactly 1 Terran Marine

Action:
Modify resources for Player 1: Add 1 gas
Preserve Trigger

--Trigger 2--
Player 1

Condition:
Player 1 accumulates exactly 10 gas

Action:
Modify resources for Player 1: Subtract 10 gas
Create 1 Terran Firebat at 'Player 1 Firebat Spawn Point' for Player 1
Preserve Trigger

The only problem with this is that it will let people kill their own Marines (I think) and still get the gas. Still, it's better than wasting hours coding the other way.
No just say this for the first trigger-
killscore is atleast 1
set killscore 0
add 1 gas
preserve.

NoobOfLore
06-05-2008, 2:36 PM
Did you guys not notice that he said he couldn't use gas? gas is not available to him as a counting method.
Instead of using gas, using a unit counting method, so put a section in the corner of the map with some "Credits," doesn't matter what unit you use, as long as it's restricted to that area. What you do is you add one "credit"(the spare unit you are using as a counter) in an isolated part of the map for every kill the chosen player gets. You would need to copy the trigger to each player. When the player has 10 "credits" then kill them all for that player and create a Firebat at wherever you need it.
My trigger format is a little rusty, so just try to get the general message.

Current player-
Condition- "Current player" has exactly "1" Kill
Action- reset kills for player to "0"
Create "one" "credit" at "location where they wont be disturbed"
Preserve trigger.

Current player-
Condition- "Current player" has "at least" "10" "credit" at "location where they wont be disturbed"
Action- Kill 10 "credits" for "Current player"
Create 1 "Firebat" at "Firebat spawn point"
Preserve trigger.

This only works if the only enemy is marines I think. If you only want it to spawn Firebats for every 10 MARINES ONLY, and there are other units on the map, then I'm afraid that I have no idea how to exclude other units from your kill count.

Oh wait...Or did he say that he hasn't used gas Yet.

Dem0nS1ayer
06-05-2008, 3:54 PM
Uhh no. He said, "I have no use of gas" which means that he's not using it for anything. I think.

PzikoSnake
06-05-2008, 7:31 PM
Well, I actually made it work, using the score system! thx for your help!