- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
Below you find 2 triggers which run when a hero dies.
I want the first trigger to run only when a hero dies the first time ("First Blood"). Upon triggering First Blood, this first trigger turns OFF, and turns ON the second trigger, which going forward keeps track of hero kills.
However, for some reason the second trigger still registers the kill that happens the first time, even though it is OFF at the time of the unit dying.
Here proof that it's turned off, and not accidently on:
Here the in-game log:
Is a unit's death somehow triggering multiple times?
Below you find 2 triggers which run when a hero dies.
I want the first trigger to run only when a hero dies the first time ("First Blood"). Upon triggering First Blood, this first trigger turns OFF, and turns ON the second trigger, which going forward keeps track of hero kills.
However, for some reason the second trigger still registers the kill that happens the first time, even though it is OFF at the time of the unit dying.
-
Kill Streak First Blood
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Triggering unit) is A Hero) Equal to True
-
-
Actions
-
Set VariableSet KA_Killer = (Killing unit)
-
Set VariableSet KA_Dying = (Triggering unit)
-
Set VariableSet KA_PlayerNumberKiller = (Player number of (Owner of KA_Killer))
-
Set VariableSet KA_PlayerNumberDying = (Player number of (Owner of KA_Dying))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Owner of KA_Killer) is in Players.) Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_Killer Equal to KA_Dying
-
-
Then - Actions
-
Game - Display to (All players) the text: (PlayerNames[KA_PlayerNumberKiller] + denied himself!)
-
Skip remaining actions
-
-
Else - Actions
-
-
-------- --------
-
Set VariableSet KA_Bounty = ((110 + ((Hero level of KA_Dying) x 8)) + 150)
-
Sound - Play firstblood <gen>
-
Game - Display to (All players) the text: ((PlayerNames[KA_PlayerNumberKiller] + just pawned ) + ((PlayerNames[KA_PlayerNumberDying] + 's head for ) + (|cffffcc00 + ((String(KA_Bounty)) + |r gold!))))
-
Game - Display to (All players) the text: (PlayerNames[KA_PlayerNumberKiller] + just drew |cffff0000First Blood|r!)
-
Player - Add KA_Bounty to (Owner of KA_Killer).Current gold
-
-------- --------
-
Set VariableSet KA_CounterKill[KA_PlayerNumberKiller] = (KA_CounterKill[KA_PlayerNumberKiller] + 1)
-
-------- --------
-
Trigger - Turn off (This trigger)
-
Trigger - Turn on Kill Streak System <gen>
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
X_LastAttacker[KA_PlayerNumberDying] Equal to 0
-
-
Then - Actions
-
Game - Display to (All players) the text: (PlayerNames[KA_PlayerNumberKiller] + was executed.)
-
-
Else - Actions
-
-------- --------
-
Set VariableSet KA_Bounty = ((110 + ((Hero level of KA_Dying) x 8)) + 150)
-
Sound - Play firstblood <gen>
-
Game - Display to (All players) the text: ((PlayerNames[X_LastAttacker[KA_PlayerNumberDying]] + just pawned ) + ((PlayerNames[KA_PlayerNumberDying] + 's head for ) + (|cffffcc00 + ((String(KA_Bounty)) + |r gold!))))
-
Game - Display to (All players) the text: (PlayerNames[X_LastAttacker[KA_PlayerNumberDying]] + just drew |cffff0000First Blood|r!)
-
Player - Add KA_Bounty to (Owner of KA_Killer).Current gold
-
-------- --------
-
Set VariableSet KA_CounterKill[KA_PlayerNumberKiller] = (KA_CounterKill[KA_PlayerNumberKiller] + 1)
-
-------- --------
-
Game - Display to (All players) the text: TEST: END MESSAGE A...
-
Trigger - Turn off (This trigger)
-
Trigger - Turn on Kill Streak System <gen>
-
-
-
-
-
-
-
Kill Streak System
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Triggering unit) is A Hero) Equal to True
-
(Player number of (Owner of (Killing unit))) Greater than 0
-
(Player number of (Owner of (Killing unit))) Less than or equal to 12
-
(Player number of (Owner of (Triggering unit))) Not equal to 13
-
-
Actions
-
Game - Display to (All players) the text: WHY IS THIS TRIGGER...
-
Set VariableSet KA_Killer = (Killing unit)
-
Set VariableSet KA_Dying = (Triggering unit)
-
Set VariableSet KA_PlayerNumberKiller = (Player number of (Owner of KA_Killer))
-
Set VariableSet KA_PlayerNumberDying = (Player number of (Owner of KA_Dying))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_Killer Equal to KA_Dying
-
-
Then - Actions
-
Game - Display to (All players) the text: (PlayerNames[KA_PlayerNumberKiller] + denied himself!)
-
Skip remaining actions
-
-
Else - Actions
-
-
-------- --------
-
Set VariableSet KA_Bounty = ((110 + ((Hero level of KA_Dying) x 8)) + (KA_CounterKillStreak[KA_PlayerNumberDying] x 60))
-
Game - Display to (All players) the text: ((PlayerNames[KA_PlayerNumberKiller] + just pawned ) + ((PlayerNames[KA_PlayerNumberDying] + 's head for ) + (|cffffcc00 + ((String(KA_Bounty)) + |r gold!))))
-
Player - Add KA_Bounty to (Owner of KA_Killer).Current gold
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_CounterKill[KA_PlayerNumberKiller] Less than 10
-
-
Then - Actions
-
Set VariableSet KA_CounterKill[KA_PlayerNumberKiller] = (KA_CounterKill[KA_PlayerNumberKiller] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_CounterKill[KA_PlayerNumberKiller] Greater than or equal to 3
-
-
Then - Actions
-
Set VariableSet KA_CounterKillStreak[KA_PlayerNumberKiller] = (KA_CounterKillStreak[KA_PlayerNumberKiller] + 1)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_CounterKillStreak[KA_PlayerNumberKiller] Greater than or equal to 1
-
-
Then - Actions
-
Sound - Play KA_KillStreakSound[KA_CounterKillStreak[KA_PlayerNumberKiller]]
-
Game - Display to (All players) the text: (PlayerNames[KA_PlayerNumberKiller] + KA_KillStreakString[KA_CounterKillStreak[KA_PlayerNumberKiller]])
-
-
Else - Actions
-
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KA_CounterKillStreak[KA_PlayerNumberDying] Not equal to 0
-
-
Then - Actions
-
Sound - Play ReceiveGold <gen> at 100.00% volume, attached to KA_Killer
-
Set VariableSet KA_Bounty = (KA_CounterKillStreak[KA_PlayerNumberDying] x 60)
-
Game - Display to (All players) the text: ((PlayerNames[KA_PlayerNumberDying] + ('s + KA_KillStreakStringEnd[KA_CounterKillStreak[KA_PlayerNumberDying]])) + (( streak has been ended by + PlayerNames[KA_PlayerNumberKiller]) + ( for + ((|cffffcc00 + (String(KA_Bounty))) + |r gold.))))
-
-
Else - Actions
-
-
Set VariableSet KA_CounterKill[KA_PlayerNumberDying] = 0
-
Set VariableSet KA_CounterKillStreak[KA_PlayerNumberDying] = 0
-
-------- --------
-
-------- Kills must be within 15 seconds for Kill Loop --------
-
Unit Group - Add KA_Killer to KA_KillGroup
-
Set VariableSet KA_CV = (Custom value of KA_Killer)
-
Set VariableSet KA_KillStreakDuration[KA_CV] = 0
-
Set VariableSet KA_KillStreakCounter[KA_CV] = (KA_KillStreakCounter[KA_CV] + 1)
-
Set VariableSet KA_KillStreakBoolean[KA_CV] = False
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Kill Streak Kill Loop <gen> is on) Equal to False
-
-
Then - Actions
-
Countdown Timer - Start KA_KillTimer as a Repeating timer that will expire in 0.50 seconds
-
Trigger - Turn on Kill Streak Kill Loop <gen>
-
-
Else - Actions
-
-
-
Here proof that it's turned off, and not accidently on:
Here the in-game log:
Is a unit's death somehow triggering multiple times?