Difference between revisions of "ShuttleAI"
From Elite Wiki
m |
Eric Walch (talk | contribs) (script example from Oolite -> scripting page) |
||
Line 46: | Line 46: | ||
− | [[Category:Oolite]] |
+ | [[Category:Oolite scripting]] |
Latest revision as of 13:20, 2 January 2011
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 = (); }; }