1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Player Count

Discussion in 'World Editor Help Zone' started by Klann, Sep 25, 2012.

  1. Klann

    Klann

    Joined:
    Apr 7, 2010
    Messages:
    470
    Resources:
    0
    Resources:
    0
    I'm trying to make a Mob count limit; Constant-number x (number of playing and user controlled player)

    my problem is i can't find the right trigger to set the number of players.
     
  2. Razwerd

    Razwerd

    Joined:
    Jan 5, 2012
    Messages:
    88
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Create a player group variable and make this trigger (My player group is called User_Players):

    • Reset User Group
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Player Group - Remove all players from User_Players
        • Player Group - Pick every player in (All players controlled by a User player) and do (If (((Picked player) slot status) Equal to Is playing) then do (Player Group - Add (Picked player) to User_Players) else do (Do nothing))


    You should also run this trigger every 5 seconds to see if anyone has left the game.
     
    Last edited: Sep 25, 2012
  3. Rozll0rt

    Rozll0rt

    Joined:
    Aug 18, 2012
    Messages:
    190
    Resources:
    0
    Resources:
    0
    what do you mean count of units. Do you say like the number of units that are your ally is equal to the number of units of your enemy?
     
  4. Razwerd

    Razwerd

    Joined:
    Jan 5, 2012
    Messages:
    88
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I forgot to tell you that if you want it to calculate the units spawned you need to create an integer variable(since it takes integer variables in arithmetics) like this one (Mine is AmountOfPlayers):


    • Set AmountOfPlayers = (Number of players in User_Players)
     
  5. Dr. Boom

    Dr. Boom

    Joined:
    May 1, 2008
    Messages:
    1,551
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Peon Power!

    Moin moin =)

    • 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) controller) Equal to User
            • ((Picked player) slot status) Equal to Is playing
          • Then - Actions
            • Set Integer = (Integer + 1)
            • Player Group - Add (Picked player) to PlayerGroup
          • Else - Actions


    @ Rawerd: Player Groups except the (All Players)-Player group create a leak, same as (Number of Player in User_Players). Also this Do Nothing action should be deleted ._.
    Edit: The integer variable is your player number variable btw

    Greetings and Peace
    Dr. Boom
     
  6. Klann

    Klann

    Joined:
    Apr 7, 2010
    Messages:
    470
    Resources:
    0
    Resources:
    0
    ok thanks guys +rep