• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger for this?

Status
Not open for further replies.
Level 6
Joined
Oct 10, 2013
Messages
173
ok i want to count the number of hero killed by team one (i.e players from 1 to 5) and team 2 (i.e players from 6 to 10) what will be trigger for showing the totall kills per team and i want to set win condition = 150 kills..
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
^ Read a multi board stuff

Create a trigger for multiboard to show to all players the kills.
Create integer variable counter.
Create Event that Unit Dies, If killing unit is a hero and owner of killing unit == player ( 0 ) or player red then actions: Set integer variable counter = integer variable counter + 1.
If you want MPI ( Multi Player Instance ), then you would use a array for integer variable counter like this: Set integer variable counter[ Player Number of KillingUnit() ] = blabla.
How to show the kills from players? Make a row to the multiboard and colums that names Kill Points, then set a text to the "Kill Points" S2I ( theIntegerVariable Counter ) so that it will display the integer counter of how many total kills.
Sorry if I can't shows the trigger because I'm in mobile ^^.
 
Here you go.

  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit = (Killing unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of TempUnit) Not equal to Neutral Hostile
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of TempUnit) Equal to Player 1 (Red)
              • (Owner of TempUnit) Equal to Player 2 (Blue)
              • (Owner of TempUnit) Equal to Player 3 (Teal)
              • (Owner of TempUnit) Equal to Player 4 (Purple)
              • (Owner of TempUnit) Equal to Player 5 (Yellow)
            • Then - Actions
              • Set team_kills[0] = (team_kills[0] + 1)
            • Else - Actions
              • Set team_kills[1] = (team_kills[1] + 1)
        • Else - Actions
      • Set TempUnit = No unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • team_kills[0] Greater than or equal to 150
        • Then - Actions
          • Game - Display to (All players) the text: Team 1 wins.
          • Game - Defeat Player 6 (Orange) with the message: Defeat!
          • Game - Defeat Player 7 (Green) with the message: Defeat!
          • Game - Defeat Player 8 (Pink) with the message: Defeat!
          • Game - Defeat Player 9 (Gray) with the message: Defeat!
          • Game - Defeat Player 10 (Light Blue) with the message: Defeat!
        • Else - Actions
          • Game - Display to (All players) the text: Team 2 wins.
          • Game - Defeat Player 1 (Red) with the message: Defeat!
          • Game - Defeat Player 2 (Blue) with the message: Defeat!
          • Game - Defeat Player 3 (Teal) with the message: Defeat!
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
          • Game - Defeat Player 5 (Yellow) with the message: Defeat!
 
Then - Actions
Set team_kills[0] = (team_kills[0] + 1)
Else - Actions
Set team_kills[1] = (team_kills[1] + 1)
how to set this +1 ????

Arithmetic.

attachment.php
 

Attachments

  • Untitled.png
    Untitled.png
    24.5 KB · Views: 120

  • Ereignisse
    • Einheit - A unit dies
  • Bedingungen
    • ((Triggering unit) is Ein Hero) Gleich True
    • ((Killing unit) is Ein Hero) Gleich True
  • Aktionen
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Bedingungen
        • (Player number of (Owner of (Triggering unit))) < 6
      • 'THEN'-Aktionen
        • Set Team_2_Kill_Count = (Team_2_Kill_Count + 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • Team_2_Kill_Count = 150
          • 'THEN'-Aktionen
            • For each (Integer A) from 1 to 10, do (Actions)
              • Schleifen - Aktionen
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • 'IF'-Bedingungen
                    • (Integer A) < 6
                  • 'THEN'-Aktionen
                    • Spiel - Defeat (Player((Integer A))) with the message: Niederlage!
                  • 'ELSE'-Aktionen
                    • Spiel - Victory (Player((Integer A))) (Zeigen dialogs, Zeigen scores)
          • 'ELSE'-Aktionen
      • 'ELSE'-Aktionen
        • Set Team_1_Kill_Count = (Team_1_Kill_Count + 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • Team_1_Kill_Count = 150
          • 'THEN'-Aktionen
            • For each (Integer A) from 1 to 10, do (Actions)
              • Schleifen - Aktionen
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • 'IF'-Bedingungen
                    • (Integer A) Kleiner als < 6
                  • 'THEN'-Aktionen
                    • Spiel - Victory (Player((Integer A))) (Zeigen dialogs, Zeigen scores)
                  • 'ELSE'-Aktionen
                    • Spiel - Defeat (Player((Integer A))) with the message: Niederlage!
          • 'ELSE'-Aktionen
Team_Kill_Count variables are integers.

Read tutorials about multiboards to display current kills or deaths. Or maybe you can stay with Leaderboard if you only need one information of each team.
 
There's a simple way to see what kind of variable a variable is :
1. All Variables under [...] is always Integer
2. Variable really differs from type to type, the one that is pretty exclusive and almost hard to differs is Integer and Real, Integer has no .XX value after the last number while Reals have it. Others can be seen their difference just by reading their comparison.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
hexadecimals are integers, for instance 0xff00afbc but those are only available to Jass afaik

Real value is floating point value which can have values behind the decimal place(so 5.4232 is real, 5 is either integer or implicitly casted to 5.00 real)
 
Status
Not open for further replies.
Top