Help with multiplayer game - turret not sync in host/peer

Get help using Construct 2

Post » Thu Feb 05, 2015 6:28 pm

I am making this multiplayer game demo to learn how to program for multiplayer.
The problem I am having is with the Turret on the tank. If I set the initial turret tacking so the turret is locked forward it works fine in both host and peer modes. If I set the initial turret tacking so the turret has mouse movement it works fine in both host and peer modes. But once I try to change that mode in game the problem starts. It works right on the computer you made the change on but all other computer don't show the change.Does not matter if you are the host or a peer.

The Instance variable I use is "TurretTracking" in the PeerTank Object. I use "[" for the turret is locked forward and "]" to have mouse movement for the turret. As I said above you can change this variable in the PeerTank Object and it works right. But once the game is running and you try to change the turret mode you run into the problem.

were I have the code to change the turret mode is in the game events in the common group.

I have upload my project cap for you to look at.
Thanks so much for any help you can give.
You do not have the required permissions to view the files attached to this post.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Thu Feb 05, 2015 9:08 pm

Have you tried to put lines 78-80 under one "System: For each PeerTank" condition, like in attachment?

Cannot test the multiplayer, but It could be the problem of more than one tank of same type.
You do not have the required permissions to view the files attached to this post.
B
12
S
6
G
2
Posts: 99
Reputation: 1,727

Post » Thu Feb 05, 2015 9:37 pm

razorMonkey I gave that a try but did not help
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Fri Feb 06, 2015 3:19 am

You have to pass the input from the peer to the host so the host can handle the tracking condition. All I did was add new inputs to the peer and host group to handle the [ and ] presses. So it passes the info to the host on client update.
You do not have the required permissions to view the files attached to this post.
B
30
S
7
G
2
Posts: 100
Reputation: 2,460

Post » Fri Feb 06, 2015 5:09 am

Thanks thatserafimkid, the Peer is working right now. when you change modes it shows up right on both the host and peer computers. but the host is working on the host computer but still not changing on the peer computers.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Fri Feb 06, 2015 5:38 am

thatserafimkid, I found the last bit of the problem. In the host group under the turret tracking 2 subgroup you needed to set the inputs like you do when you fire the laser and let the common group update it for both the host and peer computer.

thanks again thatserafimkid for showing me that I needed to have more inputs commands.
I am just learning the multiplayer programing and there is a big learning curve to the logic to it.

here is a updated cap with my fix
You do not have the required permissions to view the files attached to this post.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944


Return to How do I....?

Who is online

Users browsing this forum: ErekT, MisterAqua, Yahoo [Bot] and 28 guests