I'm having a really hard time dealing with arrays in RMMV.
If I create an event and use a script inside like this:
var ar = [];ar[0] = "example";Then I can use the array value during only this event. The array will not persist through the gameplay or other events. If I try to use the value ar[0] in any other event, the game crashes with: "ar is not defined".
I also tried to include the script to create the array in a common event or start up event, but they don't persist in the game, it's like they are not global variables.
My project will need to use multi-dimensional arrays, but I can't make a simple one to work, outside the same event.
How can I create persistent arrays, or global variables to use anywhere in the game? Is there a way inside script calls or do I have to use a plugin to control the global variables?
Please, assume that I don't want to work with the "gameVariables", unless it can somewhat accept multi-dimensional objects/arrays inside it.
If I create an event and use a script inside like this:
var ar = [];ar[0] = "example";Then I can use the array value during only this event. The array will not persist through the gameplay or other events. If I try to use the value ar[0] in any other event, the game crashes with: "ar is not defined".
I also tried to include the script to create the array in a common event or start up event, but they don't persist in the game, it's like they are not global variables.
My project will need to use multi-dimensional arrays, but I can't make a simple one to work, outside the same event.
How can I create persistent arrays, or global variables to use anywhere in the game? Is there a way inside script calls or do I have to use a plugin to control the global variables?
Please, assume that I don't want to work with the "gameVariables", unless it can somewhat accept multi-dimensional objects/arrays inside it.