How do I Pick ALL Instances with the same Instance Variable?

0 favourites
  • 8 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • So Basically in the layout would have like 12 instances of one object. But there are divided like this:

    4 of them have a Instance variable with value = "Apple"

    2 of them = "banana"

    2 of them = "orange"

    3 of them = "watermelon"

    So, basically its a Multiplayer Game, but i am trying to divide by team. As I said before. And I want to divide this team in 5 each per player and it can be totally randomly to enter a team, but I don't want any team to have 5 or more players so I have to change the team. I can't figure out how to inspect the team and see how much players from the team are and them if more than 5 move to another team.

  • This doesn't make much sense, could you rephrase or add more info. The values you provided don't add up to 12 but even ignoring that I don't see how instances with those values relate to a team of 5 players. The title of the post doesn't really match anything I've read.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sprite var = "orange"

    ForEach Sprite

    Then tell it what to do.

    I have a short ForEach video that breaks down a group based on a boolean variable (Plu it does random and .2 second gap) If you want some extra visuals you can check it out:

    youtu.be/QBp9qqq47y4

  • This doesn't make much sense, could you rephrase or add more info. The values you provided don't add up to 12 but even ignoring that I don't see how instances with those values relate to a team of 5 players. The title of the post doesn't really match anything I've read.

    I wrote wrong! It was supposed to be 2 teams with 3 players and only 1 team with 2 players. Sorry.

  • So did the other post resolve the problem?

  • So did the other post resolve the problem?

    I don't tested it yet

  • Use "Pick by comparison" and then enter the variable value you want to compare.

  • Not working any of the tips of you guys...

    Its a Multiplayer game, and i made this way:

    Host Group:

    - On peer connected

    -- Normal Multiplayer Mechanics*

    -- Call function "teamup" with params (0= 0) (1= player.id)

    - On function:

    -- player var "team" = (function.param(0))

    --- pick by comparison

    ---- Compare player.picked count >= Max Player Per Team

    -------- Call function "teamup" with params (0= self.param(0)+1) (1= player.id)*****

    ----Else

    -------- player set var "team" to function.param(0)

    But for some reason here (*****) the function don't start again. Yes it is supposed to be a loop, I know there is loops made, but this is the only way i found right to do.

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