Placeable

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Object that can be placed into the game world by instancing the packed_scene.

Source File: addons/grid_building/placement/placeable/placeable.gd

Extends: GBResource

Exported Properties

  • Property: display_name : StringName - Display name for in-game reading.

  • Property: icon : Texture2D - Texture icon for UI elements.

  • Property: packed_scene : PackedScene - Scene to instance when placed.

  • Property: tags : Array[CategoricalTag] - Category tags for grouping placeables.

  • Property: placement_rules : Array[PlacementRule] = []

    Placement rules specific to this placeable. If ignore_base_rules is false, these rules are combined with base rules from GBSettings.placement_rules.

  • Property: ignore_base_rules = false

    When true, skips base placement rules from GBSettings.placement_rules and uses ONLY the rules defined in placement_rules.

    Use cases:

    • false (default): Inherit common rules + add object-specific rules
    • true: Completely custom validation (e.g., special objects with unique placement logic)

Constants

  • Constant: UNNAMED_FALLBACK: String = "Unnamed" - Fallback text for placeables without display names.
  • Constant: NO_PACKED_SCENE: StringName = &"NO_PACKED_SCENE" - Constant for when no packed scene is available.

Public Methods

get_load_data

1
get_load_data(p_include_uid : bool) -> Dictionary

Gets a serialized reference to the placeable for both the FILE_PATH and the file path as a backup


load_resource

1
load_resource(p_load_data : Dictionary) -> Placeable

Flags: static

Function to help location the placeable using FILE_PATH or file path as backup and returning it


get_packed_root_name

1
get_packed_root_name() -> StringName

Gets the name of the root node in the packed_scene


get_display_name

1
get_display_name() -> String

Returns the display name with a fallback if not set.

Returns display_name if set, otherwise returns the packed scene root name, or UNNAMED_FALLBACK if neither is available.


get_editor_issues

1
get_editor_issues() -> Array[String]

Returns an array of issues that were found in the placeable


get_runtime_issues

1
get_runtime_issues() -> Array[String]

Returns all found runtime issues including the editor issues as a baseline.


Private Methods

_init

1
2
3
4
_init(
    p_packed_scene : PackedScene = null,
    p_placement_rules : Array[PlacementRule] = []
)

Flags: private


_validate_property

1
_validate_property(property: Dictionary)

Flags: private

In editor validation