WeaponAutoTargetRules
< Modding | ComponentsModding/Components/WeaponAutoTargetRules
Jump to navigation
Jump to search
.rules
file/node location: Cosmoteer.Ships.Parts.Weapons.WeaponAutoTargetRules
Stores rules for how a weapon should auto-target.
Used by most (probably all) weapons.
Particularly important for point defense weapons.
Name | Type | Required? | Buffable? | Default value | Description |
---|---|---|---|---|---|
TargetType | WeaponTargetType | Yes | - | - | The type of targets the weapon can auto-target, with respect to the Toggle. |
BulletTargetCategories | ID<BulletTargetableRules>[]? | - | - | - | What kinds of projectile this weapon can shoot down.
Used only by |
Toggle | ID<PartComponentRules>? | - | - | - | If this is On, the auto-targeting is enabled, else it isn't.
Usually set to |
Overridable | bool | - | - | false
(effectively) |
Function unclear.
Point defense weapons have "true". |
EnableInDirectControlMode | bool | - | - | - | Presumably, if On, the weapon will still auto-target when direct control is enabled.[clarification needed][1] |
Notes
- Oddly enough, fixed weapons put it in an
Autotarget{}
, while turreted weapons use anAutotargets[{}]
. Notice the[]
difference.
This may be just a coincidence (also, see below).
- The chaingun's
.rules
has 1Autotargets[{}]
and 2Autotarget{}
, despite having just 1 bullet emitter.
- In almost all weapons, the code is exactly either this ... :
AutoTarget
{
TargetType = ShipParts
Toggle = AutoTargetToggle
}
- ... or this :
AutoTargets
[
{
TargetType = ShipParts
Toggle = AutoTargetToggle
}
]
Point defense weapons
point_defense :
AutoTargets
[
{
TargetType = Bullets
BulletTargetCategories = [missile, mine, bullet]
Toggle = DefendToggle
}
{
TargetType = ShipParts
Toggle = AttackToggle
Overridable = true
}
]
flak_cannon_large :
AutoTargets
[
{
TargetType = Bullets
BulletTargetCategories = [missile, laser, bullet, mine]
Toggle = DefendToggle
}
{
TargetType = ShipParts
Toggle = AttackToggle
Overridable = true
}
]
- ↑ clarification needed: See the label for the context.