How do I sync an instance variable in multiplayer games?

Get help using Construct 2

Post » Wed Jun 03, 2015 8:24 pm

Hey guys!
Recently i started building my own multiplayer game but i came across a small issue.
I want the players to be able to pick different clothes for their characters, and, as such, i'm using a different animation sequence for each clothing pack (no individual parts, just one full outfit).
For my test i'm just setting the clothes to be randomly picked but the problem arises when the game starts and each character has different clothing in each instance of the game.

In other words, in a game with 2 characters/players, one player sees clothing item A and B while the other player sees C and D.

I was trying to define an instance variable for the player/character object that would be a reference to the clothing value. But apparently the synch between players isn't really working.
I tried following the tutorials, read the reference, but i failed to understand how synch variable works. Can someone help me out?

Thank you so much,
-vila4480
B
11
S
3
Posts: 51
Reputation: 1,251

Post » Wed Jun 03, 2015 8:53 pm

I would prefer to allow for my character's clothing to be customizable - but to be honest, i dont mind if it is stuck in one clothing style, as long as it is synched so that it looks the same between all peers and host!
B
11
S
3
Posts: 51
Reputation: 1,251

Post » Wed Jun 03, 2015 9:28 pm

Did you follow this tutorial?

https://www.scirra.com/tutorials/915/mu ... ame/page-1

on page 4 it handles syncing instance variables:

https://www.scirra.com/tutorials/915/mu ... ame/page-4
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: ditocruz, mcscooter, TRMG and 29 guests