#Need some help with "save data"?

1 messages · Page 1 of 1 (latest)

minor hedge
#

Hello, for the past few months I have be trying to create a rain world mod and for the most part I have succeeded. im not to good with words so I'll use some gifs to demonstrate. So my problem is this: lets say I started the cycle with the shell, and it got broken and I died, if I were to respawn the shell would remain broken. how do I make it so that it reverts to its previous state? Sorry if this is hard to understand. Thanks in advance!

minor hedge
#

Update: so I figured out how to make it come back if you do die, but now I need to figure out how to make it so it remembers what shell you had when you exit the game.

halcyon ferry
minor hedge
#

Part of the slug cat, the state of the shell is determined by an integer that varies between 0 thru 4, 0 being without a shell and 1 thru 4 being for each centipede species. I made it so that when the method SaveState.SessionEnded is called and you lived through the previous cycle, it takes the Current state of the shell and stores it in a separate "memory" integer. if you were to instead die in the cycle, it would do the opposite and set the state of the shell to the one from the memory integer. but it dosen't remeber this integer if you exit the game and come back.

halcyon ferry
#

you can use slugbase's save data api

#

it allows you to easily save and load extra data to the save file

#

you probably want to use MiscWorldSaveData, which is saved when you sleep in a shelter, but reset when you die