Rusted Warfare Mod Workshop
All coursesCreative tools中文

Build units and share research resources

Connect construction menus, team resources and one-time upgrades

Place the building in the sandbox

The outpost uses isBuilding and footprint rectangles with movementType:NONE, place it from the sandbox first and add builder access after its own behavior works

[core]
isBuilding: true
footprint: -1,-1,1,1
constructionFootprint: -1,-1,1,1

[movement]
movementType: NONE
moveSpeed: 0

Use internal names in production menus

A canBuild name refers to the unit core.name rather than its display label, pos controls menu placement, start with the target unit cost and build time

[canBuild_rover]
name: rwa04Rover
pos: 1

Separate team resources from unit state

l04data is shared research data while upgraded belongs to one rover, the outpost converts 100 credits into one data and a rover spends it on an upgrade, do not address the resource as memory.l04data


[global_resource_l04data]
displayName: 研究数据 / Research Data
displayInHud: true

[action_research]
text: 记录数据 / Record data
price: credits=100
buildSpeed: 2s
addResources: l04data=1

Prevent repeated purchases on one rover

Use a lock message for the interface and an execution condition to check the state again, the turret reads upgraded afterward, verify that purchasing on one rover does not upgrade another

[action_upgrade]
text: 装填改良弹 / Improve ammunition
price: l04data=1
buildSpeed: 1s
isLocked: if memory.upgraded
isLockedMessage: 已完成改良 / Already upgraded
requireConditional: if not memory.upgraded
setUnitMemory: upgraded=true

Try it yourself

Raise the upgrade cost to two data and check insufficient-resource and already-upgraded states

Open interactive lesson and download the companion mod