In the documentation it mentions that:
Persistent storage is written to disk between the
enter events when changing rooms or when the Player reaches an ending.
I thought that this would mean that it would happen during the finish event, like if I called
fin. However when I do this, it doesn't log properly store the variables.
I know it is written on exit/enter, but is there another way? Does "Ending" mean an ending exit tile, or is there a non-exit way to trigger an ending. It doesn't appear to be
fin, unless it should and that's a bug.
I'd rather not move the character out of the room just for the sake of persistent storage if I don't have to. On top of that, I'd just like a better understanding of this system.
Anybody with extra insight?
Update: I just tried adding an extra room just before the end to hopefully trigger persistent storage with the enter exit and that wasn't working either. So far the only time it has worked is when I took away
fin so I could leave the last room with my character.
Would love if anyone can help with persistent storage in general. Really want to use it but my game doesn't end with an exit tile so trying to figure out a way to store a variable as the game ends.
No extra insight unfortunately but as a workaround to having to goto another room, you could duplicate the end room and then move to the duplicate so the enter/exit is entirely hidden to the player.
I wish that would work but unfortunately even that is giving me issues. I made an "End" room that I only use to transport the user to before explaining the ending text. I was hoping this would store variables but even that wasn't working. So far the only way I've been able to store variables is by moving my character to an exit to another room.
Ah, sorry, I also misunderstood then! It does sound very restrictive if the game only saves on exit via placed exit
This sounds like either a bug or an oversight. I’ll look into it as soon as I wrap up this audio bug.
Ok, I feel like a fool, but I figured it out.
Before you looked at it I wanted to try to replicate it one last time using the default pulp game. At first I had some issues before realizing that the default game calls
toss during the
finish event on the
game source. Since I don't use the
game source in my own game, I hadn't really looked at it. I hadn't taken out the
toss from the finish event so the code was working exactly like it was programmed and tossing all persistent storage every time.
Glad the solution is so simple and thanks for your eyes!
Ooh, yeah, there probably shouldn’t be destructive code in the default game data. Good sleuthing! I’ll clean that up before the next update.
edit: that update is live.