How do I make a player differentiation system?

How do I make a player differentiation system for my multiplayer “hero” selection system.

You need to use Mailbox, Message and some Filter behaviors (you can also use Router but you might need to add Once/Always) to send value that defines the player. Ex: you choose “hero” 2 and it sends value 2 to the other object that differentiates the player, then it tells you that’s hero 2 as a display.

What object differentiates the players

Any object you want, I recommend the object you choose should be blank one (usually the one you just created a sec ago) and has no code from a cluttered mess, unless you put most of your code in bundles.

How would that object be only for one player or know who is “using” it. Or am i thinking of this wrong.

You might need a User Info behavior if your game is onl multiplayer.

How would that work, could you show me an example, if you can?

The router is pretty useful for multi input, you still can use Filter but might take some more Number behaviors. Below pic just to find an enemy so you won’t need Proximity in this case:

Can you explain what this is doing and what object this is

It’s my AI bot, the Input behavior is the one that sends value to the gate of Router. Always behavior is to keep it send signal, you just might need Once.

How does this help in terms of how to differentiate players, sorry I’m just having trouble understanding this part of the development.

It might take a long time to explain it all so just wait, ok?

1 Like

Input behavior (should change to Mailbox in your case): set value to change the output gate of the Router.
Always (can change to Once if you want): send signal to the output that was settled before by Input/Mailbox like I said.
Mailbox & Switch: don’t mind them.

In the easiest way to explain you could say that depends what character you choose, the different value can be send and set to the Router, in term to be output in different output gate to differentiation what character the player choose. Ex: players choose character 5 by clicking object “Hero 5”. Hero 5 sends value 5 by Number behavior (settled 5) to Message → Mailbox (you can say the Input behavior in pic). Then it set the Router to the output gate 5 (bottom output), and lastly, Always behavior keeps sending signals to input “in” of the Router so the differentiation object can get the signal and send out to the output 5, which can active the line code wired to output 5 of the Router. You can also use them to tell player their character is “Hero 5” from Label, Alert, Sound or spawn an object to do it.

I mean how do I know which player is selecting a hero, also I wont be able to respond for a minute I’ll be right back though

You can create a Level just for selecting a hero, you don’t really have to put it in a Level that was supposed for something else since you’re using Indie plan. Then, you can use Save behavior to save the value for next Levels.

You can reference this example by JR01.

Ok, so the problem is that I don’t understand how I would know which player is choosing the hero. Is there a way to have an object that is only for a specific player in order of when they joined? I already have a specific level for it.

You might need a MouseClick behavior when they’re choosing behavior but you will also need to create an object to lock choosing Hero. When the player in that Level/clicks a random Hero, that means they’re choosing a Hero they want. Btw, I might be offline for a few hours so if you still need help, then you might need to want someone else come in and help you.

This could work

Welcome to the community