Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
13 stars 5 forks source link

Save map chunks from the escape menu #294

Closed snipercup closed 3 months ago

snipercup commented 3 months ago

Right now the save game button in the escape menu only saves the player data and no map data.

We can modify this code to have the chunks save their data as well: https://github.com/Khaligufzel/CataX/blob/cc1000d6365cf418d6a9d9fd4122fc64d91e3545/Scripts/Chunk.gd#L430-L434

Have the chunk data be stored in loaded_chunk_data. Then, we need to call a function like this but NOT erase the chunk data: https://github.com/Khaligufzel/CataX/blob/cc1000d6365cf418d6a9d9fd4122fc64d91e3545/Scripts/Helper/overmap_manager.gd#L481-L498

Then, we can save it using https://github.com/Khaligufzel/CataX/blob/cc1000d6365cf418d6a9d9fd4122fc64d91e3545/Scripts/Helper/overmap_manager.gd#L472-L473