Global array against persistent Instances

Hi,

I have a “general” object, called Galaxy. That object have a factory it use at INIT to create a few dozens to high hundred of an instancied object, called StarSystem.

The StarSystem objects are persistent all along the game (you keep the stars all alongs the game).

I use SELF in the instance to keep most of their pesonnal DATA, and a GLOBAL array for a few others, some because you can’t send strings (or arrays) to Property, some because they will need to work as a group (like the coordinates of the map).

I wanted to know if there is caveats/problems about storing data like that directly in persistents Instances, if I really need to put everything in some global array

I don’t see a problem with it. If you know the instance is around for the duration of the game you can just as well store something on self as in a global table.

1 Like

Thanks you. I will continue, then. I find it far simpler to use than Globals, for the moment.