How do I identify same object in multiplayer

Just started using Construct 2? Post your questions here

Post » Sun Jul 12, 2015 12:40 pm

Sorry for the probably silly question, but i'm trying the "multiplayer part" of my game and have a doubt
When i sync objects, i don't sync also UID right? Because i have tiles and cards that players select and i wonder if i have to put an instance variable identifying them (like 1, 2, 3 and so on for tiles and cards) or can be simply done with their UID.
Thanks :)
B
6
S
1
Posts: 73
Reputation: 569

Post » Mon Jul 13, 2015 6:23 am

You need to craft your own ID system.

Easiest would be on the host end, which upon object creation you set an object variable like ID and set it with the IID of the object.
When this gets synched both host and peer have the same object.id for the objects.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Mon Jul 20, 2015 9:30 pm

Sorry for delay in my reply... really thanks for your help
I created an instance variable, same for both games. It's working great! :)
B
6
S
1
Posts: 73
Reputation: 569


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests