[Multiplayer Plugin] - Peer Object Spawning.

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I'm pretty decent at the Multiplayer Plugin and what I'm trying to figure out if how do we have the host spawn an object on a peers behalf that holds three different values.

    The peer needs to drag and drop an item from a list.

    That item holds two values, ID and AMOUNT.

    The peer needs to tell the host which peer is dropping the item because the item is spawning on top of that peer's character.

    I know I can send a message to the host telling the host which item to spawn but how do I tell it to spawn an object with the values ID and AMOUNT as well as which peer is dropping the item?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With a proper authoritative host set up, the only thing a peer should be sending to the host is their inputs, and the host already has all the data values to begin with.

    But since that isn't the approach you are using, the only things I can suggest is:

    a. Send multiple messages with different tags containing different information.

    b. Send a single message using a token to sperate different information, and on the host side parse it back out with the tokenat() expression. You can use the & operator to combine strings when building your message.

    As for identifying who sent the message, that should have been covered in the multiplayer tutorials. In an event with the "on peer message" condition, you can get the peerid of the originator with the "fromID" expression.

  • With a proper authoritative host set up, the only thing a peer should be sending to the host is their inputs, and the host already has all the data values to begin with.

    But since that isn't the approach you are using, the only things I can suggest is:

    a. Send multiple messages with different tags containing different information.

    b. Send a single message using a token to sperate different information, and on the host side parse it back out with the tokenat() expression. You can use the & operator to combine strings when building your message.

    As for identifying who sent the message, that should have been covered in the multiplayer tutorials. In an event with the "on peer message" condition, you can get the peerid of the originator with the "fromID" expression.

    Really interesting stuff here thanks.

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