EscortAI

From Elite Wiki
Revision as of 01:12, 24 January 2006 by Arexack (talk | contribs)

This is a five-state machine.

Used states:

  • FLYING_ESCORT: ->BEGIN_BUSINESS, ->LOOK_FOR_BUSINESS
  • BEGIN_BUSINESS: ->CLEAR_STATION, ->LOOK_FOR_BUSINESS
  • CLEAR_STATION: -> LOOK_FOR_BUSINESS, ->FLYING_ESCORT
  • LOOK_FOR_BUSINESS: ->BEGIN_BUSINESS, ->FLYING_ESCORT
  • GLOBAL: -> BEGIN_BUSINESS

Refered to AI's: interceptAI.plist, route1patrolAI.plist


{
   "FLYING_ESCORT" = {
       ENTER = (performEscort); 
       "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: interceptAI.plist"); 
       RESTARTED = ("setStateTo: BEGIN_BUSINESS");
       ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);
       "INCOMING_MISSILE" = ("messageMother: INCOMING_MISSILE"); 
       "ATTACKED" = ("messageMother: ATTACKED"); 
       "NOT_ESCORTING" = ("setStateTo: LOOK_FOR_BUSINESS"); 
       "TARGET_LOST" = ("setStateTo: LOOK_FOR_BUSINESS"); 
       "TARGET_DESTROYED" = ("setStateTo: LOOK_FOR_BUSINESS"); 
       EXIT = ();
       UPDATE = (escortCheckMother, "pauseAI: 15");     }; 
   "BEGIN_BUSINESS" = {
       ATTACKED = (setTargetToPrimaryAggressor, "setAITo: interceptAI.plist");
       ENTER = (escortCheckMother); 
       EXIT = ();
       ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);
       "NOT_ESCORTING" = ("setStateTo: LOOK_FOR_BUSINESS");
       "LAUNCHED_OKAY" = ("setStateTo: CLEAR_STATION");
       UPDATE = ();     }; 
   "CLEAR_STATION" = {
       ENTER = (setTargetToStation, "setDesiredRangeTo: 5000.0", "setSpeedFactorTo: 0.5", performFlyToRangeFromDestination);
       "DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS");
       UPDATE = (scanForFormationLeader, "pauseAI: 15.0"); 
       "TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort); 
       ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");
       EXIT = ();    }; 
   "LOOK_FOR_BUSINESS" = {
       ATTACKED = (setTargetToPrimaryAggressor, "setAITo: interceptAI.plist");
       RESTARTED = ("setStateTo: BEGIN_BUSINESS");
       ENTER = ("setSpeedTo: 0.0", performIdle); 
       EXIT = ();
       ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");
       "TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort); 
       "NOTHING_FOUND" = ("setStateMachine: route1patrolAI.plist"); 
       UPDATE = (scanForFormationLeader, "pauseAI: 15.0");     }; 
   GLOBAL = {
       ENTER = ("setStateTo: BEGIN_BUSINESS"); 
       EXIT = (); 
       UPDATE = (); }; 
}

BACK