Multiplayer Touch Control Problem

Get help using Construct 2

Post » Tue Apr 18, 2017 5:54 pm

[url][/url]Hello everybody

I have a problem with the multiplayer plugin. I'm currently working on an arcade shooter that is supposed to be playable for two.

My problem: The touch control works only for the host. The controller does not work with the peer. Unfortunately, I can not find the error, maybe someone here has a solution.

Thank you for any help.

Example Capx: https://www.dropbox.com/s/195esio9sowm8dl/Forumhelp.capx?dl=0
B
4
Posts: 4
Reputation: 210

Post » Tue Apr 25, 2017 1:41 pm

Subevents of event 71:

There you try to work out peer movement by means of the inputs bits determined by peerstate, but the angle you use for directional movement is based on a touch input.

This can not work, as the host does not know where the actual touch is taking place, seeing as the touch is occurring on the peer end.

This results in the peer's angle of movement on the host using several 0 values, making it move towards the top left.

Try and set the X and Y of the peer's touch (upon touch) in a peerstate or send as message to the host, to update it on the host side in a variable on the peer's object in question.

Use those X,Y's in determining the angle of movement.


As a result, for example, action for angle of event 72 could look like:

angle(Everytouch.X,Everytouch.Y,Players.xtouch,Players.ytouch)



I noticed a couple more discrepancies in your approach, but the above is most vital and should get you on your way.


The general thought of such mechanics is like:

Peer wants to move, and performs a control action (touch or mouse click) the variables of these (the x and y) need to be conveyed to the host, which then processes the movement with the given variables (the x and y).

And, with position synced objects, the hosts movement of the peers object is then reflected back to the peer automatically.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests