• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

What's a more efficient way of doing this trigger

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
I'm not the best with triggers and I'm sure there is a better way of doing this that I'm not aware of so please, any help is appreciated
  • Add players
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 10 (Light Blue) slot status) Equal to Is playing
        • Then - Actions
          • Leaderboard - Add (Matching player) to (Last created leaderboard) with label (Name of (Triggering player)) and value 0
        • Else - Actions
          • Do nothing
 
Something like this, perhaps?

  • Add Player
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Name of (Player((Integer A)))) and value 0
            • Else - Actions
I'd also like to mention that "Matching Player" and "Triggering Player" won't work with the way you're doing it right now.
 
Something like this, perhaps?

Add Player
Events
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Name of (Player((Integer A)))) and value 0
Else - Actions
[/trigger]

I'd also like to mention that "Matching Player" and "Triggering Player" won't work with the way you're doing it right now.

now I want to add score to the scoreboard, it's a scoreboard that counts how many kills a player has, this is what I came up with but I can't complete it
  • Adding kills
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Killing unit)) Equal to (Player((Integer A)))
            • Then - Actions
            • Else - Actions
 
Status
Not open for further replies.
Back
Top