• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Lives Counter [Solved]

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
I'm trying to make a leaderboard where you have a total of 6 lives, and when all the lives are used up, the person gets defeated.
For example: when my unit has 0 hit points, it must heal it and lose 1 life.

The problem is the game will crash! in the first process without healing my unit!
  • Setup Leaderboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled <Empty String>
      • Set VariableSet Leaderboard = (Last created leaderboard)
      • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = 6
      • Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Triggering player))]))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
      • Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Triggering player))]))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
      • Leaderboard - Add Player 21 (Coal) to Leaderboard with label West mobs and value 0
      • Leaderboard - Add Player 22 (Snow) to Leaderboard with label East mobs and value 0
  • Champion Hit Points
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to (Integer((Life of West Champion 0448 <gen>)))
      • Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to (Integer((Life of East Champion 0447 <gen>)))
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of West Champion 0448 <gen>) Less than or equal to 500.00
        • Then - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cffff0000West Cham...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of West Champion 0448 <gen>) Equal to 1.00
            • Then - Actions
              • Unit - Set life of West Champion 0448 <gen> to 100.00%
              • Game - Display to (All players) for 10.00 seconds the text: (West Champion heald! heals remaining: + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
              • -------- --------
              • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
              • Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]
            • Else - Actions
              • Trigger - Turn on Victory <gen>
        • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of East Champion 0447 <gen>) Less than or equal to 500.00
        • Then - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cffff0000East Cham...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of East Champion 0447 <gen>) Equal to 1.00
            • Then - Actions
              • Unit - Set life of East Champion 0447 <gen> to 100.00%
              • Game - Display to (All players) for 10.00 seconds the text: (East Champion heald! heals remaining: + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
              • -------- --------
              • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
              • Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]
            • Else - Actions
              • Trigger - Turn on Victory <gen>
        • Else - Actions
 
Level 6
Joined
Jul 12, 2021
Messages
95
I think this is what you are searching for my friend.

I used Damage Engine 5.7.1.2 by Bribe. Credits to him for the system.

If you use this multiboard on your map make sure toggle on the options "Use Custom Forces" and "Fixed Player Settings" or it will malfunction. Those options are in Scenario/Force Properties.

EDIT: This is my second post in this thread. I deleted the first one because there was a glitch in the file. I'm attaching the fixed file in this post.

EDIT: The multiboard will no longer malfunction if a unit that belongs to no player kills or dies.
 

Attachments

  • HiveworkshopMultiboard6LivesC.w3m
    66.1 KB · Views: 19
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
You're making some fundamental mistakes. For example:
  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Actions
    • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = 6
Who is the (Triggering player) in this situation?

The answer is no one, there is no (Triggering player) here. This is because none of the trigger's Events have referenced a Player.

Event Responses are exactly as they sound, RESPONSES to an Event.
So whenever an Event happens the Event Responses that belong to it are Set, much like how you Set global variables.
Some Event Responses are more generic like (Triggering unit) and (Triggering player) which belong to any Event that deals with Units/Players.

For example:
There is no (Dying unit) without the Event "A unit dies".
There is no (Attacking unit) and (Attacked unit) without the Event "A unit is attacked".
There is no (Triggering player) without an Event that involves a Player -> Player types a chat message, Player leaves the game, Player presses a key.



Regarding the crash, it's probably due to the fact that your Leaderboard is created after 1.00 second:
  • Time - Elapsed game time is 1.00 seconds

Meanwhile, your trigger that updates the Leaderboard runs every 0.50 seconds:
  • Time - Every 0.50 seconds of game time

This means that you're trying to update the Leaderboard before it even exists, and that could cause some serious problems like a crash.
The fix is simple, adjust the Elapsed game time so it's less than 0.50 OR Turn off your Periodic trigger by default and Turn it on once the Leaderboard has been created.



Regarding ChampionLives, if you want to Set the lives of each player you would use a Pick Every Player function:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Set VariableSet PN = (Player number of (Picked player))
      • Set VariableSet ChampionLives[PN] = 6

This function also allows you to take advantage of Player Groups which are essential for managing different teams of Players:
  • Player Group - Pick every player in WestTeam and do (Actions)
    • Loop - Actions
      • Set VariableSet PN = (Player number of (Picked player))
      • Set VariableSet ChampionLives[PN] = (ChampionLives[PN] + 1)
  • Player Group - Pick every player in EastTeam and do (Actions)
    • Loop - Actions
      • Set VariableSet PN = (Player number of (Picked player))
      • Set VariableSet ChampionLives[PN] = (ChampionLives[PN] + 1)

I recommend organizing your players into Player Groups at the start of the game (don't do it during Map Initialization, it can cause a Desync).
I would create Player Groups for each team and Set them up before any of your other triggers. Elapsed game time 0.01 seconds works nicely here:
  • WestTeam - Contains all of the West players
  • EastTeam - Contains all of the East player
  • WestTeamActive - Contains all of the West players who are actively playing the game (a leaving player will be removed from this group)
  • EastTeamActive - Contains all of the East players who are actively playing the game (a leaving player will be removed from this group)
  • Computers - Contains any Computer players you may want to reference (this one may not be necessary)
Here's an example of setting up WestTeam and WestTeamActive:
  • Setup Teams
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to WestTeam
      • Player Group - Add Player 2 (Blue) to WestTeam
      • Player Group - Add Player 3 (Teal) to WestTeam
      • Player Group - Pick every player in WestTeam and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to WestTeamActive
            • Else - Actions
This will give all of your future triggers easy access to all members of either team, and if you want to ignore players that aren't in the game or that have left the game you can do so.
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333

Sorry I do not use Damage Engine nor Unit Indexer, and in this case I use the leaderboard instead of a multiboard, anyway thank you for your help much appreciated.


Thank you Uncle,

If you remember how to play ltd, there was a unit that had 4 lives.
It was a building unit but it could attack like a tower, it was designed for your ally, but you could control it, so when that unit dies you will fail too.

So I came up with these triggers! yet the same issue my unit dies without counting lives!, but the crash problem was another trigger that was running!
  • Setup Leaderboard
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled <Empty String>
      • Set VariableSet Leaderboard = (Last created leaderboard)
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
        • Loop - Actions
          • Set VariableSet Integers_ChampionLives[(Player number of (Picked player))] = 6
          • Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Picked player))]))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
        • Loop - Actions
          • Set VariableSet Integers_ChampionLives[(Player number of (Picked player))] = 6
          • Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integers_ChampionLives[(Player number of (Picked player))]))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
      • -------- --------
      • Leaderboard - Add Player 21 (Coal) to Leaderboard with label West mobs and value 0
      • Leaderboard - Add Player 22 (Snow) to Leaderboard with label East mobs and value 0
  • Update Leaderboard
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to (Integer((Life of West Champion 0448 <gen>)))
      • Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to (Integer((Life of East Champion 0447 <gen>)))
  • West Champion HP
    • Events
      • Unit - West Champion 0448 <gen>'s life becomes Less than or equal to 500.00
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: ((|cffff0000 + (Name of West Champion 0448 <gen>)) + has less than 500 life remaining.|r)
  • East Champion HP
    • Events
      • Unit - East Champion 0447 <gen>'s life becomes Less than or equal to 500.00
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: ((|cffff0000 + (Name of East Champion 0447 <gen>)) + has less than 500 life remaining.|r)
  • West Champion Hit Points
    • Events
      • Unit - West Champion 0448 <gen>'s life becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit - Set life of West Champion 0448 <gen> to 100.00%
      • Game - Display to (All players) for 10.00 seconds the text: (((Name of West Champion 0448 <gen>) + heald! heals remaining: ) + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
      • -------- --------
      • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
      • Leaderboard - Change the value for Player 23 (Emerald) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]
  • East Champion Hit Points
    • Events
      • Unit - East Champion 0447 <gen>'s life becomes Equal to 1.00
    • Conditions
    • Actions
      • Unit - Set life of East Champion 0447 <gen> to 100.00%
      • Game - Display to (All players) for 10.00 seconds the text: (((Name of East Champion 0447 <gen>) + heald! heals remaining: ) + (String((Integers_ChampionLives[(Player number of (Triggering player))] - 1))))
      • -------- --------
      • Set VariableSet Integers_ChampionLives[(Player number of (Triggering player))] = (Integers_ChampionLives[(Player number of (Triggering player))] - 1)
      • Leaderboard - Change the value for Player 24 (Peanut) in Leaderboard to Integers_ChampionLives[(Player number of (Triggering player))]

Also my game timer doesn't work properly, it hide seconds!?
I'm using this Multiboard Counter, I did everything that he wrote, I'm still not sure what the problem is!
  • Setup Multiboard
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set VariableSet PlayerGroup_Multiboard = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)).)
      • -------- --------
      • Multiboard - Create a multiboard with 5 columns and ((Number of players in PlayerGroup_Multiboard) + 3) rows, titled (|cffffcc00Champion TD|r + |cffff0000(Selecting Modes)|r).
      • Set VariableSet Multiboard = (Last created multiboard)
      • Set VariableSet Integer_Multiboard = 0
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) is in PlayerGroup_Multiboard.) Equal to True
            • Then - Actions
              • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
              • Set VariableSet Integers_MultiboardRow[(Integer A)] = (Integer_Multiboard + 1)
              • Multiboard - Set the text for Multiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to ((Strings_PlayersColor[(Integer A)] + (Name of (Player((Integer A))))) + |r)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player((Integer A))) is an ally of Player 23 (Emerald).) Equal to True
                • Then - Actions
                  • Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(22)) or IsPlayerObserver(GetLocalPlayer()) then
                  • Multiboard - Set the text for Multiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to (String(Integers_Kills[(Integer A)]))
                  • Custom script: else
                  • Multiboard - Set the text for Multiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to ?
                  • Custom script: endif
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player((Integer A))) is an ally of Player 24 (Peanut).) Equal to True
                • Then - Actions
                  • Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(23)) or IsPlayerObserver(GetLocalPlayer()) then
                  • Multiboard - Set the text for Multiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to (String(Integers_Kills[(Integer A)]))
                  • Custom script: else
                  • Multiboard - Set the text for Multiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to ?
                  • Custom script: endif
                • Else - Actions
            • Else - Actions
      • -------- --------
      • -------- First Row --------
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to |cffffcc00Players N...
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to |cffffcc00Values|r
      • Multiboard - Set the text for Multiboard item in column 3, row 1 to |cffffcc00Incomes|r
      • Multiboard - Set the text for Multiboard item in column 4, row 1 to |cffffcc00Lumbers|r
      • Multiboard - Set the text for Multiboard item in column 5, row 1 to |cffffcc00Scores|r
      • -------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row ((Number of players in PlayerGroup_Multiboard) + 2) to -------------------...
      • Multiboard - Set the text for Multiboard item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 2) to -------------------...
      • Multiboard - Set the text for Multiboard item in column 3, row ((Number of players in PlayerGroup_Multiboard) + 2) to -------------------...
      • Multiboard - Set the text for Multiboard item in column 4, row ((Number of players in PlayerGroup_Multiboard) + 2) to -------------------...
      • Multiboard - Set the text for Multiboard item in column 5, row ((Number of players in PlayerGroup_Multiboard) + 2) to -------------------...
      • Multiboard - Set the text for Multiboard item in column 1, row ((Number of players in PlayerGroup_Multiboard) + 3) to Game Time
      • -------- --------
      • Multiboard - Set the width for Multiboard item in column 0, row 0 to 5.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 1, row 0 to 12.00% of the total screen width
      • -------- --------
      • Multiboard - Set the display style for Multiboard item in column 1, row 0 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 2, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 3, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 4, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 5, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 1 to Show text and Hide icons
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_AllPlayers and do (Actions)
        • Loop - Actions
          • Multiboard - Set the icon for Multiboard item in column 1, row Integers_MultiboardRow[(Player number of (Picked player))] to Strings_PlayerRaceIcon[(Player number of (Picked player))]
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for Multiboard item in column (Integer A), row ((Number of players in PlayerGroup_Multiboard) + 2) to Show text and Hide icons
          • Multiboard - Set the display style for Multiboard item in column (Integer A), row ((Number of players in PlayerGroup_Multiboard) + 3) to Show text and Hide icons
      • Multiboard - Show Multiboard
      • Multiboard - Maximize Multiboard
  • Update Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet Integers_Seconds[0] = (Integers_Seconds[0] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Seconds[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = (Integers_Seconds[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Seconds[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = (Integers_Minutes[0] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Minutes[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = 0
          • Set VariableSet Integers_Minutes[1] = (Integers_Minutes[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Minutes[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = 0
          • Set VariableSet Integers_Minutes[1] = 0
          • Set VariableSet Integers_Hours[0] = (Integers_Hours[0] + 1)
        • Else - Actions
      • -------- --------
      • Set VariableSet String_TimeElapsed = (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
      • Multiboard - Set the text for Multiboard item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
 

Attachments

  • 1.jpg
    1.jpg
    28.2 KB · Views: 24
  • 2.jpg
    2.jpg
    28.2 KB · Views: 23
  • 3.jpg
    3.jpg
    23.2 KB · Views: 19
Level 6
Joined
Jul 12, 2021
Messages
95
my unit dies without counting lives
That's because it's very rare that the event of your trigger happen. Your event is the next one:
  • Unit - West Champion 0448 <gen>'s life becomes Equal to 1.00
That event very rarely happens because the life of the unit has to be exactly 1. Here is a recreation of a scenario:
1. West Champion is about to die. Let's assume he has 15 hp.
2. West Champion recieves damage. Damage recieved is 15. West Champion life is now 0. West Champion life went from 15 to 0. It was NEVER 1. Since it was never 1 your trigger do not gets activated.
If the damage recieved had been exactly 14, your trigger would have been activated. The unit would heal and the lives would also decrease. If the damage is higher than 14 or lower than 14 it will not activate.
Warcraft 3 uses up to 3 decimals, so, in theory, numbers that are 14.001 or higher will not activate the trigger; and any numbers that are 13.999 or lower will not activate the trigger. In this situation Warcraft 3 isn't that precise when using three decimals, but that's how it works in theory.
Since units have damage type, armor type, armor and life regeneration it is very hard to achieve the event of your trigger.
...when my unit has 0 hit points, it must heal it and lose 1 life.
What you are trying to achieve is very hard without a Damage Detection System.

If you insist in not using a Damage Detection System and using the same method you are using, then at least change the event from "Equal to" to "Less than or equal to". This way all numbers that are less than 1 will cause the trigger to activate. I would also strongly recommend to increase the number 1 in your event.


  • Multiboard - Set the text for Multiboard item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
In the previous line of your trigger you are using "Integer_Hours[1]", yet, that variable is never defined in your triggers. Because of this it will always be valued as it's default value, which is 0 (unless you modified it).

  • Multiboard - Set the width for Multiboard item in column 0, row 0 to 5.00% of the total screen width
  • Multiboard - Set the width for Multiboard item in column 1, row 0 to 12.00% of the total screen width
Also my game timer doesn't work properly, it hide seconds!?
You set the size for colum 0, row 0 and column 1, row 0. But you do not do that for column 2, row "((Number of players in PlayerGroup_Multiboard) + 3)"; here is where your timer text is located in the multiboard. When there is many text and little space, the multiboards hide values. Try increasing the width of your multiboard in that specific column and row.



Your Trigger Update Timer is inefficient because it runs several actions that are unnecesary.

  • Update Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet Integers_Seconds[0] = (Integers_Seconds[0] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Seconds[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = (Integers_Seconds[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Seconds[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = (Integers_Minutes[0] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Minutes[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = 0
          • Set VariableSet Integers_Minutes[1] = (Integers_Minutes[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integers_Minutes[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integers_Seconds[0] = 0
          • Set VariableSet Integers_Seconds[1] = 0
          • Set VariableSet Integers_Minutes[0] = 0
          • Set VariableSet Integers_Minutes[1] = 0
          • Set VariableSet Integers_Hours[0] = (Integers_Hours[0] + 1)
        • Else - Actions
      • -------- --------
      • Set VariableSet String_TimeElapsed = (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
      • Multiboard - Set the text for Multiboard item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
I modified it, here is the result:

  • UpdateTimer Fixed
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet Integer_Seconds[0] = (Integer_Seconds[0] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Seconds[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integer_Seconds[0] = 0
          • Set VariableSet Integer_Seconds[1] = (Integer_Seconds[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Seconds[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integer_Seconds[1] = 0
          • Set VariableSet Integer_Minutes[0] = (Integer_Minutes[0] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Minutes[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integer_Minutes[1] = (Integer_Minutes[1] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Minutes[1] Equal to 6
        • Then - Actions
          • Set VariableSet Integer_Minutes[1] = 0
          • Set VariableSet Integer_Hours[0] = (Integer_Hours[0] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Hours[0] Equal to 10
        • Then - Actions
          • Set VariableSet Integer_Hours[0] = 0
          • Set VariableSet Integer_Hours[1] = 0
        • Else - Actions
      • Set VariableSet String_TimeElapsed = (((String(Integer_Hours[1])) + ((String(Integer_Hours[0])) + :)) + (((String(Integer_Minutes[1])) + ((String(Integer_Minutes[0])) + :)) + ((String(Integer_Seconds[1])) + (String(Integer_Seconds[0])))))
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to String_TimeElapsed
Changes done:
Deleted three of this lines:
  • Set VariableSet Integers_Seconds[0] = 0
Deleted two of this lines:
  • Set VariableSet Integers_Seconds[1] = 0
Deleted one of this line:
  • Set VariableSet Integers_Minutes[0] = 0
Added this chunk of triggers:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Integer_Hours[0] Equal to 10
    • Then - Actions
      • Set VariableSet Integer_Hours[0] = 0
      • Set VariableSet Integer_Hours[1] = 0
    • Else - Actions
Replaced the line:
  • Multiboard - Set the text for Multiboard item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to (((String(Integers_Hours[1])) + ((String(Integers_Hours[0])) + : )) + (((String(Integers_Minutes[1])) + ((String(Integers_Minutes[0])) + : )) + ((String(Integers_Seconds[1])) + (String(Integers_Seconds[0])))))
With the next line:
  • Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Number of players in PlayerGroup_Multiboard) + 3) to String_TimeElapsed
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
When are you setting PlayerGroup_WestTeam and PlayerGroup_EastTeam? Your Leaderboard is created at 0.01 seconds which is when I said you should Set the Player Group variables. This makes me think the groups aren't setup properly.

And again, you're referencing (Triggering player) in a trigger that has no Events that involve a player.

Event Responses like (Triggering player) are set in response to Events that involved a Player. If you don't see the word "PLAYER" in your Event then you can't use (Triggering player) there. There's at least 1 exception to this rule but for the most part what I said will hold true.

I think you're under the impression that (Triggering player) somehow references each player at the same time. It does not do this, it's a Player variable that can only be referencing a single Player at a time. It's no different from this:
  • Set Variable MyPlayerVariable = (Owner of (Last created unit))

So with that in mind, look at this Event:
  • Events
    • Unit - West Champion 0448 <gen>'s life becomes Equal to 1.00
This Event involves a Unit. There is no (Triggering player) here because there is no Player here.

Even if (Triggering player) could be used here it'd be Set to the Owner of West Champion 0448 since that's the ONLY possible option for it.


When I showed you how to use the Pick Every Player action I was under the impression that your map worked differently. I thought you wanted each player to have 6 lives, but in reality you just want each team's Champion to have 6 lives. In other words, you want Player 23 and Player 24 to have 6 lives or both teams to have 6 lives:

Removing a life from West Team:
  • Set VariableSet Integers_ChampionLives[23] = (Integers_ChampionLives[23] - 1)

Removing a life from East Team:
  • Set VariableSet Integers_ChampionLives[24] = (Integers_ChampionLives[24] - 1)

And since Player's don't have their own Lives an Array is probably not even necessary:
  • Set VariableSet WestLives = (WestLives - 1)

Removing a life from East Team:
  • Set VariableSet EastLives = (EastLives - 1)

Also, note that the Pick Every Player action will run the Actions you put inside of it once for each (Picked player). So when you Add Player 23/24 to the Leaderboard inside of your Pick Every Player action, understand that you're adding them to the Leaderboard X times, where X is the total number of players in that Player Group. You definitely don't want to do this since Adding a Player to a Leaderboard more than once doesn't make any sense.
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
When are you setting PlayerGroup_WestTeam and PlayerGroup_EastTeam? Your Leaderboard is created at 0.01 seconds which is when I said you should Set the Player Group variables. This makes me think the groups aren't setup properly.
Is it possible to do this without setting a timer? like this
If so, the stupid question is, is this during the Map Initialization? Or do I just think it makes a difference? I mean, yes, I see the events "Map initialization" but I kinda like doing this :D
  • Initilization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Run Setup Misc <gen> (ignoring conditions)
      • Trigger - Run Setup Teams <gen> (ignoring conditions)
      • Trigger - Run Setup Player Properties <gen> (ignoring conditions)
      • Trigger - Run Setup Builder Types <gen> (ignoring conditions)
      • Trigger - Run Setup Tower Types <gen> (ignoring conditions)
      • Trigger - Run Setup Hybrid Types <gen> (ignoring conditions)
  • Setup Teams
    • Events
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to PlayerGroup_WestTeam
      • Player Group - Add Player 2 (Blue) to PlayerGroup_WestTeam
      • Player Group - Add Player 3 (Teal) to PlayerGroup_WestTeam
      • Player Group - Add Player 4 (Purple) to PlayerGroup_WestTeam
      • Player Group - Add Player 5 (Yellow) to PlayerGroup_WestTeam
      • Player Group - Add Player 6 (Orange) to PlayerGroup_WestTeam
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PlayerGroup_WestTeamActive
            • Else - Actions
      • -------- --------
      • Player Group - Add Player 7 (Green) to PlayerGroup_EastTeam
      • Player Group - Add Player 8 (Pink) to PlayerGroup_EastTeam
      • Player Group - Add Player 9 (Gray) to PlayerGroup_EastTeam
      • Player Group - Add Player 10 (Light Blue) to PlayerGroup_EastTeam
      • Player Group - Add Player 11 (Dark Green) to PlayerGroup_EastTeam
      • Player Group - Add Player 12 (Brown) to PlayerGroup_EastTeam
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PlayerGroup_EastTeamActive
            • Else - Actions
About timer I put some space between : so I think that was an issue!?
like it was this 00 : 00 : 00 instead of this 00:00:00

Well, I tried many different ways and I could not figure how I'm gonna do that!!!
So instead I copied Bribe system to my map.
Now the problem is that the counting will not stop! even if it hits 0, it still becomes negative!
  • Setup Leaderboard
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled <Empty String>
      • Set VariableSet Leaderboard = (Last created leaderboard)
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_WestChampionLives = 6
          • Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_EastChampionLives = 6
          • Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
      • -------- --------
      • Leaderboard - Add Player 21 (Coal) to Leaderboard with label West mobs and value 0
      • Leaderboard - Add Player 22 (Snow) to Leaderboard with label East mobs and value 0
  • Champion Hit Points
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
      • -------- --------
      • -------- East Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to East Champion 0447 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of East Champion 0447 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_EastChampionLives - 1))) + |r)))
          • Set VariableSet Integer_EastChampionLives = (Integer_EastChampionLives - 1)
          • Leaderboard - Change the label for Player 24 (Peanut) in Leaderboard to ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r))
        • Else - Actions
  • Defeat West
    • Events
      • Unit - West Champion 0448 <gen> Dies
    • Conditions
      • Integer_WestChampionLives Equal to 0
    • Actions
      • Countdown Timer - Destroy TimerWindow_LevelStart
      • Multiboard - Destroy Multiboard
      • Leaderboard - Destroy Leaderboard
      • -------- --------
      • Cinematic - Clear the screen of text messages for (All players).
      • Sound - Play HeroicVictory <gen>
      • Sound - Stop music After fading
      • Unit - Pause all units
      • Trigger - Run End Scores <gen> (ignoring conditions)
      • -------- --------
      • Unit - Make West Champion 0448 <gen> face Default building facing over 0.00 seconds
      • Unit - Make East Champion 0447 <gen> face Default building facing over 0.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 1.00 seconds
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
      • Cinematic - Enable user control for (All players).
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 23 (Emerald).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Diagonal Slash and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Apply Camera West <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera West2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 24 (Peanut).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Dream and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Animation - Play East Champion 0447 <gen>'s Stand Victory animation
          • Camera - Apply Camera East <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera East2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • -------- Defeat/Victory --------
      • Wait 5.00 seconds
      • Cinematic - Fade out over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Game - Display to (All allies of Player 23 (Emerald).) for 60.00 seconds the text: |cffff0000You Lose....
      • Game - Display to (All allies of Player 24 (Peanut).) for 60.00 seconds the text: |cffffcc00You Win.|r
      • Wait 1.00 seconds
      • Trigger - Run Game Over Countdown <gen> (ignoring conditions)

And these are other ways that I have tried, but it did not make a difference, though!
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • Trigger - Run Defeat West <gen> (checking conditions)
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Game - Defeat Player 23 (Emerald) with the message: Defeat!
            • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
Checking Player Status during Map Initialization can cause a desync. That is why I recommended doing it at 0.01 seconds. The Map Initialization + Run trigger design is a good way to keep things organized but you'll have to make an exception if you don't want desyncs. I'd run all of the triggers that don't require the Player Groups during Map Initialization and everything else after 0.01 seconds (in proper order).

Also, I don't see a Timer being started/paused in any of those triggers so I'm not too sure what you're talking about. What counts below 0?

And this doesn't make sense anymore:
  • Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
    • Loop - Actions
      • Set VariableSet Integer_WestChampionLives = 6
      • Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
  • -------- --------
  • Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
    • Loop - Actions
      • Set VariableSet Integer_EastChampionLives = 6
      • Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
You don't need Pick Every Player here seeing as how you're not referencing (Picked players) anymore. This was originally designed for giving EACH player 6 lives but after further discussion I realized you didn't want that.

Also, like I said before, you're Adding Player 23/24 to the Leaderboard multiple times here. Pick Every Player LOOPS the Actions, meaning it runs the Actions once for each (Picked player). If there are 5 players in PlayerGroup_WestTeam then it will run the Loop - Actions 5 times.

You can now simplify it to this:
  • Set VariableSet Integer_WestChampionLives = 6
  • Set VariableSet Integer_EastChampionLives = 6
  • Leaderboard - Add Player 23 (Emerald) to Leaderboard with label ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r)) and value (Integer((Life of West Champion 0448 <gen>)))
  • Leaderboard - Add Player 24 (Peanut) to Leaderboard with label ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r)) and value (Integer((Life of East Champion 0447 <gen>)))
 
Last edited:
Level 6
Joined
Jul 12, 2021
Messages
95
AlwaysAndForever your post is a little confusing. Try being a little more specific next times.


About timer I put some space between : so I think that was an issue!?
like it was this 00 : 00 : 00 instead of this 00:00:00
When I fixed your trigger I didn't notice you had those spaces. It won't be an issue if you have the spaces as long as you set the proper width for the multiboard on that specific cell. I'm attaching a map in this post with only a Multiboard that tracks time and has spaces between ":". Feel free to NOT check it.

Now the problem is that the counting will not stop! even if it hits 0, it still becomes negative!
I'm not sure if I understood you. Do you mean that when the West Champion has 0 lives it heals and the multiboard sets lives remaining to -1? If that's what you were asking, then you need to add 1 condition:
  • Integer_WestChampionLives greater than or equal to 1
Of the last three triggers that you posted the second one made sense to me:

  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
I added the condition I just said to the previous trigger:

  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
          • Integer_WestChampionLives greater than or equal to 1
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions


The next trigger doesn't make sense because of what you put in the Else. The condition is "DamageEventTarget Equal to West Champion 0448 <gen>". In Bribe's system this means that West Champion was the victim of a strike that deals damage. With the event you have, it will mean: If west champion recieves damage that would kill him then run the Then conditions. So far it makes sense. But, if the victim of the strike that deals damage is not WestChampion, then the actions in the Else will run. This means that any single unit that is not West Champion will run the action in the Else when they are the victim of a strike that would kill them.
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • Trigger - Run Defeat West <gen> (checking conditions)


The problem with the next trigger is that only player 23 will be defeated. If I understood your ideas correctly, then you want to defeat the players that belong to the West Team. Defeating player 23 has no purpose, since it is no player, it is an NPC.
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Game - Defeat Player 23 (Emerald) with the message: Defeat!
            • Else - Actions
Your trigger Champion Hit Points makes sense to me. I would just merge it with the first trigger of the last three triggers you posted. This is the result:

  • Champion Hit Points
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen
          • Integer_WestChampionLives greater than or equal to 1
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen
          • Integer_WestChampionLives Equal to 0
        • Then - Actions
          • Trigger - Run Defeat West <gen> (ignoring conditions)
        • Else - Actions
      • -------- --------
      • -------- East Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to East Champion 0447 <gen>
          • Integer_EastChampionLives greater than or equal to 1
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of East Champion 0447 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_EastChampionLives - 1))) + |r)))
          • Set VariableSet Integer_EastChampionLives = (Integer_EastChampionLives - 1)
          • Leaderboard - Change the label for Player 24 (Peanut) in Leaderboard to ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to East Champion 0448 <gen
          • Integer_EastChampionLives Equal to 0
        • Then - Actions
          • Trigger - Run Defeat East <gen> (ignoring conditions)
        • Else - Actions


There is still a problem with the previous trigger. In the section "-------- West Champion --------" you substract Integer_WestChampionLives by 1. This will cause both of the Ifs in "-------- West Champion --------" to run. To prevent this we have to change the order of the Ifs. Here is the final change:

  • Champion Hit Points
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen
          • Integer_WestChampionLives Equal to 0
        • Then - Actions
          • Trigger - Run Defeat West <gen> (ignoring conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen
          • Integer_WestChampionLives greater than or equal to 1
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
      • -------- --------
      • -------- East Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to East Champion 0448 <gen
          • Integer_EastChampionLives Equal to 0
        • Then - Actions
          • Trigger - Run Defeat East <gen> (ignoring conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to East Champion 0447 <gen>
          • Integer_EastChampionLives greater than or equal to 1
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of East Champion 0447 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_EastChampionLives - 1))) + |r)))
          • Set VariableSet Integer_EastChampionLives = (Integer_EastChampionLives - 1)
          • Leaderboard - Change the label for Player 24 (Peanut) in Leaderboard to ((Name of Player 24 (Peanut)) + (( |cffffcc00( + (String(Integer_EastChampionLives))) + )|r))
        • Else - Actions
 

Attachments

  • HiveworkshopMultiboardThatTracksTime.w3m
    46.3 KB · Views: 20
Level 10
Joined
Jun 20, 2017
Messages
333
Thanks guys 🙏🌹

Ok so everything that don't require the groups and loops(such as Player Groups/Unit Groups/Destructible Groups and etc.) during Map Initialization, and everything else after 0.01 seconds.

And this doesn't make sense anymore:
Yes, I know that, but yesterday after I changed everything and touched everything, I thought maybe it should be in the Player Group To adjust the lives!

It won't be an issue
I did everything you told me yesterday and that did not solve the problem without deleting the space, and today I copied your multiboard into my map and thought it might make a difference, but I was wrong, same issue(weird). Maybe my other triggers caused it!


I meant that when lives of West Champion became 0, it should die and I should lose, but that did not happen!
Anyways thanks to you that problem solved, but my defeat trigger cause the game crash!
  • Defeat West
    • Events
    • Conditions
    • Actions
      • Countdown Timer - Destroy TimerWindow_LevelStart
      • Multiboard - Destroy Multiboard
      • Leaderboard - Destroy Leaderboard
      • -------- --------
      • Sound - Play HeroicVictory <gen>
      • Sound - Stop music After fading
      • Unit - Pause all units
      • Cinematic - Clear the screen of text messages for (All players).
      • Trigger - Run End Scores <gen> (ignoring conditions)
      • -------- --------
      • Unit - Make West Champion 0448 <gen> face Default building facing over 0.00 seconds
      • Unit - Make East Champion 0447 <gen> face Default building facing over 0.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 1.00 seconds
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
      • Cinematic - Enable user control for (All players).
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 23 (Emerald).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Diagonal Slash and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Apply Camera West <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera West2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 24 (Peanut).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Dream and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Animation - Play East Champion 0447 <gen>'s Stand Victory animation
          • Camera - Apply Camera East <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera East2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • -------- Defeat/Victory --------
      • Wait 5.00 seconds
      • Cinematic - Fade out over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Game - Display to (All allies of Player 23 (Emerald).) for 60.00 seconds the text: |cffff0000You Lose....
      • Game - Display to (All allies of Player 24 (Peanut).) for 60.00 seconds the text: |cffffcc00You Win.|r
      • Wait 1.00 seconds
      • Trigger - Run Game Over Countdown <gen> (ignoring conditions)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
This is the only thing I said you shouldn't do during Map Initialization:
  • Conditions:
  • ((Picked player) slot status) Equal to Is playing
Like I said before, checking Player Controller Status during Map Initialization can cause a desync.

To debug the crashes you should disable certain Actions. What I'd try disabling first:
Pause all units, Run End Scores, Run Game Over Countdown (if it even makes it that far), and all of the Cinematic stuff.

The rest of the Actions look pretty safe but you should test them anyway if the crash keeps happening.

Also, this trigger is setup wrong:
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet LethalDamageHP = 1000000000.00
          • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String((Integer_WestChampionLives - 1))) + |r)))
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
Your Else - Actions runs whenever ANY unit besides the West Champion receives lethal damage.


You want to check how many Lives are left immediately after reducing the number of lives:
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
              • Set VariableSet LethalDamageHP = 1000000000.00
              • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String(Integer_WestChampionLives)) + |r)))
              • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
Also, like this the Champion actually dies when it runs out of lives.
 
Last edited:
Level 6
Joined
Jul 12, 2021
Messages
95
You want to check how many Lives are left immediately after reducing the number of lives:
  • Champion Hit Points Copy
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
              • Set VariableSet LethalDamageHP = 1000000000.00
              • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String(Integer_WestChampionLives)) + |r)))
              • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
Also, like this the Champion actually dies when it runs out of lives.

Uncle I'm afraid there's a minor mistake in the last trigger you posted. EDIT: It's not a mistake.


The line "Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)" should go inside the Else of this chunk of triggers:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Integer_WestChampionLives Equal to 0
    • Then - Actions
      • Trigger - Run Defeat West <gen> (ignoring conditions)
    • Else - Actions
      • Set VariableSet LethalDamageHP = 1000000000.00
      • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String(Integer_WestChampionLives)) + |r)))
      • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
Otherwise this happens:
1. West Champion has 1 life remaining.
2. LethalDamageEvent becomes Equal to 1.00
3. Integer_WestChampionLives is substracted 1.
4. Integer_WestChampionLives is now 0.
5. The next chunk of triggers are run if Integer_WestChampionLives is 0.
6. Since it is 0 the trigger Defeat West is run. <------- Mistake. West Champion had 1 life remaining, not 0!

By changing the order this happens:
1. West Champion has 1 life remaining.
2. LethalDamageEvent becomes Equal to 1.00
3. The next chunk of triggers are run if Integer_WestChampionLives is 0.
4. Since it is not 0 Defeat West isn't run.
5. Integer_WestChampionLives is substracted 1.
6. Integer_WestChampionLives is now 0. <------- No mistake. West Champion now has 0 lives remaining.


Here is the trigger fixed:

  • Champion Hit Points Copy Fixed
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- West Champion --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventTarget Equal to West Champion 0448 <gen>
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_WestChampionLives Equal to 0
            • Then - Actions
              • Trigger - Run Defeat West <gen> (ignoring conditions)
            • Else - Actions
              • Set VariableSet Integer_WestChampionLives = (Integer_WestChampionLives - 1)
              • Set VariableSet LethalDamageHP = 1000000000.00
              • Game - Display to (All players) for 5.00 seconds the text: (((Name of West Champion 0448 <gen>) + heals remaining: ) + (|cffffcc00 + ((String(Integer_WestChampionLives)) + |r)))
              • Leaderboard - Change the label for Player 23 (Emerald) in Leaderboard to ((Name of Player 23 (Emerald)) + (( |cffffcc00( + (String(Integer_WestChampionLives))) + )|r))
        • Else - Actions
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
I debugged it with this
  • Defeat West
    • Events
    • Conditions
    • Actions
      • Countdown Timer - Destroy TimerWindow_LevelStart
      • Multiboard - Destroy Multiboard
      • Leaderboard - Destroy Leaderboard
      • -------- --------
      • Sound - Play HeroicVictory <gen>
      • Sound - Stop music After fading
      • -------- --------
      • Unit - Pause all units
      • Unit - Make West Champion 0448 <gen> face Default building facing over 0.00 seconds
      • Unit - Make East Champion 0447 <gen> face Default building facing over 0.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Trigger - Run End Scores <gen> (ignoring conditions)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 1.00 seconds
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 23 (Emerald).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Diagonal Slash and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Apply Camera West <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera West2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • Player Group - Pick every player in (All allies of Player 24 (Peanut).) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out and back in over 3.00 seconds using texture Dream and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Animation - Play East Champion 0447 <gen>'s Stand Victory animation
          • Camera - Apply Camera East <gen> for (Picked player) over 0.00 seconds
          • Camera - Apply Camera East2 <gen> for (Picked player) over 10.00 seconds
      • -------- --------
      • -------- Defeat/Victory --------
      • Wait 5.00 seconds
      • Cinematic - Fade out over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
      • Cinematic - Enable user control for (All players).
      • Game - Display to (All allies of Player 23 (Emerald).) for 60.00 seconds the text: |cffff0000You Lose....
      • Game - Display to (All allies of Player 24 (Peanut).) for 60.00 seconds the text: |cffffcc00You Win.|r
      • Wait 1.00 seconds
      • Trigger - Run Game Over Countdown <gen> (ignoring conditions)
The thread is now solved, thank you again.

Since you guys now know a little thing about my project, can you check this out?
Receive ally gold
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,558
There's an error here:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Integer_Minutes[0] Equal to 10
    • Then - Actions
      • Set VariableSet Integer_Minutes[0] = 0
      • Set VariableSet Integer_Minutes[1] = (Integer_Minutes[1] + 1)
    • Else - Actions
You were missing the Set = 0 line.

Also, you may want to increase the Width of the Multiboard as well.
 
Status
Not open for further replies.
Top