I'm using a hint system that uses objectives to store hints in a csv style string and a local variable that stores opened hints in a comma and line separated variable. The hints are organized by Scene name/Objective style. And the opened hints
variable uses Objective number-Hint boolean-Hint boolean-Hint boolean, next objective style.
Here's couple of pics:
https://imgur.com/a/Dq4eTts
I am now trying to create a script that would initialize the opened hints variables in all of the scenes in the beginning of the game so that it goes through all of the objectives of the scene and their hints and creates a variable like mentioned upper there automatically. So I would need to access all local variables in the start game situation.
Or should I just create a bigger global variable for all the hints instead?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
BTW is there an easy way to combine several local variable into one global one?
Best to rely on global variables if you need to be able to access them without opening another scene. Opening each scene at the start of the game to gather local variables would cause issues with the startup logic for each scene.
You could still rely on separate global variables for each scene, but if you wanted to combine them into one, you'd need to have another unique separator between each data block, and precede each data block with a scene identifier. Your hints variable would then look something like:
Hi, I actually managed it so that all the hints are in one string like this ObjectId-boolean-boolean-boolean;NextOne. And the actual hints are stored in Object description as csv and managed by the same ObjectId.
With this approach there's no need to manage hints by scenes.
BTW I would really like a tool in which one could see the variable changes in real time. Something like a spreadsheet. That would also have a visual tip when values change - something like a background color flash.
The OnVariableChange event can be used to record changes in variable values.
A rough example, that outputs such changes to the Console: