How do I Team Limit? (Multiplayer)

0 favourites
  • 7 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • So I am trying separete teams in my multiplayer game but I don't know how to do it, here is what i did until now:

    https://ibb.co/5hD8WTz

    Tagged:

  • Someone Pls?

  • Did you write the code for the screen you sent? If yes, what does the "Param" function do?

    I also understand that you want to take all the "Jogadors" in the layout, and divide them into teams of up to 5 players each. Right?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Param function works as a Loopindex: (Look at the Team Index at the final*)

    Start with 0, than check all the Players("Jogadors") from the team 0 and see how much do it have, if its over 5 call again the same function but add 1 to the 0 Param(loopindex) and checks the team 1 and continues until team 8, but if the number of players is equal or less than 4 the player can enter the team.

    And makes it dynamic for players who create custom maps that can choose bet 1 and 5 players per team.

    -------*-----****-------*-----

    I am also trying to make it random, but it seem REALLY complicated and a bit confuse so i just gave up.

    * I made Team Indexes because multiplayer only support numbers between connections and it might me a more simplier:

    • 0 = Green
    • 1 = Yellow
    • 2 = Purple
    • 3 = Red
    • 4 = Orange
    • 5 = Pink
    • 6 = Blue
    • 7 = Cyan
    • 8 = Gray

    Total of 9 times (0 based)

    Also, thank you for trying help me! I really appreciate it :D

  • Are you sure about how that feature works?

    In a control event you check if "Time = Function.Param(0)". This, if I understand your message correctly, doesn't make much sense....

    Could you post the entire Param function (maybe even add comments) to better understand how it works?

    Edit:

    Question:

    Based on the number of players. do teams have to be created proproportionally? Example: If there are 10 players, should 2 teams of 5 players each be created? Or must there always be 8 teams?

  • For your question: Yes if there is 10 players there might be 2 teams or more, or even be like: number of players per team if there is 10 online: (0,1,0,1,5,2,1,0) remind the default total is 9 teams, but if it's a custom room it can have custom players per teams amounts, BUT you can ignore that last part if its to hard, i can't even imagine a way to do that.

    I forgot to tell that "Time" is "Team" in english that is a instance variable for each player that works fine. If they are the same team there is no friendly fire.

    And the rest of the Function is just the Trigger:

    _On entered the room

    ____Is Host__Enable "Host" Group___Go to a random team (Doesn't metter, there is no other players)

    ____Else___Enable "Peer" Group___ Call "teamin" function with Param(0)=0 {Start the Loop looking for a team}

  • I AM SOOO SORYY! Sometimes i mistake English with portuguese! I switched "Team" with "Time" (Time meains "Team" in portuguese), also "Time" is a unused variable that i am going to delete it! Also i was trying "For each (ordered)". Its a bit complicated for me to understand, does it take all variables that is jogador.team = func.param(0) or not? And i changed when call "teamin", its located at the "Peer Group" on a Trigger Once condition when the group becomes active. Also there is a Picture:

    https://ibb.co/pdMfwrr

    * I forgot to change the commnents, if you don't understand something you can ask me!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)