T
Truedagger
Guest
I have 2 triggers, that I've created to manage the spawning of the creeps in my game (enfos based) and to track the kills of the heros. I don't know why but instead of adding 1 to the killcount adds two every time the hero kills a unit.
trigger 1
event
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Dying unit) = Creeps[1]
(Dying unit) =Creeps2[1]
(Dying unit) = Creeps3[1]
(Dying unit) = creeps4[1]
(Dying unit) = Creeps[2]
(Dying unit) = Creeps2[2]
(Dying unit) = Creeps3[2]
(Dying unit) = creeps4[2]
(Dying unit) = Creeps[3]
(Dying unit) = Creeps2[3]
(Dying unit) = Creeps3[3]
(Dying unit) = creeps4[3]
Actions
Player Group - Pick every player in (All players) and do (If ((Owner of (Killing unit)) = Player 1 (red)) then do (Set deads1 = (deads1 + 1)) else do (Do nothing))
Leader Board - Change the value for Player1 (red) in (Last created leaderboard) to deads1
What is the problem with this trigger?
Spawning
Events
Time - Every 12.00 seconds of game time
Conditions
cont less or equal to 4
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If: Conditions
cont same as 1
Then: Actions
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for player 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps[(Integer A)] = (Last created unit)
else: Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
if: Conditions
cont same as 2
then: Actions
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for Player 12 (brow) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps2[(Integer A)] = (Last created unit)
else: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
if: Conditions
cont same as 3
Then: Acciones
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit- Create 1 Level 0 for player 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps3[(Integer A)] = (Last created unit)
else: Acciones
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for JPlayer 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set creeps4[(Integer A)] = (Last created unit)
Set cont = (cont + 1)
With these 2 triggers what i want to do is to spawn 4 groups of 3 creeps every 12 seconds, the store each one of them in 4 different arrays and every time a hero kills one of this creeps add 1 to the killcounter, but i dont know why it adss 2 instead of 1. What have i done wrong?
(Sorry for the mess).
Thank you.
trigger 1
event
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Dying unit) = Creeps[1]
(Dying unit) =Creeps2[1]
(Dying unit) = Creeps3[1]
(Dying unit) = creeps4[1]
(Dying unit) = Creeps[2]
(Dying unit) = Creeps2[2]
(Dying unit) = Creeps3[2]
(Dying unit) = creeps4[2]
(Dying unit) = Creeps[3]
(Dying unit) = Creeps2[3]
(Dying unit) = Creeps3[3]
(Dying unit) = creeps4[3]
Actions
Player Group - Pick every player in (All players) and do (If ((Owner of (Killing unit)) = Player 1 (red)) then do (Set deads1 = (deads1 + 1)) else do (Do nothing))
Leader Board - Change the value for Player1 (red) in (Last created leaderboard) to deads1
What is the problem with this trigger?
Spawning
Events
Time - Every 12.00 seconds of game time
Conditions
cont less or equal to 4
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If: Conditions
cont same as 1
Then: Actions
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for player 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps[(Integer A)] = (Last created unit)
else: Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
if: Conditions
cont same as 2
then: Actions
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for Player 12 (brow) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps2[(Integer A)] = (Last created unit)
else: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
if: Conditions
cont same as 3
Then: Acciones
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit- Create 1 Level 0 for player 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set Creeps3[(Integer A)] = (Last created unit)
else: Acciones
For each (Integer A) from 1 to 3, do (Actions)
loop: Actions
Unit - Create 1 Level 0 for JPlayer 12 (brown) at (Center of Region 000 <gen>) facing 270.00 degrees
Set creeps4[(Integer A)] = (Last created unit)
Set cont = (cont + 1)
With these 2 triggers what i want to do is to spawn 4 groups of 3 creeps every 12 seconds, the store each one of them in 4 different arrays and every time a hero kills one of this creeps add 1 to the killcounter, but i dont know why it adss 2 instead of 1. What have i done wrong?
(Sorry for the mess).
Thank you.


