AI Flags

From Starsector Wiki
Jump to navigation Jump to search

This page is for modding Starsector regarding information on the vanilla ship AI Flags system. If you are not modding Starsector you do not need to know any of this to play the game.

Flags

Flags are a mechanism for ships to provide external information. This can be used by other ship's AI or by various scripts to achieve more nuanced behaviour, such as ship system AI scripts. A full list of AI Flags can be found in the API here

Alex has not released official documentation of these flags--the following are based on observing them in-game.

BACK_OFF

When reading AI flags, seems redundant with BACKING_OFF. Can be set from outside the AI to force it to back off when it otherwise wouldn't.

BACKING_OFF

Set while first backing away from a target due to high flux until flux is low enough to re-engage.

DO_NOT_PURSUE

Set while at a safe distance but still waiting for flux to go down before re-engaging.

DO_NOT_USE_SHIELDS

Set while backing off and temporarily safe from danger.

MANEUVER_TARGET

Has a CombatEntityAPI custom data, typically the ship engaged.

NEEDS_HELP

Set when a ship is in danger (overmatched, fluxed out, overloaded, etc.). Presumably primarily checked by other ships (e.g. triggering the behavior of support fighters to move forward and take shots for the ship).

OK_TO_CANCEL_SYSTEM_USE_TO_VENT

Set by the system AI to tell the ship AI whether it can vent while the system is active. (Tentatively confirmed by Alex on the forum.)

PURSUING

Pursuing is set whenever the AI is looking to engage and is further away than its desired range. It seems to refer to a high-level goal--it stays set even when the AI is moving away from the target to counter fighters/missiles.

SAFE_FROM_DANGER_TIME

Has a customData float indicating (presumably) the length of time the ship is safe from danger. This can be over-optimistic, e.g. ignoring the possibility that an enemy targeting a different ship might switch targets. It is also not set when there are no visible enemies.

SAFE_VENT

Frequently toggled out of combat; unknown purpose.

Icon cross.png
At least two versions out of date. Last verified for version 0.9. Please refer to Version History and update this page.


Return to: Modding