CannonImp

Fleet Operations only.

May also be used in toggle mode. Requires an Ordnance file.

A CannonImp always obeys the Ordnance specialEnergyCost ODF command, regardless of Craft rangeScan - Weapon range mismatch.

The AI or special weapons autonomy will not use this weapon when resource costs are enabled for this weapon.

classlabel = "cannonimp"

Fleet Operations ODF Commands

targetTerrainOnly

Boolean, Default: FALSE

When set to true (1), the weapon fires only on an area, not on vessels directly. Has a similar function to targetLocation, but will not follow the target (target vessel identification is not saved).

shotDelayX

Float, Default: crash

cannonimp does not use the regular "shotDelay" (without number) ODF command. The original "shotDelay" command can be emulated by using only "shotDelay0". 

shotDelayX tells the cannon one of its shotdelays. The behavior for reloads goes something like this: fire weapon, wait for current shotdelay time (shotDelay0 by default), fire another shot, and wait for the next shotdelay time.

For example, it would wait for 0.1 seconds, then 0.1 more seconds, then 2 seconds: firing 3 shots in quick succession and then waiting 2 seconds). If there is no next shot, it will loop to the start (also see saveFireCyclePoint command for this weapon).

Example:shotdelay0 = 0.1
shotdelay1 = 0.1
shotdelay2 = 2

shotDelayX is affected by weapon "buffs" reducing reload times.

saveFireCyclePoint

Integer, Default: 0

This is set to a value that corresponds to a shotDelayX, which it should loop back to if in battle.

In the same weapon as the previous example, it would fire 3 shots upon going into battle then have a standard reload of 2 seconds thereafter.savefirecyclepoint = 2

Also see shotCycleResetTime command.

shotCycleResetTime

Float, Default: 0.0

Value in seconds. If the ship waits for this long out of battle, then the shotdelay is reset and starts from zero again. A custom saveFireCyclePoint will not reset if shotCycleResetTime is set to 0 (default).

If you had this command in the previous examples, then it would take 15 seconds to reset the shotdelay to normal.shotcycleresettime = 15

shotCycleResetTime is affected by weapon "buffs" reducing reload times.

baseTargets

Integer, Default: 1

This command is very similar to that being used by the AreaEffectCannon. This command indicates the maximum number of targets this weapon can fire on at once.

maxExtraTargets

Integer, Default: 0

This value defines how many extra targets can be randomly hit additional to baseTargets. If baseTargets = 2 and maxExtraTargets is set to 3, up to 5 targets could be hit. In the worst case, only 2 will be hit (as baseTargets). It is also possible to set baseTargets=0 and maxExtraTargets=1, which results in a 50:50 chance that the weapon triggers.

usePrimaryTarget

Boolean, Default: TRUE

If set to false (0) a weapon will not use a unit's designated target anymore by default (commanded with attack cursor), but instead finds targets independently from its owner. Of course, the target the weapon chooses may be the same as the unit's current selected target.

dilithiumCost

Float, Default: 0.0

Dilithium spent to use this weapon.

metalCost

Float, Default: 0.0

Metal spent to use this weapon.

crewCost

Integer, Default: 0

Crew spent to use this weapon.

latinumCost

Float, Default: 0.0

Tritanium / Latinum spent to use this weapon.

biomatterCost

Float, Default: 0.0

Supply / Biomatter spent to use this weapon.

targetLoop

Boolean, Default: FALSE

If set to true (1), the weapon tries to find a different target after each shot instead of firing at the best or nearest target. A vessel's primary target with usePrimaryTarget enabled is not affected.

targetSelf

Boolean, Default: FALSE

When set to true (1), the Craft shoots itself. This can be used to apply buffs or other effects to the owner.

Note, when configured as a special weapon (special = 1), some weapon classlabels require needTarget to be true in order not to crash when the AI / Special Weapons Autonomy activates them. See respective Ordnance classlabel pages for more information on which classes are not compatible.

Note that when configured as a regular weapon, the targetSelf weapon will fire when the owner attacks a target with its longest range normal weaponry, regardless of the designated range of the targetSelf weapon.

Note that a targetSelf weapon will be unable to fire if equipped with a restricted firing arc.

HardpointShift

Boolean, Default: FALSE

If set to true (1), the weapon tries to use different hardpoints with each shot. It will switch between the best and the second best hardpoint available (those closest and angled appropriately to the target). This currently will only work for weapons that are not setup as firing on an area only.

hitMode

This will not affect a vessel's primary target, but only targets choosen by the weapon.

pseudo code:
canHitTarget = hitMode and hitInvalid and hitCloaked (see hitInvalid, hitCloaked ODF commands)

Value Enum Behavior
0 HM_default Default Armada 2 Target selection. Ignores hitInvalid / hitCloaked. Default
1 HM_hitAll All enemies (except "invalid" or "ignored"), including cloaked enemies if revealed
2 HM_hitEnemiesNeutrals All non-allies
3 HM_hitFriendliesNeutrals All non-enemies
4 HM_hitEnemies  
5 HM_hitFriendlies  
6 HM_hitOwnerTeam There are no checks in case the vessel is under holoeffect etc

hitInvalid

Value Enum Default
0 HIM_donthit Note "ignored" or "neutral" targets are not "invalid"
1 HIM_hit  
2 HIM_hitonly Only "invalid" targets are hit!

hitCloaked

Value Enum Default
0 HCM_donthit  
1 HCM_hit Cloaked targets are hit even if not revealed
2 HCM_hitonly Only cloaked targets are hit!

alwaysDeductValues

Boolean, Default: FALSE

If set to true (1), when the weapon is fired costs / specialenergy / cooldown is deducted even if the weapon has not hit any targets.

autoTargetClosest

Boolean, Default: FALSE

When set to true (1), non-primary targets (those not determined by the human player's target choice) are chosen purely by the shortest distance to the owner's weapon hardpoint.

forceAudioVisual

Boolean, Default: FALSE

When set to true (1), weapon sound and effect is always displayed, even if the weapon hasn't hit a target.

Examples

Simple shot cycle

shotDelay0 = 6.0 //it takes 6 seconds after the first shot before the next shot can be fired
shotDelay1 = 5.0 //it takes 5 seconds after the second shot before the next shot can be fired (starts again at shotDelay0)

Shot cycle with reset time

If the vessel has not attacked an enemy for 3 seconds, the shot cycle starts at shotDelay0 when the vessel engages the next enemy.

shotCycleResetTime = 3.0
shotDelay0 = 4.0
shotDelay1 = 3
shotDelay2 = 2
shotDelay3 = 1

Save Fire

saveFireCyclePoint = 4
shotCycleResetTime = 6.0 //if the vessel doesn't attack a target for 6 seconds, the shotcycle continues at shotDelay0
shotDelay0 = 0.5 //that is..
shotDelay1 = 0.2 //the fully..
shotDelay2 = 0.2 //charged..
shotDelay3 = 0.2 //shot.
shotDelay4 = 3.0
shotDelay5 = 2.0
shotDelay6 = 3.0
shotDelay7 = 2.0 //if the end of the cycle is reached, the cycle continues at saveFireCyclePoint (shotDelay4)