NedSanders's Recent Forum Activity

  • Chat Mapper is a really powerful tool for handling branching dialogue. You can create a dialogue in it complete with logic and variables, then export it as a JSON file and run it through a plug-in for Unity, Unreal or a number of other engines. However, no such plug-in exists for Construct so everything must be done manually.

    I’ve started building a game that can read Chat Mapper JSON files and parse them as interactive dialogues. So far, I’ve only implemented basic UI, option selection and branching but I’m happy with how it’s shaping up. The basics are all there and it pretty much functions. The next thing I want to do is implement logic - specifically conditions.

    Chatmapper stores all variables relating to the conversation in a UserVariables array. Rather than keeping these as variables within Construct, I have to refer to them within the Master JSON file if I want to check them or change them. The challenge comes from how I use the information provided to do this.

    Normally, Chatmapper uses Lua to handle its logic. You can enter something like “Variable["variable_name"] = true” into the Script Editor field and the plug-in will take that information and automatically adjust the variable. Obviously, I can’t do this within Construct - the entry will just come up as a string within the dialogue node array but Construct doesn’t know what to do with it.

    Does anyone have any suggestions for how I can use these strings to a) determine whether or not options will show up depending on variables and b) change variables based on information within the JSON? I've got a couple ideas but I really don't have a programmer brain and I wanted to get some advice before I jump into an unnecessarily complicated solution and create a million future problems for myself.

    Alternatively, Chat Mapper allows you to create custom fields within the export. These can be numbers, text, booleans or any number of things. Is there perhaps an easier way to achieve this using this functionality?

    Any help or suggestions would be hugely appreciated. I’ve attached a link to the project below so feel free to poke around but I’m also happy to answer any questions.

    drive.google.com/file/d/19inz60JSCYuGl_3iu7xShrjdVPqdwWlQ/view

  • I'm trying to make a game based around the infinite monkeys on infinite typewriters thought experiment.

    I have a) a string that continuously adds random letters and b) a plain text file containing the entire works of Shakespeare. The idea is that when the random string generates a word that appears in the Works, it's removed from the text file and a variable increases to convey progress.

    I've tried various methods but can't figure out a way that works. Is there an obvious function or different approach that I'm missing?

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • I've never used Dialogue Designer or any similar editors. I'm guessing they are pretty powerful tools and allow to construct very complex dialogues, that's why the JSON structure is so cumbersome.

    You can edit or convert the JSON before importing it into your game. For example, you can straight away get rid of the parent array - remove "[" and "]" from the top and the bottom of JSON string. This way you won't have to add "0." to access any key.

    The "nodes" is still an array, so to find a particular dialogue you will have to iterate it, for example:

    > For Each entry in "nodes"
    Compare two values JSON.Get(".node_name")="6291363"
    

    You can create a function for it, which will search the JSON for a particular dialogue id and return the path to it. For example:

    > JSON Set Path to Functions.FindDialogueByID("6291363")
    MyText set text to JSON.Get(".text.ENG")
    

    As the result the text should show "Good for me? Absolutely right - I'm a dog!"

    Another option is to convert "nodes" array to a list of objects and maybe simplify JSON by removing all unused keys. You'll either have to do it manually or perhaps create a small tool for it. The resulting JSON may look like this:

    > {
    "dialogue_dog": {
    "character": "Player",
    "choices": [],
    "text": "Hello, I'm a dog!"
    },
    "dialogue_dog_response1": {
    "character": "Player",
    "choices": [],
    "text": "Good for me? Absolutely right - I'm a dog!"
    }
    }
    

    This way you could access any dialogue directly by its key name without having to loop through the array. For example "dialogue_dog_response1.text"

    By the way, check out this demo, it shows paths to all keys in JSON:

    https://www.dropbox.com/s/srgf9lme08by9wa/JSON-RecursiveRead.c3p?dl=0

    Thanks for your help! I'll be honest, I didn't understand everything you said the first time reading it but I've read it a few times and now I think I at least understand some of it - mostly that the iterative process is the way to go.

    I'm still struggling to fully wrap my head around 'for each' but I've at least managed to make a start. Now I just need to figure out how to make the engine understand to go to 'next' when there are no choices (I tried calling the function again when the node-name is START or when option1 is 0 but no luck yet). I think I'm starting to get the logic, but getting to the point where I can think in JSON paths and understand the 'for each' stuff without making my head hurt may take a while.

    Here's the updated version with a slightly more complex dialogue if you're interested: drive.google.com/file/d/1EP7vfR_ieEZFvQK4ddW23VFguyzb2NnH/view

    My ultimate goal is to get the point where I can build a robust system to process dialogues that will parse any DD files I feed into it with a simple function so I can get on with the simple stuff like moving the character around and building the non-dialogue side of things.

    Thanks again for your help!

  • First of all, apologies for my lack of understanding of JSON. I'm not familiar with JavaScript. I've read and re-read the documentation as well as loads of other online resources but I still don't feel like anything has 'clicked' for me yet. With that said, here's my situation:

    I've been messing around trying to build a branching dialogue tool that uses json data. I've been using Dialogue Designer to generate the json files and jsonviewer.stack.hu to try and better understand the structure of json files.

    The issue I keep coming into is that each path node is classified by a number (starting from 0) and the actual data that would help me identify nodes and know which one to go to next is nested WITHIN these numbers.

    For example, to path to get to the first node is "0.nodes.0". From here, I can access all the details I need: the dialogue text, the character name, the node name and the choices - each one also containing the node name that picking that choice leads to.

    The issue I keep running into is that I can't use the node name under 'next' to get to the next node, because I still need to know which number (0,1,2,3,etc.) that node falls under. That's not information that is contained within the node.

    This way of formatting seems pretty standard across all dialogue editors (Articy, Chatmapper, Twine, etc.). How do people get around this and get a new path based on information that's actually inside the numbered nodes?

    I'd hugely appreciate any help. Especially if you could explain it simply. I don't know if it's useful or not but I'll link to the test file I'm using below. Currently, I'm just trying to use a text object and a simple test dialogue to debug this and figure out what I'm doing wrong - there's not much logic.

    drive.google.com/file/d/1Dh_RvwTxMYxbieIzYpLzCIodxqQYYmWS/view

  • Alternatively, if anyone has any suggestions for other ways I could achieve this, please let me know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been blocking out levels of my platformer game using multiple sprite instances, which I then resize, tweak and rotate until I'm happy with the feel of the level.

    For the final product, I'd like to use them as transparent hitboxes and use an image over the top to represent the actual level that the player will see.

    In order to do this, I assume I'd need to export all the instances with all their individual positions, sizes, angles, etc. into Photoshop and draw the art over them. Is it possible to do this and if so, how?

    (I've included an example layout below if that's useful. I'm not using grids as I want the levels to feel dynamic and unique, so I can't make tiles.)

    drive.google.com/file/d/1nAXZ80KZE24Me8ji0WXwSt_InuwXcZ9q/view

  • No idea, it's corrupt or something. You download it and tell me if you can open it on your end.

    I may have been sharing it wrong - I just copied and pasted the files into Google Drive.

    I found the issue however. It turned out to be an add child action that was causing the issue - I disabled everything and went through every line, disabling and testing and that seemed to be the one. Still strange that it only became an issue after updating though.

    Thanks for looking into it anyway. I'll try to figure out how to properly share files.

  • Your actual file is broken it won't open

    Okay? Broken in what way? How do I fix it?

  • Hi! I recently updated Construct 3 whilst working on a game and now, when I try to preview, it shows a black screen. Music plays and instances clearly exist and can be viewed in debug mode. A progress bar is visible. It was all working fine before the update.

    The timescale is set to 1 but the time itself doesn't appear to progress. Additionally, behaviours like scroll to are not working, even though they aren't affected by timescale. I've included a link below - if anyone knows what's causing the game to act this way, I would seriously appreciate it.

    drive.google.com/file/d/1u5g_aVLKcMT6VeyIAaEdPAV-8pj1GkpI/view

    Tagged:

NedSanders's avatar

NedSanders

Member since 31 May, 2022

None one is following NedSanders yet!

Trophy Case

  • 2-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

7/44
How to earn trophies