This is what I have. The second action in the purple button is just for me to verify that it did successfully save the text input as the global variable.
I put everything else attached to the yellow button cause I thought maybe it wasn’t working because it needed to be separated out from other actions? I’m really not sure but I figured it couldn’t hurt to try.
As I understand it, this is supposed to find “Player” in the yarn dialogue and replace it with the global variable. But it’s not doing that when I run the dialogue. I even tried just replacing the string with another string, in case the issue was the variable, but that didn’t work either. So I think my issue is somewhere in the loading of text / dialogue but I’m not sure what.
I know that post is a year old now so maybe the functions themselves are different and there’s a different way to go about this altogether? I’d really appreciate any help, thank you!
The first possibility that springs to mind is maybe the “Load dialogue data from file” in the first event is preventing the second “Load data from variable”
To test and debug, what happens if you replace the action in the very first event with the actions of the yellow button click?
Unfortunately I tried that already and then NOTHING shows up lol
I also tried keeping the beginning of scene event as is and making the yellow button actions sub events of it and that didn’t work either
Yup! Activating the text and moving to the next line all works as normal and it shows fine, it just doesnt replace the word for some reason, its so weird
If it’s a small project (something like a PoC), could you zip up the project directory and make it available on a shared drive (i.e. provide a link to it)? Then someone could download it and investigate what’s going on. Because on the face of it, the whole thing should work.
I’m not sure what PoC means in this context but it is a test scene in a larger project. The events aren’t complicated though so I can recreate them in a smaller project and share that!
I also thought maybe the error is in yarn trying to load the text from the scene variable and maybe it HAS to be a json. (I know gdevelop has gotten a lot of updates in the last year so maybe something just no longer connects to yarn the way it used to?) So I tried creating an empty yarn file and then instead of trying to load dialogue from the scene variable i saved the the scene variable into the blank dialogue json and then loaded THAT.
But when I go to test it, its loading the blank file, not the loaded in (and in theory modified by regex) first file.
So i’m not sure where the hiccup is, maybe the initial loading the text command isn’t working properly so nothing else after it (except the load from json) works?
My last action on this most recent attempt or the original attempt? I’m not sure what you mean. When I type ‘tojson’ into the actions these are the options
You don’t have the correct syntax in “Load data from json file”, you’re providing a variable instead of a file path, which isn’t compatible with that action. So while that also won’t work, I don’t have any good suggestions. Disregard me.
Yes. I’m saying that with the most recent updates to GDevelop, typing a name in any field that takes expressions, if it equates to a variable name, will now call the variable itself instead of anything else.
So what you’re pulling is likely the flat variable, and not your json file as you would expect.
Maybe, but you’re not calling the file you expect, though.
You need to call the full path of the json file (especially since, as far as the engine knows, it doesn’t exist), since you’re saving it as updated_dialogue_file.json, you’d still need to load it as that file name (with extension), and likely with the full path, not just the name part of the filename.
PoC stands for Proof of Concept. So a small project that’s used to test a technique or process to make sure it works before using it in the proper project.
The other thing you can do is use the debugger to see what variables are populated with, if anything/ Or use developer tools (on GDevelop click file → view) and see if there are any console messages.