I have some object sprites that symbolize equipment. They all have a number for which slot they are. "Slot 1" for example is the weapon slot. The weapon is set depending on what "Slot 1" contains (what name a variable has).
If slot1.name=none set weapon to "none".
When I pick up a weapon it sets slot1.name to the weapon.name (shortsword).
Which sets slot1.name=shortsword.
All these objects are on a global layer and they have persist. Yet they reset to their original state if I leave a layout.
So each time I leave a layout, slot1.name becomes "none" which is it's default state.
How can I fix this issue?
EDIT: I noticed when I went back to a layout I picked up a weapon in, it saved that state. But why does it not bring this state over to another layout?