Chris' Tutorials
Docs/Grid Placement

Class

BuildCost

Generated GDScript class reference for GridPlacement.BuildCost.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

Records what was spent to build a placed instance (5.1.0-D refund contract). Stamped onto the placed [Manipulatable]'s metadata under [constant META_KEY] at placement time (stamping is consumer-owned — see the integration guide), then read back by [Refunder] consumers at [signal ManipulationState.pre_demolish] time so refund logic has a canonical "what was paid" record. The canonical cost shape is keyed by [StringName] IDs, not [Resource] references: the consumer's inventory system owns the id -> Resource mapping.

Source: addons/grid_placement/resources/build_cost.gd

Syntax

class BuildCost extends Resource

Members

NameKindSummary
META_KEYFieldNamespaced meta-key for stamping onto a Manipulatable. Reference this constant rather than hardcoding the string to avoid collisions with consumer metadata. Underscore-namespaced because Object.set_meta only accepts valid ASCII identifiers (a ':' separator is rejected). Uses the "placement" prefix per the plugin's public naming convention.
entriesPropertyItem entries: Array[Dictionary] of {id: StringName, quantity: int}. Generic — the consumer maps each id to whatever their inventory system uses (Resource, item database, runtime registry, etc).
currencyPropertyNon-item currency: Dictionary keyed by StringName currency id with numeric amounts.
source_resourcePropertyReference back to the resource that produced this cost (e.g. the ScenePlacementEntry that defined it). Optional; informational only — refunders do not branch on this.
resolve_forMethod
rule_costProperty
search_rootProperty
instanceProperty
costsProperty
costProperty
from_costsMethod
costProperty
from_pairsMethod
costProperty
from_resource_stacksMethod
costProperty

Source

addons/grid_placement/resources/build_cost.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs