[PAID] Someone know the Multiplayer Object

0 favourites
  • 3 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • Hello,

    I've ask in the How do I ? Section how to make something specific with the multiplayer object.

    So i would like to know if someone was able to make this work for me, not the whole game ^^ ... Only the specified feature ... So this is what i need :

    • In a first time i would like to give the players the choice to select between an existing room or to create a new room with the name of his choice for exemple : "Fun and rage, Destroy all".
    • In a second time i would like to change between Host and Peer. For exemple if the host disconnect actually you lost the connection and you need to close the game and create a new room, so i would like to make something for give the room Host to someone else when the host disconnect and until there are one player on this room.

    If someone was interested you can PM me for speak about the price and anything else ^^.

    Thank you =)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You shouldn't need to pay someone to do this. What you're asking for actually is pretty easy.

    First, to list all the rooms in a game, you just call the Request Room List action from the Multiplayer object, and then create a list object in your game, and add a for loop from 1 to Multiplayer.ListRoomCount, which calls the actions: List>Clear, List>Add Item>Multiplayer.ListRoomName(loopindex)

    Call this action once every say, 0.2 seconds to keep it updated.

    Then, add the condition List>On Double-Clicked with the action Multiplayer>Join Room>Room Name = List.SelectedText

    Then, within Host, you can send a message to the connecting peer that tells it what room in the game to go to, and what extra events should take place, etc.

    Then, if you want to transfer information from the Host to the Peer and make the Peer the host, first you have to make sure all the information on the peer's side of the game is the exact same as the host. If it is, then that you're starting point.

    First, make a variable (IE b_IsInRoom) which will act as a Boolean. 0 = false, 1 = true. When a player enters a room manually, this variable's value will be changed to 1, otherwise, if room is left or never joined, it's set to 0.

    Then there should be string variable (IE s_RoomName) which will be set to the name of a room when entered.

    After this is done, use the Multiplayer object's condition: Multiplayer>On Peer Left, and in the same event use System>Compare two values>If Multiplayer.PeerAlias = Multiplayer.HostAlias. This will determine if it's the host who has left. Then, in the same event add one more conidition: System>Compare Variable>b_IsInRoom = 1.

    Now, this should call the action, Multiplayer>Join Room, and set the room name as the variable containing the room name (IE s_RoomName).

    The first player to reconnect to the room will become the host automatically, and you're done.

    If you experience any issues doing this, feel free to PM me.

  • Im trying to do the same thing,for a multiplayer tds,but i cant figure it out.I followed the steps but it doesnt receive&display anything in the list..I would love if you pm me(i cant)

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