PlaceableInstance

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Component to attach to objects that are placed by the building system by remembering the placeable resource that they were instanced from

Source File: addons/grid_building/components/placeable_instance.gd

Extends: GBGameNode

Signals

  • Signal: placeable_path_changed(placeable_path: String)

Properties

  • Property: placeable_path: String:

    Path to the placeable resource that creates or recreates instances of this gameplay object type

  • Property: placeable: [Placeable](./placeable/)

Private Properties

  • Property: _logger: [GBLogger](./gb-logger/) (private)

Constants

  • Constant: default_name = "PlaceableInstance"
  • Constant: group_name = "PlaceableInstance"

Public Methods

resolve_gb_dependencies

1
resolve_gb_dependencies(p_container: GBCompositionContainer) -> void

validate_setup

1
validate_setup() -> bool

save

1
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


instance_from_save

1
2
3
4
instance_from_save(
    p_save: Dictionary,
    p_instance_parent: Node
) -> Node

Flags: static

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


Private Methods

_init

1
_init(p_placeable_path: String = "") -> void

Flags: private