PlaceableInstance
Summary
Section titled “Summary”DEPRECATED: This component is deprecated and will be removed in a future version.
Use GBPlacementPersistence
utility class instead for placement tracking. The new approach uses lightweight metadata instead of adding extra nodes to the scene tree.
Migration Guide:
- Replace
PlaceableInstance.new()
+add_child()
withGBPlacementPersistence.mark_as_placed()
- Replaceplaced.save()
withGBPlacementPersistence.save_placement_data()
- ReplacePlaceableInstance.instance_from_save()
withGBPlacementPersistence.instance_from_save()
- For batch operations useGBPlacementPersistence.save_all_placements()
andload_all_placements()
DEPRECATED: This component is deprecated and should not be used in new projects.
Use GBPlacementPersistence
utility class instead for metadata-based placement tracking.
The new approach is lighter weight (no extra nodes), more transparent, and easier to use.
See: addons/grid_building/utils/gb_placement_persistence.gd
Component to attach to objects that are placed by the building system by remembering the placeable resource that they were instanced from
Constants
Section titled “Constants”const default_name = “PlaceableInstance”
const group_name = “PlaceableInstance”
Signals
Section titled “Signals”signal placeable_path_changed( placeable_path: String )
Properties
Section titled “Properties”placeable: Placeable
Methods
Section titled “Methods”func _init( p_placeable_path: String ) -> void
func resolve_gb_dependencies( p_container: GBCompositionContainer ) -> void
func validate_setup( ) -> bool
func save( p_include_uid: bool ) -> Dictionary
Saves the location and reference to placeable reference so a new instance of the object can be created on load
Only provides enough data for the PackedScene to be instance but does not by itself remember the full state of the scene object
static func instance_from_save( p_save: Dictionary, p_instance_parent: Node ) -> Node
Instances a new copy of the saved PlaceableInstance placeable’s packed_scene
This only recreates the object as the PackedScene in the Placeable resource dictates plus adding a new PlaceableInstance node.
If you want other data to persist, you will need to create your one save methods
Source
Section titled “Source”addons/grid_building/components/placeable_instance.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.