NedSanders's Forum Posts

  • > would a possible solution be to restrict this to just being able to trigger Functions in nodes?

    I think that is already possible with 'On tagged node change' in the Flowchart Controller object. Give the node a unique tag, and then that trigger fires when the node is reached, where you can then place any special logic for it. (Correct me if I'm wrong @DiegoM)

    Ah, thanks for the clarification. The Flowchart feature is bugged for me so I haven't been able to try it out without a crash - I'm just going off what others are reporting.

  • On the seemingly controversial topic of enacting logic within nodes, would a possible solution be to restrict this to just being able to trigger Functions in nodes? That way, all logic can sit in the Event Sheet and the nodes would just reference it, instead of creating 'pseudo event sheets' or resulting in the flowcharts competing with Event logic (which I fully agree is something to be avoided).

    Interested to hear your thoughts on this, DiegoM?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • I put together a rough json-based dialogue system that uses chatmapper exports a while back. I gave up around the time it came to implement complex condition handling. I did manage to get basic logic down (check condition, hide/show option, etc.) but it quickly became clear that what I wanted was possible but would take a hell of a lot of work to get running.

    I plan to use a more stripped down version to handle basic dialogue but sadly I think the Disco Elysium style deep dialogue system I dreamed up will have to wait. Ashley has made it pretty clear that a built-in dialogue system is way beyond scope and I think it would be one hell of an undertaking to rustle up a plug-in for this purpose. But like I say, not impossible. The moment someone does, they have my download.

  • You do not have permission to view this post

  • "Mesh distortion" - you can see it clearly in this example.

    Thanks - I had a look but it seemed more complex than what I needed. I think I may have falsely assumed that simply setting the position of a mesh point with the set mesh point function was a simple thing to do.

    I'll try to break it down and see how easily I can replicate in my project.

  • Mesh points are relative to the position, angle and size of the object. That can be useful or inconvenient depending on what you want to do.

    If the sprite isn’t rotated then this should work to get an x,y position on the layout converted to a mesh point location.

    MeshX = (x-sprite.x)/sprite.width

    MeshY = (y-sprite.y)/sprite.height

    Much appreciated? What if it is rotated?

    What I'm trying to do is create a sort of cursor made up of a circle that follows the mouse and a kind of beam that is fixed to the player but has it's width set to the distance between them and the cursor, which it is always pointed towards. I thought it would be nice to use meshes to ensure that the end corners of the beam are always set to the height of the cursor. (apologies if the explanation doesn't make sense)

    Is this not possible since the beam will almost always be rotated?

  • Hello!

    I'm trying to something frustratingly simple: set the x and y coordinates of a mesh point for a sprite. To try and test this, I've set up a square sprite with a 2x2 mesh grid and I want one of the points to be set to the mouse position. However, I'm not able to do this without the mesh point going infinitely off the screen. Is it possible to simply set the position of a mesh point? I feel like this should be possible. What am I doing wrong?

    Tagged:

  • 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