How do I code for 4player Couch Co-op W/Controller?

Get help using Construct 2

Post » Tue Sep 29, 2015 12:06 am

Couple questions... Planning on a steam Greenlight release and doing a 4 player co-op game platforming game. We'd do couch co-op first, release as early access, then add online Multiplayer support. Risk of Rain is inspiring the idea behind the game, so pretend I'm just remaking that in C2 lol. My questions are:

- How do you program for a multiple controllers/keyboards, and so each controller only affects that person's character? (speaking strictly for couch co-op). Are there any tutorials I could follow for this?
- Is online multiplayer feasible for C2 yet? Last I checked over a year ago it still wasn't very well done.
-Am I stepping into a mess if I create couch co-op first, then try to add multiplayer? Or should I plan multi from the beginning, or can I add that on last without much issue?
-If I buy a template off of the store, I can't add to it my code right? I remember you couldn't just import other projects into eachother
Thanks for the answers and suggestions!
Last edited by bscarl88 on Wed Sep 30, 2015 3:08 am, edited 2 times in total.
B
35
S
5
Posts: 411
Reputation: 3,406

Post » Wed Sep 30, 2015 2:40 am

bump fast board
B
35
S
5
Posts: 411
Reputation: 3,406

Post » Thu Oct 01, 2015 4:01 am

When adding a gamepad event, the first value entry is the numbered controller the action pertains too. I would look into Windows and how the Xinput system works for joysticks and gamepads.

In terms of code there's a variety of ways to go about it from there, using a loopindex, families, or my approach has been just finishing the controls for one user, copying and pasting ALL the events and just going from there. The later is more time consuming and seems like a less intelligent way to go about it, however if you keep your subgroups well-organized it can be the most stable, and fairly intuitive.
Check out my first game Axes and Arrows and vote for A&A on Steam Greenlight!
B
14
S
3
Posts: 47
Reputation: 2,163

Post » Thu Oct 01, 2015 12:33 pm

What I tried to do, is create a "Players" Family, and assign all platform movement code to the family (running, jumping, climbing). Then I'd only have to program each character's individual attack 1-4. Lets say I have 8 different characters, I would have each of those in the "Players" family. The Players family has a variable called ControllerID, which is assigned to a Controller ID when a player clicks on a character at character select.

What I can't figure out is how to get that controller to only work for the player that has it's ID assigned to them. Any ideas? You can tell I'm stuck with a brain fart, below is the farthest my logic got haha.
Image
B
35
S
5
Posts: 411
Reputation: 3,406


Return to How do I....?

Who is online

Users browsing this forum: lemonizer and 1 guest