Difference between revisions of "Friend or Foe/AI sendScriptMessage functions"

From Elite Wiki
(Initial stub - Details to follow.)
 
m (Retagged!)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is a list of all script messages that can be used with the AI of a ship.
+
This is a list of all <code>sendScriptMessage</code> functions that can be used with the AI of a ship.
  
'''$fof_addTargetAsDefenseTarget'''
+
==== <code>$fof_alterDockEscorts</code> ====
  Add the target as a defense target. Won't be needed when v1.78 comes out.
+
In standard Oolite, escorts will be unlinked from the mothership and assigned a standard docking AI. This will alter the docking AI to the [[Friend_or_Foe|Friend or Foe]] OXP aware docking AI for the ex-escorts of the calling ship after a <code>dockEscorts</code> AI command has been issued. Send the message before <code>dockEscorts</code> is called.
  
'''$fof_alterDockEscorts'''
+
Example:
  This alters the docking AI for escorts after a dockEscorts AI command has been issued.
+
  <code>"AEGIS_IN_DOCKING_RANGE" = ("sendScriptMessage: $fof_alterDockEscorts", dockEscorts);</code>
  
'''$fof_checkTargetIsValid'''
+
==== <code>$fof_checkTargetIsValid</code> ====
  Checks the current target to make sure it is still valid.
+
Checks the current target of the calling ship to make sure it is still valid.
  
'''$fof_clearDefenseTargets'''
+
Example:
   Clears all defense targets. Won't be needed when v1.78 comes out.
+
   <code>UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_checkTargetIsValid");</code>
 +
<code>TARGET_LOST</code> is returned to the calling ship AI if the current target is lost or becomes invalid.
  
'''$fof_findNewDefenseTarget'''
+
==== <code>$fof_performAttackTarget</code> ====
  Find a new defense target. Won't be needed when v1.78 comes out.
+
This does something similar to a mix between the deployEscorts and groupAttackTarget AI commands.
  
'''$fof_performAttackTarget'''
+
Example:
  This does something similar to a mix between the deployEscorts and groupAttackTarget AI commands.
+
  <code>"MISSILE_INCOMING" = (setTargetToPrimaryAggressor, "sendScriptMessage: $fof_performAttackTarget");</code>
 +
<code>FOF_ATTACK_TARGET</code> 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 <code>FOF_ATTACK_TARGET</code>.
  
'''$fof_recallStoredTarget'''
+
==== <code>$fof_scanForAttackers</code> ====
  Recall the stored target. Won't be needed when v1.78 comes out.
+
Scan for current ships or players from the past that have attacked the calling ship. Also scan for potential attackers.
  
'''$fof_scanForAttackers'''
+
Example:
  Check for any previous attackers that have run away.
+
  <code>UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_scanForAttackers");</code>
 +
Reacts with an <code>ATTACKERS_FOUND</code> AI message if there are attackers near the calling ship. Otherwise <code>ATTACKERS_NOT_FOUND</code> is returned to the calling ship AI.
  
'''$fof_scanForCascadeWeapon'''
+
==== <code>$fof_scanForCascadeWeapon</code> ====
  Scan for cascade weapons. Won't be needed when v1.78 comes out.
+
Scan for cascade weapons near the calling ship. This will allow versions of Oolite older than v1.77 to react to cascade weapons.
  
'''$fof_setJinkPosition'''
+
Example:
   Set jink postion. Won't be needed when v1.78 comes out.
+
   <code>UPDATE = ("pauseAI: 10.0", "sendScriptMessage: $fof_scanForCascadeWeapon");</code>
 +
Reacts with a <code>CASCADE_WEAPON_FOUND</code> AI message rather than <code>CASCADE_WEAPON_DETECTED</code> which is used by Oolite v1.77 and newer.
  
'''$fof_storeTarget'''
+
----
  Store the current target. Won't be needed when v1.78 comes out.
+
[[Category:OXP API's]]

Latest revision as of 13:43, 20 September 2023

This is a list of all sendScriptMessage functions that can be used with the AI of a ship.

$fof_alterDockEscorts

In standard Oolite, escorts will be unlinked from the mothership and assigned a standard docking AI. This will alter the docking AI to the Friend or Foe OXP aware docking AI for the ex-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.

$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 versions of Oolite older than v1.77 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.