How do I let players pick between two teams?

Get help using Construct 2

Post » Thu Mar 26, 2015 8:02 pm

Creating a multiplayer game and I want there to be two teams, each side has different weapons/health. What is the best way to let players pick a team?

I'm considering letting there be an option to pick a side as they type in their user on a menu screen. So would I assign the peer a variable based on the side they choose and have the host place them in the correct spawn based on the variable?
B
9
S
2
Posts: 37
Reputation: 729

Post » Sat Mar 28, 2015 6:15 pm

Have an instance variable for team and when players attack eachother make sure their teams are different
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170

Post » Mon Mar 30, 2015 12:15 am

tarik00555 wrote:Have an instance variable for team and when players attack eachother make sure their teams are different


Thanks, it took me awhile but I got it thanks to your advice.

In case anyone else stumbles across this and is curious. I pretty much just set up a local variable called FiringPeerSide similar to FiringPeerID from the Multiplayer example. This was my third parameter for the Function TestHit. As tarik suggested I included an instance variable called 'side'. I also had two global variables Team1 = 0, and Team2 = 1. The host would always be on Team2 and every time a peer connected:

Team1 <= Team2 : Peer - set side to 2. add 1 to Team 1

Else : Peer set side to 1. Add 1 to Team 2

Note: these two events are subevents in the Host group under the 'Multiplayer-On Peer Connected' event from the Multiplayer example.

I think that was it and so far it's gotten me passed the initial issues I was having.
B
9
S
2
Posts: 37
Reputation: 729

Post » Mon Mar 30, 2015 4:22 pm

I'm glad you figured it out :)! I would've responded with more information, but I was using my tiny cell phone, and I really don't like typing on it.
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 24 guests