• 🏆 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!

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
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
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.
 
Level 8
Joined
Jul 29, 2010
Messages
319
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.
Top