Difference between revisions of "ThargletAI"

From Elite Wiki
m
(script example from Oolite -> scripting page)
 
Line 38: Line 38:
 
[[AI|BACK]]
 
[[AI|BACK]]
  
[[Category:Oolite]]
+
[[Category:Oolite scripting]]

Latest revision as of 12:22, 2 January 2011

Defined States:

  • GLOBAL: ATTACK_SHIP
  • CHECK_FOR_CONTROL: CHECK_FOR_CONTROL, LOOK_FOR_TARGETS
  • LOOK_FOR_TARGETS: CHECK_FOR_CONTROL, ATTACK_SHIP
  • ATTACK_SHIP: CHECK_FOR_CONTROL


{
   "ATTACK_SHIP" = {
       ENTER = (performAttack); 
       "THARGOID_DESTROYED" = ("setStateTo: CHECK_FOR_CONTROL"); 
       "TARGET_DESTROYED" = ("setStateTo: CHECK_FOR_CONTROL"); 
       "TARGET_LOST" = ("setStateTo: CHECK_FOR_CONTROL"); 
       UPDATE = (scanForThargoid, "pauseAI: 5.0"); 
       "NOTHING_FOUND" = ("setStateTo: CHECK_FOR_CONTROL"); 
       EXIT = ();     }; 
   "CHECK_FOR_CONTROL" = {
       "THARGOID_DESTROYED" = ("setStateTo: CHECK_FOR_CONTROL"); 
       "TARGET_FOUND" = ("setStateTo: LOOK_FOR_TARGETS"); 
       ENTER = ("setSpeedTo: 0.0", performTumble);
       EXIT = ();
       UPDATE = (scanForThargoid, "pauseAI: 1.0");	}; 
   "LOOK_FOR_TARGETS" = {
       "THARGOID_DESTROYED" = ("setStateTo: CHECK_FOR_CONTROL"); 
       "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
       ENTER = (scanForNonThargoid, "pauseAI: 1.0");
       EXIT = ();
       UPDATE = (scanForNonThargoid, "pauseAI: 10.0");	}; 
   GLOBAL = {
       ENTER = ("setStateTo: ATTACK_SHIP"); 
       EXIT = (); 
       UPDATE = (); }; 
}

BACK