Yanen's Forum Posts

  • Got it working after a good bit of trial and error. Thanks for your help.

    Final function wound up looking like this:

    Additionally, I had to update the checkRequiredItems function (this was tough for me, because it needs to check multiple times if there were multiple required items):

  • Hey, thanks for responding.

    Good catch on the CurValue. Also, thanks for the tip about browser log. I didn't know that existed.

    Is this something like what you're talking about? (the boolean variables are a good idea for use within the loops):

    That seems to never return failure though, even though it seems from browser logs that the tokenat(tokenat(dictStoryText.CurrentKey,2,"|"),loopindex("x"),",") is finding the right items.

  • So I'm working on a sort of CYOA thing.

    It unfolds in scenes (scene 1, 2, 3, 4, 5, etc), and each scene I need to check to see what items the player has, and print a message to a textbox depending on that.

    I'm doing this with a dictionary object (dictStoryText) and using an array to store the items the player currently, which can change as the game proceeds (arrInventory).

    This is what I need to do, roughly:

    I can't post my capx, but what I've been trying to do is something like this:

    My dictionary object looks like this:

    This is the code I've been messing with:

    This prints, but it doesn't print the right messages (it doesn't seem to be able to figure out what items I have).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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.

  • 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.

  • Damn, that's really useful. The attack animations really make it awesome

  • Hi, thanks for the reply. Can you explain what you mean by "trim each word in a search loop of the array"? I understand the purpose of left and len, but I'm not sure how I would use them in an actual loop.

    Would it be like

    For "x" from 0 to array.Width

    array | Value at loopindex("x") = left(array.At(loopindex("x"), 7)

  • Is there a way to do this?

    Like say I need to search for all indexes that have a value that is a string, but I only want to search for part of the string.

    Example:

    I've pushed the following values to the array:

    "Oranges 2"

    "Oranges 3"

    "Grapes 2"

    "Oranges 10"

    "Oranges 10" is a value I want to keep in there, so I want to use IndexOf with Delete to kill the other two. I can't just pop the front of the array because that would get rid of "Grapes 2" as well. How would I target just the "Oranges 2" and "Oranges 3" values for deletion if I want to do it by searching for "Oranges"? Is there a better way of doing this that I'm missing?

  • I'm working on a multiplayer boardgame that uses the drag and drop behavior to move players around. I've got it setup so that players can only drag their own piece, and that works fine, but the pieces are returning to their start positions (that is, where they were when the layout started). I've set up the client input states using the X and Y positions of the objects. I know I must be doing something wrong, but I don't know what. Do you need to somehow use set/getbit for drag-and-drop? I used the Multiplayer Pong example as a base for this, if that helps.

    Here's my capx: https://www.dropbox.com/s/fly121olw0vmv ... .capx?dl=0

  • Ok, so looking at the multiplayer object further, it seems like save/load would (?) be possible as long as 1) I had the host do the saving/loading, and 2) I identified peers not by PeerId (which is randomly assigned), but by some alias that corresponds to the character or player slot they're playing in ("player1", "player2") and have people select that alias when they join BEFORE the host loads the game.

    Would that work?

  • I was thinking of starting an online multiplayer Dokapon Kingdom-like boardgame. The only issue is that games can take several days to actually complete. Is there a way to save the state of a multiplayer game when people leave, so they can pick it back up another time? Note that i'm still working my way through the multiplayer tutorials, and haven't started anything yet, i'm just curious if it's possible.

  • > I bought this a couple weeks ago. So far it seems interesting, but I have a question.

    >

    > Is there any way to texture an object using a texture generated at runtime (instead of just files that are pre-imported?). Specifically, is it possible to use a texture from CanvasSnapshot? Like, let's say I wanted to let the user draw an image, and then plop that texture on a cube. How would I do that? I've tried just putting CanvasSnapshot into the "Load an image file" event, and it doesn't give me the "File not loaded" error I usually get when I don't specify a correct filename, but my texture doesn't show up either

    >

    It is so easy...Just like 2D

    Lol, yeah. I just figured out that what I was trying to do is actually possible, I just had the "Emissive" material setting wrong so I was unable to see my texture

  • I bought this a couple weeks ago. So far it seems interesting, but I have a question.

    Is there any way to texture an object using a texture generated at runtime (instead of just files that are pre-imported?). Specifically, is it possible to use a texture from CanvasSnapshot? Like, let's say I wanted to let the user draw an image, and then plop that texture on a cube. How would I do that? I've tried just putting CanvasSnapshot into the "Load an image file" event, and it doesn't give me the "File not loaded" error I usually get when I don't specify a correct filename, but my texture doesn't show up either

  • Heya,

    So I'm working on a game that involves playback of recorded sprites (based off of the example in this thread here: scirra.com/forum/replay-like-meatboy_topic61661_page1.html). The original example is great, but I'm interested in adding to it. Specifically, I'm trying to figure out how to make it playback bullet objects spawned from the player sprite.

    I've gotten it to save and playback the location of bullets using arrays similar to the ones already in place for the recording of the people sprites, but I'm finding that some bullets go missing during the playback. Additionally, there's some weird stuff going on at the top of the screen (bullets flying around up there during recording/playback), so I think something is wrong with my array.

    I have a capx file here, and you can take a look at an online version here. Move with WASD, shoot projectiles with SPACE, and jump off the edge of the screen to trigger playback.

    Anybody know what I'm doing wrong? I'm particularly interested in what R0J0hound thinks, since he made the original one