Controllers and players

Get help using Construct 2

Post » Fri Dec 21, 2012 3:08 pm

Hey all.

I am wracking my brain trying to figure this out for a multiplayer game:

I have 4 instances of "robot" out of the 4 players the first person to press "a" I want to become robot 1, the second person will become robot 2 and so on.

How do make the system know that controller (0 - 3) is players one to 4? I really can't work it out.

I've got a variable in the robot called 'controller type' and I'm just in am mess of code.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sat Dec 22, 2012 10:02 am

Any ideas? Do I need to provide more information?
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Dec 24, 2012 11:22 am

I'm going to bump this one last time and then give up haha :)
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Dec 24, 2012 2:06 pm

Due to no one else offering support on this one I'll offer what advice I can

I don't have much experience with controllers but here goes.

You need to create some way for the computer to know that Robot_A is free. A local variable to say he's waiting for a his controls would work here.

Next you need a way to be able to say which pad has pressed a button 1st, some global variables might be helpful here.

When a global variable is equal to a robots local variable then that robot can be assigned that pads control scheme.


You might need to provide some more information to get a more accurate answer from someone who is more experienced in controllers then me.
It would be far easier just to assign Robot_A to Pad_0, Robot_B to Pad_1 etc
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Mon Dec 24, 2012 2:12 pm

Thanks, I've tried so many different ways, my buddy even told me how he would do it in C and I still can't work it out. He was saying you'd made one player class and then give it a players 1-4 variable, then have the player await input and have it filter out the signals coming in and accept only the assigned controler.

I was trying to duplicate all these different combinations of controllers and players but he said that I should be able to do it only writing one bit of code for the movement and one bit of code for each controller, not separate code for every single combination.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Dec 24, 2012 2:23 pm

I disagree a little.

In this sense we do have some alternate solutions. If Roboat_A had a local variable set to 0 (0 meaning waiting for input) then you could set up various controls schemes.

If Robot_A local variable = 1 then set his control scheme to Pad_0 = 1 (Global variable)

If Pad_0 = 1
Robot_A = 1    ----->   Then set Pad_0 group to active

Its a rather long way around and I'm sure there will be a simpler solution somewhere but that's how I would go about doing it.
B
13
S
2
Posts: 87
Reputation: 1,244


Return to How do I....?

Who is online

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