Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
920 stars 106 forks source link

Items in rooms are not persistent when saving/loading #325

Open lukasaurus opened 2 hours ago

lukasaurus commented 2 hours ago

Cogito and Godot Engine Version: beta 202410.02

Description: You can go into the lab, pick up gun, go back to main hall, save the game and reload. However, if you do that, the gun will be back. This also happens for other objects. It seems like only the room you save in is persistent.

Reproduction steps: Start a new game Go into Lab Pick up gun Go back to main hall Save game Shutdown game

Start game Load game Go into Lab Gun is back

This is repeatable with any item. Get the item, go to another room, save the game and quit. Reload, go back to the room where the item was and a new one will spawn.

Expected behavior: Everything as above, except that the gun should not be there, as it is already in my inventory.

Screenshots: If applicable, add screenshots to help explain your problem.

Phazorknight commented 2 hours ago

Hey, thanks for submitting this!

So from my own experiements: Starting a game scene, then loading the saved slot from within the pause menu seems to load the saved state from the other scene as expected. So this seems to only happen when loading the saved slot from the main menu.

Will look into this more, but should be fixable.

lukasaurus commented 1 hour ago

That would be awesome. My students are going to create a single player extraction style game and this is the perfect framework for it, if scene persistency works. They've already added some basic enemy AI and Q/E leaning etc.