I'm working on the 'New Game' option item for my game. During normal development, I'd just exit the simulator, go to my Disk/Data/mygame directory and delete everything, then restart the simulator - clean game state!
So now I'm implementing 'New Game', which first thing goes and deletes everything in Disk/Data/mygame, but... I've still got tons of tables/variables/etc. that still have contents that I don't want/need... and there's lots of them (and a pain to track down/reset them one by one - there's lots).
This would be simpler if there were a SDK function to just 'restart my game' that I could call after wiping all that old datastore... then everything would just come up clean again as if the game had never been played.
Is that possible? I've looked through the SDK docs and searched here in the forum and haven't seen anything.
I don't know... does that nest? (sort of, you know, stack-ishly?)
And (if it's ok to do that) could you be a little more specific as to exactly what I'd pass as an argument? It's probably obvious to the Devs but I haven't a clue.
Aside: less of an issue now, I went back and tracked down the errant statevar that was giving me problems - but there's also been recent forum traffic about invoking separate chunks of a game that's relevant in intent with this thread, so still might be useful to explore things further.
To work around that you could use env with a table you clear before running. You could also run the pdz early in your logic so that it always uses this instead of global _G.