Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
670 stars 72 forks source link

Cogito Objects that aren't unchanged instanced of their scenes / have overrides do not save/load properly #183

Closed Phazorknight closed 2 months ago

Phazorknight commented 2 months ago

Cogito and Godot Engine Version: Godot 4.2.1 stable

Description: (edited) Cogito Objects that aren't instanced scenes / have child nodes that have been edited, do not save/load properly.

Reproduction steps:

Expected behavior: These should save/load or have scene persistency as expected.

Phazorknight commented 2 months ago

Ok, took a closer look and I don't actually think this is related to the object being a StaticBody3D. Instead, I think it has to do with the nodes being instanced scenes with "prefab overrides" aka their children have been edited inside the editor. On scene state load, these overrides get lost as they're not saved within the object scene.

As these hints don't actually need to be traditional CogitoObjects, I'll look into creating a new class that works for them. Something like CogitoStaticInteract, that would work for static objects that can have interactive components attached.

Phazorknight commented 2 months ago

Ok, this should be fixed in https://github.com/Phazorknight/Cogito/commit/4f0e4baf74ffe986b5813f8b2a5118cb68cf3d7d

I've created a new Cogito Object class called "Cogito_StaticInteractable" that does not get saved/loaded, but supports interaction components.