Can I have 2nd layout 'always loaded' on top of main layout?

Get help using Construct 2

Post » Mon Mar 02, 2015 6:44 pm

In order to build a multiplayer persistent world using Construct, the optimal construction seems to be that every area of the world is its own layout, which is then hosted 'peer-to-peer' whenever two players enter the same layout (rather than having a 'host' computer run the whole world on a single layout, which other players then connect to). So, for example, for a multiplayer Zelda-y world, every screen is its own layout, and if two players are on the same 'screen' of the world, they connect to each other; otherwise, they're not online.

This is all fine and dandy, but it creates a serious complication for player chat. My understanding is that the current way of accomplishing multiplayer chat requires players to be on the same layout together; so your world would have local chat at that point, but no global chat.

I'm sure there are alternate solutions, like piping in IRC or some sort of external chatroom externally. But within C2, would it be possible to simply layer a second 'layout' over the main game layout that just handles the chatroom? This way, all players would be on the same 'chat' layout and sync the chat through a multiplayer object on that layout.
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Mon Mar 02, 2015 6:48 pm

I would say is to use post requests to a php file to update a jsonValue then every 2 secounds is to use a get request to get the chat
B
10
S
1
G
1
Posts: 63
Reputation: 840

Post » Mon Mar 02, 2015 7:26 pm

Paperbeemo wrote:I would say is to use post requests to a php file to update a jsonValue then every 2 secounds is to use a get request to get the chat


Yeah, that's probably the best way to do it. Just figured I'd ask!

Would there be a way to have C2 create a new PHP file on the server during the course of the game? For example, let's say a player 'groups up' with several others, would it be easy using C2 to create a PHP file with the filename of the group leader's name on the server, and then they have their own private chat room separate from the global chat room? (assuming it would be trivial to make the chat window 'tabbed' when building the game's interface)
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Tue Mar 03, 2015 7:35 pm

have it store usernames that can only see the chat if the names are nil then show the whole server.
B
10
S
1
G
1
Posts: 63
Reputation: 840


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests