multiplayer chat example

Discussion and feedback on Construct 2

Post » Sun Oct 19, 2014 9:24 am

Hello,
i am making an stratego game, i have finished the one player mode vs the computer-AI and now i want to add an online mode. I've tried the pong example with my two pc's and works but when trying the chat example it connects for a momment but then both pc's get kicked off (and also when the host writes a messages it only shows it in its own pc and viceversa for the peer).
The stratego is different from the pong example because it doen's use a common screen (layout) but 2 differents screens (layouts) with the same event sheet. The peer layout mirrors the host board...BUT for the moment I cannot even pass a global value from the host to the peer throught the (broadcast/ on message "" received) like a timer for player 1 (host) that I want to pass to the timer for player 2 (peer) so the peer has the same value as the host (i did it already for a timer for each one and the peer pc (oldest) lasts like 2 more minutes in a 10 mins countdown with respect to the host). SO the thing is: is the problem with the server? or something with pc/scirra config? (chat example doesn't work) or i am not following right the tutorial examples?...also another question: it is neccesary to put the sync/ client input values before the connection to the server...or you can do it along the game...

Thanks,
Alfonso Martinez
B
4
Posts: 11
Reputation: 624

Post » Sun Oct 19, 2014 2:12 pm

You should read the multiplayer tutorials so you don't run in to problems they cover.

It's also possible someone will already be hosting the tutorial but you won't be able to connect to them. If that happens, change either the game, instance or room name and you'll start a new game which you host yourself.
Scirra Founder
B
387
S
229
G
87
Posts: 24,244
Reputation: 192,038

Post » Sun Oct 19, 2014 7:24 pm

Thanks Ashley for your quick answer,
I've read first 3 tutorials (I forgot about changing any global variable in the chat example to avoid that problem)

I also solved the problem with passing a global from host to peer. I would recommend to specify explicitly in the tutorial that broadcasted messages must be with variables of string type (if the global is a number you can do str(var)...)

Is it neccesary to put Sync and add client input value before connecting to signalling server (as in the pong example)?

Thanks a lot in advance,
Alfonso Martinez
B
4
Posts: 11
Reputation: 624


Return to Construct 2 General

Who is online

Users browsing this forum: tumira and 3 guests