InterceptAI

From Elite Wiki
Revision as of 01:19, 24 January 2006 by Arexack (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A three-state machine, designed for interception and combat, will exit afterwards. Used mainly by policevipers (hence the reference to lights), but also by other attacking AI-scripts, such as the escortAI.

Used states:

  • ATTACK_SHIP: ->FLEE
  • FLEE: ->ATTACK_SHIP
  • GLOBAL: ->ATTACK_SHIP

No references to other AI's, will exit after completion.

{
   "ATTACK_SHIP" = {
       "ENERGY_LOW" = ("setStateTo: FLEE"); 
       ENTER = (performAttack); 
       EXIT = (); 
       "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); 
       "TARGET_DESTROYED" = (switchLightsOff, exitAI); 
       "TARGET_LOST" = (switchLightsOff, exitAI); 
       UPDATE = ();     };
   FLEE = {
       "ENERGY_FULL" = ("setStateTo: ATTACK_SHIP"); 
       "TARGET_LOST" = (switchLightsOff, exitAI); 
       "TARGET_DESTROYED" = (switchLightsOff, exitAI); 
       ENTER = ("setDesiredRangeTo: 25600", performFlee); 
       EXIT = (); 
       "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); 
       UPDATE = ();     }; 
   GLOBAL = {
       ENTER = (switchLightsOn, "setStateTo: ATTACK_SHIP"); 
       EXIT = (); 
       UPDATE = (); }; 
}

BACK