Skip to content

Class

SpendMaterialsRuleById

Generated GDScript class reference for GridPlacement.SpendMaterialsRuleById.

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.

Spends a cost from an inventory node found in the scene tree. Set costs and a locator that finds the inventory under the player that owns the placement. To pass the inventory in from code instead, use SpendByIdRule. The same ids are used for refunds (see BuildCost).

The inventory node needs these methods:
• get_count_by_id(id: StringName) -> int
• try_remove_by_id(id: StringName, amount: int) -> int
• try_add_by_id(id: StringName, amount: int) -> int (used to give items back)

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

Syntax

class SpendMaterialsRuleById extends SpendCostRuleBase

Members

NameKindSummary
locatorPropertyFinds the inventory node to spend from, under the player that owns the placement.
get_setup_issuesMethod
requires_placerMethod
setupMethod
tear_downMethod