ToggleWeapon

Allows the weapon to be turned on or off with a button (one click to turn on, one click to turn off). Note that if the weapon is toggled off while an ordnance (like a torpedo) is en route to its target, the ordnance will be removed before hitting.

Does not respect targetAlliedCraft, targetAlliedBuildings, targetEnemyCraft, targetEnemyBuildings (these are always considered true).

Does not use hitChance (never misses) ODF command.

classlabel = "toggleweapon"

Stock ODF Commands

needTarget

Boolean, Default: FALSE

If set to true (1), the weapon needs a target (either an area or a specific unit) before it can fire and will display the appropriate cursor when hovered over a valid target. Wave-type weapons for instance might not need a target in order to be triggered successfully. Note that this ODF command is listed a second time due to its different gameplay effect:

If configured as a special weapon (special = 1), when needTarget = 0 the weapon will be self-targeting (ordnance will hit the owner GameObject). The game may crash if the weapon is activated by the AI / Special Weapons Autonomy. See respective Ordnance classlabel pages for more information on which classes are not compatible.