How do I find new host

Get help using Construct 2

Post » Thu Sep 03, 2015 2:39 am

if the host disconnects, How do i pick a new host from peers already in a room? Cant seem to find any options in the Multiplayer object.

thanks in advance.
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Thu Sep 03, 2015 10:15 am

Pls team! Show me the light.
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Thu Sep 03, 2015 11:01 am

event:
on peer disconnect
compare 2 values: multiplayer.peerid = multiplayer.hostid
action:
set Group "Peer" inactive
disconnect from room


event:
on player leave room
action
autojoin room


event:
on join room
sub is host: set group "Host " active
sub else set group "Peer" active



This lets you reconnect, but, it will depend how you setup your objects and syncing and game mechanism if it can just pick off where it left.
If you have a situation where by the host intial objects are set with certain behaviors or stats, be sure to set them again when the peer becomes host. In various scenario's, your objects can become the new "host" version if you apply it right.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu Sep 03, 2015 1:02 pm

Thanks! This is pretty much what i need, you're a wizard Harry.
B
9
S
3
Posts: 104
Reputation: 1,033

Post » Wed Nov 04, 2015 2:58 pm

Sorry i dont understud can you public a screen shot? if is possible because in my project not working
tnx
alelimpo
B
4
Posts: 7
Reputation: 214


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Congrats2u and 26 guests