Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Player slot unuse > share with loop

Discussion in 'Triggers & Scripts' started by Dr. Boom, Feb 6, 2010.

  1. Dr. Boom

    Dr. Boom

    Joined:
    May 1, 2008
    Messages:
    1,549
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    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 ?
     
  2. Shiroaisu

    Shiroaisu

    Joined:
    Jul 17, 2008
    Messages:
    202
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  3. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Make a pick all players in "AllPlayers"

    then a ITE function which check if the playing player equal to computer, if it is true, add it to the group
     
  4. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    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. --------
     
  5. dardas

    dardas

    Joined:
    Sep 12, 2008
    Messages:
    649
    Resources:
    0
    Resources:
    0
    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?
     
  6. Justify

    Justify

    Joined:
    Mar 16, 2008
    Messages:
    935
    Resources:
    5
    Models:
    1
    Icons:
    1
    Spells:
    3
    Resources:
    5
    Doesn't detect a game that wasn't started full with players.