Top down Control of many heroes with Same input

How do I…

Create a game with multiple heroes that can ne moved independantly using the Same input.

What is the expected result

I would like to switch between the multiple heroes and make them move turn by turn by using the directions on the keyboard, in the style of Homm.

What is the actual result

When I assign many heroes to the Same input, they all move at the Same Time. Is there a way to only move one at the Time ? I have succeeded by assigning different keys and I can switch from one creature to another with variables. But I want to have at least six heroes per player so I want it to be the Same input to move for each of them. I hope my question can find and answer ! :slight_smile:

Related screenshots

Project files (optional)

Insert a minimal game showing your issue in a .zip or .rar.

Yes, turn off the behaviour (via the event action) for the playing characters that shouldn’t move, and turn on the behaviour for the playing character that should move.

Hi MrMen ! I tried doing so.

All heroes start with a variable set to 0.

I associated a variable to each hero. When A num key is pressed it centers on the hero, puts all heroes variables (group) to zéro then add 1 to the value associated hero corresponding with num key pressed.

I tried to make it so that when the hero’s value is 0 it cannot move. But when I set a general rule that the behavior is deactivated when the hero’s variable is equal to zero all heroes can’t move. They can only switch sides when I press arrows. And it is still affecting all creatures linked to the numpad. I’m stick on this still 2 weeks.

Do you see what i’m missing ? Am I overcomplicating things ? Ideally, my aim is that game be multiplayer, each player could have 1 to 10 heroes…so there must be a more simple way to toggle between them on the map !

Can you shar a screen snip of your events? It just sounds like something is not done correctly.

Also, the way I’d do it when switching characters is turn off the behaviour for all characters, and then turn it on for the one that should have it.

Make sure only the hero you want to move has the default control ticked on within the behavior

And there’s the last one… Ouf !
I have programmed each hero(creature) the same way

So I could deactivate the default control in the events section ?

Oh. There is a simpler way. You can use the object group name to reference just a single member object, like this:

and so you only need one set of events that can control all the characters.

To set it up, give each object in the object group “Creatures” the same animation names for the same types of animations. For example, instead of “GOBLIN G-MOUV” (and I suspect there will be “GNOLL G-MOUV”, “LICORNE G-MOUV” etc), just name those animations “G-MOUV”.

If you do this instead of using the Switch variable, then you don’t need to select the creatures with Switch = 1.

However, if there are interactions you only want to happen to the selected creature (for example, damage not to be inflicted on non-controlled creatures), then you will need to select the creatures with Switch = 1.

Amazing ! All problem solved ! Thanks so much ! I ignored the default controls when the value is 0 and programmes the opposite when value is 1. It woooorks.

Now yes for the movement it’s a great idea. I’ll implement this.

So appreciated. Thanks ! :heart_hands: