You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Game.gd rewrites the tracked file _userFiles/game_01.tscn on every run #118
Game._ready() in the MVP game (Phase2/MVP/Game/bcirpg_game_mvp_2024_0831A/gamePlay/Game.gd) calls save_module() every time the game scene starts:
#DKM TEMP: saves the entire scene in one packed scene filefuncsave_module():
varscene=PackedScene.new()
scene.pack(self)
#var _saveResponse = ResourceSaver.save("user://game_01.tscn", scene)var_saveResponse=ResourceSaver.save("res://_userFiles/game_01.tscn", scene)
Problems
Every run edits a tracked file._userFiles/game_01.tscn is in the repo, so running the game leaves it modified in git status. It has been committed many times, and it nearly slipped into Fix ObjectDB instances leaked at exit in the MVP game #117.
The saved file isn't used. Nothing in the project loads game_01.tscn. pack() only saves nodes owned by the scene, and the call happens at the start of _ready(), before any game text or options exist. The output is essentially a copy of Game.tscn.
It fails in exported builds.res:// is read-only in exported builds, including HTML5. The return value is ignored, so the save fails silently.
History
save_module() was added in 60b8f78 (April 2022) with the comment #DKM TEMP: for testing only. It replaced an earlier load_module() experiment, and it saved to user://game_01.tscn, which is outside the repo. It was later changed to save to res://_userFiles/.
Possible fixes
Remove the save_module() call (and the function), and delete _userFiles/game_01.tscn from the repo. Or:
If it's still wanted for debugging, save to user:// again, and delete or ignore the tracked copy.
MacDugRPG, is this still needed for anything planned, such as saving and reloading a game state?
Activity