Set character controls with families

Get help using Construct 2

Post » Fri Apr 26, 2013 3:34 am

Hello again!

This time I am working on spawning my characters and making it so they are controlled properly.

I currently have 3 characters players can chose between and I already have it so player1 and player2 spawn correctly, however I need to have all of the player1 characters set to one control scheme, and the player2 characters set to another.

Is there any way I can do this simply through families? Or will I have to make two copies of the character and with different controls?

Edit: In fact, is there some way I can OnKeypress 1 set (character) into (family1)?TheHat2013-04-26 03:43:01
B
7
S
1
Posts: 5
Reputation: 392

Post » Fri Apr 26, 2013 12:33 pm

@TheHat your characters for player one and player two are in the same family, or in seperate families?
and what kind of controls they have? platform behavior, or custom (made in events)?
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Apr 26, 2013 9:34 pm

I think you can achieve this using the Dictionary object and keycodes.
Add keys to the dictionary like this:

Start of Layout
> Add key "p1Right" = 39
> Add key "p2Right" = 68

Then a loop:

Repeat 3 times
+ On key pressed: keycode Dictionary.Key("p"&LoopIndex&"Right")
+ Character.value("Player") = LoopIndex
> Move character right.

I've done this once, I believe it was like this
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Mon Apr 29, 2013 9:27 pm

Hey guys! Sorry for the late reply! I solved my own issue (though I now have a new issue I'm trying to solve haha)

Anyway, I solved it by having player1 family use default controls, and player 2 family (both with the platform behavior) and have WASD simulate control!
B
7
S
1
Posts: 5
Reputation: 392


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests