Skip to content

Charges

Changed in 0.2.0

Makes a structure wind its turret animation up to full charge before the weapon will fire.

Specification
Applies to
WeaponType
File
rules.ini
Section
[<ObjectType ID>]
Value
boolean
When omitted
no

A structure with a Charges=yes weapon in its first weapon slot must charge its turret before it can fire. Each wind-up adds its time to the weapon’s reload delay.

rules.ini
[MyChargeLaser] ; example WeaponType
Charges=yes
IsLaser=yes
ROF=120

The flag works only on structures and only in the first weapon slot. A vehicle, infantry or aircraft with the weapon fires at once and pays only its ordinary reload.

The structure starts charging when all of these hold:

  • it has a target, and one of its weapons could fire at that target once the turret faced it;
  • its reload delay has run out;
  • the structure is switched on;
  • its house has full power, if its type is Powered=yes and draws power;
  • it is not still being built.

The weapon test in the first condition includes range, whether the weapon can hit an air or ground target, ion storms, and cloaking of the structure or its target. It ignores ammunition, so a structure with no rounds left still charges.

Charging plays the structure’s TurretAnim and the TeslaCharge sound. TurretChargeAnimRate sets how long the wind-up takes.

If the structure loses its target or is switched off, the turret discharges. It charges again from the start once the conditions return.

A turret keeps its charge through a power shortfall. A Powered=yes structure that draws power cannot fire during the shortfall, as power describes, and can fire the charge it holds once power returns.

Only an IsLaser=yes weapon spends the charge, and only when the structure fires its last round. A structure with the default unlimited Ammo counts every shot as its last, so it recharges before each shot. A structure with a stock of rounds keeps its charge until it fires the last one.

A charging weapon that is not a laser never spends its charge by firing. The structure winds up once, then fires at its ordinary reload rate for as long as it keeps its target.

History

  1. Changed0.2.0In development

    Keep charging defenses working through low power