Problem with Multiplayer Send Message - nothing sent

0 favourites
  • 8 posts
From the Asset Store
The soundstage is set for an immersive listening experience sending your audience adrift.
  • Hi. I tried it for almost 2 hours now but it does not work and I hope someone can give me a hint how to fix this.

    I joined a room and then I send a message to the host. First I tried it without groups but I added them to make it easier. When you are the Peer you should send 2 values to the host so he can determine which level should be loaded and to know what char the peer is playing. The Debug window shows the "Sending Data to Host" message but the Host does not seem to get any message because nothing shows up there.

    I tried it with and without trigger once, with "on key press" and some other things but the message never appears on the host. But when I open the Chat example it works. But I cant find the difference and why it is not working for me. Can anyone see the error?

  • Any ideas? I tried to convert the sent data to a string with str() because the manual says it must be a string and I tried to send numbers first. But that did not change anyhting.

  • Hey brother - What I've had success with is "set client input state".

    I had a quick shot at it (but I've got to leave for work and may not be entirely right)

    If you look at the Pong or Real-Time multiplayer game tutorials, they'll have the right versions of this. (I've built a character selected lobby for multiplayer based on this method and it works)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you for your suggestion. I could already sync values with "Set Client Input State" and syncinc Instance Variables and it should work with CharID and LevelID since its only a number.

    But shouldn't "Send Message" work as well? Does it have any prerequisites or can it only be used after specific triggers?

  • I just tried it again and its working now! o.O

    Maybe it was a bug in the last beta build, with the latest r175 I can receive the message (number variables need a str(VARNAME) to be a string).

    But the second player (Peer) sometimes has to try to join the new room 2-3 times before he gets into it. I hope I can find the reason for this.

  • I just removed the "On key pressed" and tried "Trigger Once" but now no data arrives at the host (the debug message is shown once). Is Send Message only working with single triggered events and not with "Trigger Once"?

    /Update:

    It seems I found it! You need another pause (Wait) before sending the data as peer. If you do it immediately it seems to be "too fast" for the host to recognize the sent message. After adding a System.Wait(1.0sec) (adding 0.1 was not working/still too fast?) to the TriggerOnce actions the Host got the data.

    After adding "Multiplayer is ready for Input" + Trigger Once it seems to work without the pause.

  • Bl4ckSh33p - I had the same problem and after debugging the multiplayer plugin I found that once the peer connects to the room it still has to wait for the host to link to it. Its not part of the original process of joining the room. There is a peer condition called "Is Ready for Input" that you can work with to determine when its ok to start sending messages.

    Edit: Apparently I missed your last line as you mentioned "Is ready for input"

  • Thanks. It sometimes takes a while to get used how to use a new plugin like Multiplayer.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)