ShuttleAI
From Elite Wiki
Revision as of 12:20, 2 January 2011 by Eric Walch (talk | contribs) (script example from Oolite -> scripting page)
An alternative landing protocol, unlike homeAIthis one will defend itself.
Used states:
- DEFEND_SELF: ->FLEE, ->TRAVEL_TO_PLANET
- EXIT_SYSTEM: performLanding (=exitAI+remove entity)
- FLEE: ->TRAVEL_TO_PLANET
- GLOBAL: ->TRAVEL_TO_PLANET
- TRAVEL_TO_PLANET: ->DEFEND_SELF, ->EXIT_SYSTEM
This is a standalone AI, that terminates with landing on planet.
{ "DEFEND_SELF" = { "ENERGY_LOW" = ("setStateTo: FLEE"); ENTER = (performAttack); EXIT = (); "TARGET_DESTROYED" = ("setStateTo: TRAVEL_TO_PLANET"); UPDATE = (); };
"EXIT_SYSTEM" = { ENTER = (performLanding); EXIT = (); UPDATE = (); };
FLEE = { ENTER = (performFlee); EXIT = (); "REACHED_SAFETY" = (performIdle, "setStateTo: TRAVEL_TO_PLANET"); UPDATE = (); };
GLOBAL = { ENTER = ("setStateTo: TRAVEL_TO_PLANET"); EXIT = (); UPDATE = (); };
"TRAVEL_TO_PLANET" = { ATTACK = (setTargetToPrimaryAggressor, "setStateTo: DEFEND_SELF"); ENTER = (performFlyToPlanet); EXIT = (); "REACHED_SURFACE" = ("setStateTo: EXIT_SYSTEM"); UPDATE = (); }; }