Skip to content

PlaceableSequence

Groups multiple placeable variants under a single selectable slot for UI selection.

PlaceableSequence allows players to cycle through related building variants (e.g., Basic Tower → Heavy Tower → Rapid Tower) before placing on the grid. Each sequence contains an ordered array of Placeable resources that share a common purpose but have different properties, visuals, or functionality.

Key Features: - Ordered variant collection with left/right cycling in UI - Automatic arrow button display when 2+ variants exist - Compatible with PlaceableList and PlaceableSequenceSelectionUI - Validation delegation to individual Placeable objects

Usage Example:

var tower_sequence := PlaceableSequence.new()
tower_sequence.display_name = "Defense Towers"
tower_sequence.placeables = [basic_tower, heavy_tower, rapid_tower]

Integration: - Use with PlaceableSequenceSelectionUI for tabbed variant selection - Compatible with existing BuildingSystem placement workflow - Each variant maintains its own placement rules and validation

display_name: String = “Sequence”
placeables: Array[Placeable] = [] # Ordered variants
icon: Texture2D # Optional representative icon (fallback to first variant’s icon)
func count( ) -> int

Returns the total number of placeable variants in this sequence. Used by UI components to determine if variant cycling controls should be displayed. Returns: Number of placeable variants (0 if empty)

func get_variant( index: int ) -> Resource

Retrieves a specific placeable variant by its index position. index: Zero-based index of the variant to retrieve Returns: Placeable resource at the specified index, or null if index is out of bounds

func variant_display_name( index: int ) -> String

Gets the display name for a specific variant, with fallback handling. index: Zero-based index of the variant to get the name for Returns: Display name of the variant, or fallback “Variant N” if unavailable

func get_editor_issues( ) -> Array[String]

Validates the sequence configuration and returns any editor-time issues found. Performs sequence-level validation and delegates individual placeable validation to each Placeable object for proper separation of concerns. Returns: Array of validation issue descriptions, empty if no issues found

func get_runtime_issues( ) -> Array[String]

Validates the sequence for runtime usage and returns any issues found. Includes sequence-level validation plus comprehensive placeable validation. :::note[Note] Individual placeable.get_runtime_issues() calls already include their editor issues, preventing duplication while ensuring complete coverage. Returns: Array of validation issue descriptions, empty if no issues found :::

addons/grid_building/placeables/placeable_sequence.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.