Chat room questions (multiple rooms and other stuff)

Get help using Construct 2

Post » Thu Sep 07, 2017 3:43 am

I'm working on an app to play a tabletop roleplaying game i made. The game is played in a chat room, so I figured I could use the scirra chat example as a starting point and go from there.

I've read through all of the multiplayer tutorials, but still don't get some things. I have some basic questions about how data is sent.

1) I'm trying to create a chat app that has multiple rooms. When the user clicks on a room, they see messages that are sent to that room, but no others. What is the best way to go about this? In my capx, I'm trying to push all chat data to arrays, with one array for each room and then print that data to the rooms, but I either get it to the point where I can't see messages at all, or messages are showing up in rooms where they shouldn't be.

2) I've been able to send JSON info across the clients, but how do you do something simple like send info about the currently clicked on item in a listbox?

I've tried something like:

Peer message tag "roomSelected" message roomList.SelectedText

On peer message received > Do something with Multiplayer.Message, but nothing ever shows up in the Multiplayer.Message data.

3) For a chat room, do I ever need to use sync or associate object? I'm really kind of struggling to understand how it would work here, and the Chat tutorial doesn't make mention of it at all.

This is my capx here: https://www.dropbox.com/s/rt93j9xwaqbub ... .capx?dl=0

Sorry if these are really basic questions, but I've read through the tutorials and searched the forums and not really found any answers.
B
22
S
4
G
1
Posts: 38
Reputation: 2,081

Post » Fri Sep 08, 2017 10:52 am

Hey @Yanen!

1) It seems you're trying to work with rooms created by yourself, instead of using Construct's own room structure. Is there a reason for doing that? Construct Multiplayer object can already create rooms and sort the messages on those rooms to people who are connected to them. Instead of using a constant for ROOM_NAME you should have a variable or an array with all rooms you want to exist. When players connect you shoul let them pick a room, or assign them one according to your needs. I'm not sure how you want it to work. :)

2) I'm not sure I get what you want here, but it seems you are trying to achieve something like the IRC interactions, like, for instance, to click on a player's name on the list and execute a command to that player is that it? In this case you'd have to implement all commands for the host and give peers actions that sends the host requests for those commands on the selected player.

3) Depends. If we're talking about basic chat functionality, no. If you want to give the players other "abilities", like a shared whiteboard, for instance, which would be very useful for a RPG chatroom, yes.

Hope that helped. Good luck with your project. I'd really love to see it working when you're finished.

Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
19
S
5
G
2
Posts: 546
Reputation: 3,259

Post » Fri Sep 08, 2017 7:25 pm

Hi there, thanks so much for responding!

1) I must have misunderstood what the ROOM_NAME variable is (and also misunderstood what rooms were within construct 2). I'll read through the examples again and see what i've missed. If I can use the existing structure, I'd like to. Part of the reason I did it like I did is because players need to be able to pick rooms dynamically (so they click on something, then see all the messages in that room), and I wasn't sure if that would work/be too much data load.

2) Essentially, yes, it's similar to IRC. I'm trying to develop a chat app for a game that i designed as part of the 200 word RPG contest (this one here). The core functionality would be the thing that ejects the person from the room, creates a room, and then copies all the characters from the first room into the created one (while still leaving them under the control of the players that created them). This is the main reason I wanted to develop an app, because the process of creating a new room/universe and then recreating all the characters would be really tedious in typical chat room environment.

3) Ok cool, thanks for clarifying this. I mostly need basic chat functionality.
B
22
S
4
G
1
Posts: 38
Reputation: 2,081

Post » Sat Sep 09, 2017 12:45 am

Ok, so the problem i'm having with using the built in rooms is: how do you keep a standardized set of arrays that contain data about the messages of the rooms.

The issue is that in this game, there will not necessarily be someone in a room at all times. Whenever a room is empty, there is no one there to hold onto its data. Obviously, a room with no one in it won't be creating new data, but how do I hold onto the chat data that already exists for that room?

I was thinking of having it so that whenever someone leaves a room, they are immediately sent to a lobby room that will always have someone in it and that person keeps all the data (so basically, when i run the game, i'll just log in a person named "Lobby", leave them in the lobby room, then log in a "real" account to actually play). There must be a better way of doing it though (also, i'm not sure that will even work, since people could leave rooms at different times)? What am i missing?
B
22
S
4
G
1
Posts: 38
Reputation: 2,081


Return to How do I....?

Who is online

Users browsing this forum: dand, fabianosalles, mickclarke, Yahoo [Bot] and 24 guests