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

Removing Unused Players at Game Loading

Status
Not open for further replies.
Level 7
Joined
Jun 8, 2010
Messages
283
So yeah, basically Im trying to remove the players unused, and to go along with the trigger I made a debug in chat to determine whether or not it works. Not matter what however, when I test the map, my units (red) are always removed even if I am in "Is Playing" slot condition.

Here are two different variations/ approaches I did for the triggers:

Variation 1:
  • remove unsued players
    • Events
      • Time - Elapsed game time is 7.00 seconds
    • Conditions
    • Actions
      • For each (Integer player_int) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (playerindex[player_int] slot status) Not equal to Is playing
            • Then - Actions
              • Unit - Remove PlayersHero[(Player number of (Player(player_int)))] from the game
              • Unit - Remove removetrack[(Player number of (Player(player_int)))] from the game
              • -------- debug comment --------
              • Game - Display to (All players) for 5.00 seconds the text: (Player Number + ((String(player_int)) + is unused.))
            • Else - Actions
Variation 2:
  • remove unsued players
    • Events
      • Time - Elapsed game time is 7.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (playerindex[player_int] slot status) Not equal to Is playing
        • Then - Actions
          • For each (Integer player_int) from 1 to 12, do (Actions)
            • Loop - Actions
              • Unit - Remove PlayersHero[(Player number of (Player(player_int)))] from the game
              • Unit - Remove removetrack[(Player number of (Player(player_int)))] from the game
              • Game - Display to (All players) for 5.00 seconds the text: (Player Number + ((String(player_int)) + is unused.))
        • Else - Actions
Edit: I know how to remove the units making a trigger for each player, but thats not really.. efficient and Im too lazy to use that trigger anyways, so itd be best if I get this trigger working in one trigger.
 
Level 7
Joined
Jun 8, 2010
Messages
283
Oh oops, playerindex[] is a player variable for another trigger. I replaced that with the native convert string to player index number.

After replacing that Variation 1 works, such a noobish mistake. Thank you so much, +rep
 
Status
Not open for further replies.
Top