Greetings,
I’m testing a level progress system very similar to Wario Land 3 for testing purposes.
For those unfamiliar with Wario Land 3’s gameplay progression, each level has 4 treasures to find, but usually only one is available at any given time. When Wario finds a treasure, it powers him up or alters the world in some way, opening up new levels or granting access to treasure in previous levels.
So I decided that maybe I need a global variable to track each chest, and which treasures have been collected thus far. So I made a quick example with three basic levels. Here’s one:
I set up my global variables like this:
1, 2, 3, and 4 refer to which of the four treasures it is, obtained checks if the treasures has been obtained, and type refers to what the obtained treasure itself will be.
Levels 2 and 3 have this same structure setup copied into them too.
When the player opens a chest, the treasure pops out, and I would like for the corresponding global child variable to be saved.
For example, I want to collect the first treasure in level 1, so the game would take Level[CurrentLevel] to check for the current level, find which one of the 4 chests it is with chest.globalVarProgressionType (This changes from 1 to 4 based on it’s color), and changes obtained to true.
Unfortunately, that doesn’t happen here…
The boolean has not been toggled. But even stranger…
The game instead decided to create a whole new global variable and return… whatever this is…
I know that I must’ve set up the global variable incorrectly, but I’m not sure how to get it to refer to the specific child variable…
I might as well also ask, is this global variable setup ideal? Or is there a better way to do it?