Skip to content

Class

SpendCostRuleBase

Generated GDScript class reference for GridPlacement.SpendCostRuleBase.

Status
Current
Version
v6.3.0
Source updated
2026-10-29
Generated on
2026-10-29

6.3. These pages document the 6.3 release, where placeable is now entry (what changed) and PlacementOwner is deprecated (migration). Still on 6.2? Your version's guides ship inside the plugin itself, under addons/grid_placement/guides/; the 6.2 URLs on this site now redirect to this series.

Base class for rules that spend a cost when something is placed. Use SpendByIdRule or SpendMaterialsRuleById instead of this class. Costs are keyed by id, such as &"gold" or &"wood". What the ids mean is up to your game: it supplies a provider (see PlacementCostProvider) that checks and removes amounts. If any cost cannot be paid in full, everything already taken is given back and placement fails.

Source: addons/grid_placement/placement/placement_rules/template_rules/spend_cost_rule_base.gd

Syntax

class SpendCostRuleBase extends PlacementRule

Members

NameKindSummary
costsPropertyWhat placing costs: each id mapped to an amount.
validate_placementMethod
applyMethod
tear_downMethod
get_setup_issuesMethod
get_missing_costsMethod