How do I Multiplayer animations?

Get help using Construct 2

Post » Sat Sep 12, 2015 5:29 pm

Message: Frostein can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Ok, so i'm having actual nightmares about this.

I've got a 1 v 1 multiplayer game. I'm trying to add another object 'Sprite_Anims' to play animations for the main player object 'Sprite'.

To change the animations, i am using the player inputs to send messages. The messages change variables on the Player object 'Sprite'. so if 'Sprite' variable 'Attack' = 1, the object 'Sprite_Anims' should play 'Attack' animation.

I've tried approaching this the same way as i did with the player object, by assigning the Multiplayer ID's to a variable 'Player_Name'.

This works fine with the player object 'Sprite', each instance gets assigned the correct ID, and the variables are set accordingly to the input messages.

However, the animation object 'Sprite_Anims' is haunting me. It appears that the variable 'Player_Name' isnt being properly set to the Multiplayer ID's, and im not sure why. It looks like both instances are assigned the same ID.

If anyone could take a look and point me in the right direction, then maybe i could be sane once again.

Thanks.

http://imgur.com/MFvHkp6
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Sat Sep 12, 2015 8:56 pm

Basically need a way to give the 'sprite anims' object the same 'player_name' variable as the 'Sprite'. so that when 'Sprite' changes variables, it changes the associated 'sprite_anims' variables too. Which in turn play the animations. stumped.
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Sun Sep 13, 2015 10:04 am

Objects related to the multiplayer, on creation, simply give them the same PeerID.

This way, when a peer is referenced, you can use that same reference for the other objects.

you could then use a synched object variable, to determine the animation playing.

Or have the client changing its animation simply forward this information to the host and peers, so they can change the animation accordingly.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sun Sep 13, 2015 8:52 pm

Thanks for the help yet again! However i decided to go with the lazy route, and just use the objects i already have synced. all animations have the same collision size/shape so it shouldnt be too much of a problem!
B
9
S
3
Posts: 104
Reputation: 1,033


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests