Just keep in mind for all of this that I'm very inexperienced when it comes to using JSON, this is my first time properly trying it actually...
I have a World Map system for my game that reads off a JSON file to check what state a "node" (level marker) should be in. It then applies that state to the instance variable. This worked fine for that, but when I tried to do something similar with level clears it kind of didn't work. I wanted to have it so that depending on if the player got a collectable or not, they'd be sent back to the world map or to a short intermission layout that has an extra scene or something along those lines. The way it'd do that is by setting a "HasCollectedMemory" variable in the JSON to true. The once the level is over, it checks to see if HasCollectedMemory is equal to 0 or 1. Despite this, nothing happens. And really I'm not sure why the same set up worked for one thing but not the other. If I have the "set path to Nodes." in the function it will immediately stop the loop after just checking the first index. Obviously not what I want. If I remove it, it does loop properly but still doesn't work.
Anyway I'm probably doing a bad job of explaining this so it's probably better if you take a look at the code and project file yourself:
example of the function that works:
Function that doesn't work:
(Note that !LevelEnder means that its collectable here, if LevelEnder is true then its not a collectable.)
(Left out any irrelevant code, but this is for a version of the object that has LevelEnder set to true. The condition is the same as the other one just inverted if you were wondering.)
The JSON:
(Note: The SetMemory/CheckMemoryStatus functions are in a separate event sheet from the AJAX request. However the AJAX request is made on an event sheet included within the event sheet those functions are in. So, it shouldn't matter but I thought id mention it.)
And finally here is the C3P file for the basic systems... Hopefully this should be enough. It's a bit sloppy and thrown together but it should(?) get the job done. Let me know if there are any issues:
dropbox.com/scl/fi/hzqewi40vm4q8h6flhr6l/NODEDATAEXAMPLE.c3p