Difference between revisions of "InterceptAI"
From Elite Wiki
m |
|||
Line 35: | Line 35: | ||
[[AI|BACK]] |
[[AI|BACK]] |
||
+ | |||
+ | |||
+ | [[Category:Oolite]] |
Revision as of 12:02, 12 July 2006
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 = (); }; }