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

Player slot unuse > share with loop

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I have a small question ( I don't get it up to now don't know why )

I got 2 Player Groups ( Player 1 2 3 4 7 = Group 1 and Player 5 8 9 12 = Group 2 ).
I put each Player into a variable like:
Set PlayerTeam1[0] = Player 1 (Red)
Set PlayerTeam1[1] = Player 2 (Blue)
....
Set PlayerTeam2[0] = Player 5 (Yellow)
Set PlayerTeam2[1] = Player 8 (Gray)
....

Now after 10 seconds - a trigger should check if the slot is unused. If it is the unused player should share the control and the view. Now I want as ( I think there must be a qay for this ) how to do this with Loop - Actions ?
 
Level 6
Joined
Jul 17, 2008
Messages
185
Not sure if this is what u want but... :


  • Actions
    • Player Group - Add Player 1 (Red) to Team1
    • Player Group - Add Player 2 (Blue) to Team1
    • Player Group - Add Player 3 (Teal) to Team1
    • For each (Integer A) from 0 to 11, do (Actions)
      • Loop - Actions
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked player) is in Team1) Equal to True
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked player) slot status) Equal to Is unused
                  • Then - Actions
                    • Player Group - Add (Picked player) to IsPlayingTeam1
                  • Else - Actions
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked player) slot status) Equal to Is unused
                  • Then - Actions
                    • Player Group - Add (Picked player) to IsPlayingTeam2
                  • Else - Actions
    • Player Group - Make IsPlayingTeam1 treat IsPlayingTeam1 as an Ally with shared vision and full shared units
    • Player Group - Make IsPlayingTeam2 treat IsPlayingTeam2 as an Ally with shared vision and full shared units
you probably dont need to check it 12 times but its just an example how to check if a player is or is not playing using loop
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Why not try something like this:

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, 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
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • -------- // Player @ (Integer A) is playing. --------
              • -------- // Player @ (Integer A) is also a user. --------
            • Else - Actions
              • -------- // Player @ (Integer A) is not playing. --------
              • -------- // Player @ (Integer A) is not a user either. --------
 
Level 11
Joined
Sep 12, 2008
Messages
657
I dont get it..
isnt it easier to use

  • Player - Player X(Color) leaves the game
Then just set in init everything you need such as
add player X to playergroup x.. blah blah,
then just cheak if hes in playergroup 1 or playergroup 2.. then give controll to the rest of the team?
 
Status
Not open for further replies.
Top