Rusted Warfare Mod Workshop
All coursesCreative tools中文

Split a skill into reusable actions

Organize logic with named action calls and avoid cycles and duplicate effects

Keep entry actions focused

The recon firing event calls record, which calls increment, the example is deliberately small so you can see how multiple entry points can share the same underlying behavior

[turret_main]
onShoot_triggerActions: record

[hiddenAction_record]
alsoTriggerAction: increment

[hiddenAction_increment]
setUnitMemory: shots=memory.shots + 1

Reference action suffixes

alsoTriggerAction uses increment while the target section is hiddenAction_increment, names such as consumeEnergy, applyMode and reportState make a growing project easier to maintain

Do not treat INI line order as program order

The game processes configuration fields by their own rules, moving a line upward does not establish execution order, split dependent steps into actions and verify the actual result

Sketch the call graph

Draw the chain as fire → record → increment and make sure increment does not call back into record, the report button should read shots without increasing it

[action_report]
text: 查看射击统计 / Shot report
buildSpeed: 0
showMessageToPlayer: Shots: %{memory.shots}

Try it yourself

Add a separate test button and verify that one invocation increments exactly once

Open interactive lesson and download the companion mod