Help With Advanced Multiplayer

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have been trying make it where if a peer kills another peer, then it broadcasts who killed who on the chat box. It isn't working right though. Does anybody know what is wrong? (I can upload a project file if you need it).

    Thanks,

    Give me a Pixel

    What's not working right? No chat entry at all, or missing names?

  • Sorry I didn't specify. It works if a peer kills the host, but if the host kills a peer, it works correctly for the host, but the peer says the host was killed by the host. Here's the file if that was confusing. Use the remote preview.

    dropbox.com/s/svzjsybmqany8me/Multiplayer%20game%20example.c3p

    The problem is in events 63-67.

  • Change "from Multiplayer.MyID" to "from Peer.Peerid in the broadcast event

    What's happening is the receiver of the message is using the FROM ID to determine who has been killed. Since the FROM ID is always Multiplayer.MyID, you will always get a message that says the host has been killed, since the host is the one broadcasting the message. If you change the FROM ID to the ID of the peer that has just been killed, it should work

    Also, the 'else' after 'is host' will never be true, because all the logic in the screenshot is in the Host group, and therefore only accessible to the Host. "Is Host" will always be true in that scenario

  • Ok, I'll try that. Thank you.

  • Everything now works for the host, but something is off with the peer. When the host kills the peer, for the host it works fine, but for the peer, it says the host killed the host. If the peer kills the host, it works for the host, but for the peer it displays nothing at all.

  • I went ahead and fixed it

    easyupload.io/kcig91

    I realized what I told you was missing some info. If you broadcast and use "from PEERID" the peer with that specific PEERID won't receive the message. You would have to both broadcast it to everyone except him AND send him his own individual message

    This is pretty annoying so I just made a separate function for adding deaths that doesn't use the "From PEERID" at all. It just broadcasts who killed who to everyone and all the data is within the message itself

    Also, I don't know if you know but you can press ALT + click preview to open multiple multiplayer tabs! Very handy, and faster than remote preview

  • Wow, thank you! I'll check it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Better, but still not completely solved. If the host kills a peer, it works fine for the host. But for the peer, it still says the host was killed by the host.

  • Sorry, I uploaded the wrong version

    Here it is

    easyupload.io/zzjzfv

  • I can't use the file. It is not a .c3p or .capx.

  • I decided to start on a much simpler game first designed for mobile devices. Assuming I can finish this, I have plans to put it on the Amazon appstore. In my opinion, the best way to move the players would be a joystick. I found this tutorial (https://www.construct.net/en/tutorials/touch-stick-controllers-241). I am using the static analog joystick (sana). However, I have encountered some problems. Here is the link to the current project I am working on. Please note that is is still well in the developing stages and needs a lot of work, e.g. animations, chat box, and control over joining and creating rooms. I need some advice on how to overcome the problems below. dropbox.com/s/ufyqsc3r14gmno6/Wardens.c3p

    First, the peers are not being created. If they are I just don't see them. Please note that I did not start this project from the multiplayer example, I started this from scratch. Second, the joystick only allows diagonal movement. I know why but am not entirely sure how to fix it. It is also like that in the tutorial.

    Thanks for the help,

    Give me a Pixel

    EDIT:

    Sorry, wave the first question. I added some spawn points and made the scrolling work and now it is working just fine.

  • Sorry for talking so much in the last post. The only thing I need help with from that post is the joystick only allows them to go diagonally.

    I have been experimenting with rooms now. I have the creation of a room down, but for some reason, the list on the side is not showing the available rooms to join. I have preformed some tests, and it looks like the 'on room list revived' event is not triggering. I'm not sure what I did wrong, but I need some help. Here is the link to the updated one (https://www.dropbox.com/s/z07z66zdf26u7tt/Wardens%20%282%29.c3p?dl=0).

  • I just figured out the joystick. It is now working perfectly. All I need right now is the list of rooms.

  • Update #3: dropbox.com/s/1u9iau8mgqhkzxm/Wardens%20%283%29.c3p

    I have now been trying to figure out the animations. I am getting close. The animations work for your player, but for the other players the animations are just idle down or walk down. This is because of the instance variable 'direction.' I need help syncing it for all the players. I have loosly been following this example: https://www.construct.net/en/tutorials/mp-sync-animation-multiplayer-783.

    Lastly, I still do need help with the rooms list (see the previous posts).

    Thanks again,

    Give me a Pixel

  • Ashley, do you know how to fix these problems?

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