Friend or Foe/AI sendScriptMessage functions

From Elite Wiki
Revision as of 04:22, 25 November 2012 by Tricky (talk | contribs) (Descriptions and examples added.)

This is a list of all script messages that can be used with the AI of a ship.

$fof_alterDockEscorts

This alters the docking AI to the Friend or Foe OXP aware docking AI for escorts of the calling ship after a dockEscorts AI command has been issued. Send the message before dockEscorts is called.

Example:

 "AEGIS_IN_DOCKING_RANGE" = ("sendScriptMessage: $fof_alterDockEscorts", dockEscorts);

$fof_checkTargetIsValid

Checks the current target of the calling ship to make sure it is still valid.

Example:

 UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_checkTargetIsValid");

TARGET_LOST is returned to the calling ship AI if the current target is lost or becomes invalid.

$fof_performAttackTarget

This does something similar to a mix between the deployEscorts and groupAttackTarget AI commands.

Example:

 "MISSILE_INCOMING" = (setTargetToPrimaryAggressor, "sendScriptMessage: $fof_performAttackTarget");

FOF_ATTACK_TARGET is returned to the calling ship AI. A selection of ships in the same group as the calling ship will have their target set to the current target and their AI will also receive FOF_ATTACK_TARGET.

A small bounty will also be placed on the target if the calling ship has the role of station or police.

$fof_scanForAttackers

Scan for current ships or players from the past that have attacked the calling ship. Also scan for potential attackers.

Example:

 UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_scanForAttackers");

Reacts with an ATTACKERS_FOUND AI message if there are attackers near the calling ship. Otherwise ATTACKERS_NOT_FOUND is returned to the calling ship AI.

$fof_scanForCascadeWeapon

Scan for cascade weapons near the calling ship. This will allow older versions of Oolite to react to cascade weapons.

Example:

 UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_scanForCascadeWeapon");

Reacts with a CASCADE_WEAPON_FOUND AI message rather than CASCADE_WEAPON_DETECTED which is used by Oolite v1.77 and newer.