2 Answers

All of an object's properties should all get saved as long as they're one of SugarCube's supported types. However, if you change any variables after the passage is displayed (such as by the player pressing a button), then those changes will not normally get saved unless a passage transition occurs first.

So if, for example, you have a passage that allows the player to buy and sell items without triggering a page transistion, it may make more sense to autosave in the next passage that they go to, if the purpose of the autosave is to make sure they don't have to resell/repurchase everything if they have to reload.

That said, based on your code above, you simply have a problem where you're declaring your variables as arrays, instead of as generic objects. It should work fine if you do this instead: