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

[Solved] what to know if this works or not

Status
Not open for further replies.
Level 11
Joined
Nov 13, 2010
Messages
211
hi i just what to know if this works or not
  • player leaves
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type |cffb8860bEscaper|r) and do (Actions)
        • Loop - Actions
          • Set Position = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Player 1 (Red)
              • (Player 1 (Red) slot status) Equal to Has left the game
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Remove (Picked unit) from the game
              • Game - Display to (All players) the text: ((Name of (Picked player)) + |cffff0000 has left the game|r)
            • Else - Actions
              • Do nothing
      • Unit Group - Pick every unit in (Units of type |cffb8860bEscaper|r) and do (Actions)
        • Loop - Actions
          • Set Position = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Player 2 (Blue)
              • (Player 2 (Blue) slot status) Equal to Has left the game
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Remove (Picked unit) from the game
              • Game - Display to (All players) the text: ((Name of (Picked player)) + |cffff0000 has left the game|r)
            • Else - Actions
              • Do nothing
 
Last edited:
I fixed the tags, use [TRIGGER] tags for GUI code.

Try to form precise questions - who should know what you expect it exactly to work like?
I guess what you want is to use the events "Player - A player leaves the game' -- and then you want to Pick All Units from the Leaving Player and remove them, and print a message. A periodic trigger check is most likely not required, or wanted.
 
Level 11
Joined
Nov 13, 2010
Messages
211
can u make a trigger 4 me so i can see how it looks like ?



so it can work like this ?
  • player leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type |cffb8860bEscaper|r) and do (Actions)
        • Loop - Actions
          • Set Position = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Has left the game
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Remove (Picked unit) from the game
              • Game - Display to (All players) the text: ((Name of (Picked player)) + |cffff0000 has left the game|r)
            • Else - Actions
              • Do nothing
 
Last edited:
You made a good approach already.

Though, instead of picking all units of one type, do pick all units by (Triggering/Leaving Player), then make a check if picked unit has the wanted unit type, and remove it.

Check is player is in game is not needed anymore, because you directly catch the event, when the player leaves the game.

The Position variable looks a bit arbiatry, too. Not sure what's its sense currently.
 
Level 11
Joined
Nov 13, 2010
Messages
211
so as easy as this it can work ?
  • player leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to |cffb8860bEscaper|r
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
              • Game - Display to (All players) the text: ((Name of (Triggering player)) + |cffff0000 has left the game|r)
            • Else - Actions
 
It looks quite good, yes.

Though, you maybe don't want the message "Player has left the game" to be displayed for each unit to be removed from game, but only once. So the message can be moved out of the group enumeration.

As tiny last note, the current trigger does leak a unit group. Not important for your functionality, but if you're curious: Things That Leak
 
Status
Not open for further replies.
Top