Rusted Warfare Mod Workshop
All coursesCreative tools中文

Keep weapon modes and target roles consistent

Combine alternate projectiles, mode memory and ground or air filters

Inspect both unit and turret permissions

attack defines targets the vehicle can consider and turret_main can further restrict the weapon, the anti-air variant changes both layers so they agree

[attack]
canAttack: true
canAttackFlyingUnits: true
canAttackLandUnits: false
canAttackUnderwaterUnits: false

[turret_main]
canAttackFlyingUnits: true
canAttackLandUnits: false
canAttackUnderwaterUnits: false

Choose a projectile from remembered state

Normal and focused shots use the same gun, altProjectileCondition reads the mode and selects focused when true, otherwise normal, this fits changes that need a new projectile without duplicating the gun

[turret_main]
x: 0
y: 0
projectile: normal
altProjectile: focused
altProjectileCondition: memory.focused

[projectile_normal]
directDamage: 20
life: 1.8s
speed: 4

[projectile_focused]
directDamage: 34
life: 1.8s
speed: 5

Pair the benefit with a cost

Stabilization raises damage while reducing movement speed, cruise restores both state and speed, isLocked informs the player and requireConditional checks the state again when the action executes

[action_focus]
text: 稳定射击 / Stabilize
buildSpeed: 0
isLocked: if memory.focused
requireConditional: if not memory.focused
setUnitMemory: focused=true
setUnitStats: movespeed=0.35

[action_cruise]
text: 恢复巡航 / Resume cruise
buildSpeed: 0
isLocked: if not memory.focused
requireConditional: if memory.focused
setUnitMemory: focused=false
setUnitStats: movespeed=0.85

Compare projectiles before judging the whole unit

Compare both modes at the same distance against the same target, then inspect movement speed and finally use the anti-air variant against an air target, keep other conditions stable when comparing

Try it yourself

Reduce focused damage to 30 and describe how you would adjust its movement tradeoff

Open interactive lesson and download the companion mod