Difference between revisions of "FallingShuttleAI"
From Elite Wiki
Eric Walch (talk | contribs) (script example from Oolite -> scripting page) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 18: | Line 18: | ||
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); | "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); | ||
EXIT = (); | EXIT = (); | ||
− | UPDATE = (); | + | UPDATE = (); }; |
− | |||
: | : | ||
"FLY_HOME" = { | "FLY_HOME" = { | ||
Line 29: | Line 28: | ||
ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); | ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); | ||
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); | "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); | ||
− | UPDATE = (checkCourseToDestination, "pauseAI: 10.0"); | + | UPDATE = (checkCourseToDestination, "pauseAI: 10.0"); }; |
− | |||
: | : | ||
GLOBAL = { | GLOBAL = { | ||
Line 39: | Line 37: | ||
'''[[AI|BACK]]''' | '''[[AI|BACK]]''' | ||
+ | |||
+ | |||
+ | [[Category:Oolite scripting]] |
Latest revision as of 12:12, 2 January 2011
Another version of a landingAI, this one just screams for help and flees when attacked. Fleeing requires course corrections afterwards, even the possibility of waypoints is covered.
Defined states:
- GLOBAL: ->FLY_HOME
- FLY_HOME: ->GO_TO_WAYPOINT, ->FLEE, (lands on planet)
- GO_TO_WAYPOINT: ->GLOBAL, ->FLEE
- FLEE: undefined ?
{ "GO_TO_WAYPOINT" = { ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination); "COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination); "WAYPOINT_SET" = ("setDesiredRangeTo: 50.0", checkCourseToDestination); "DESIRED_RANGE_ACHIEVED" = ("setStateTo: GLOBAL"); ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); EXIT = (); UPDATE = (); };
"FLY_HOME" = { ENTER = (setCourseToPlanet, checkCourseToDestination); "COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination); "WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT"); "DESIRED_RANGE_ACHIEVED" = (landOnPlanet); EXIT = (); ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); UPDATE = (checkCourseToDestination, "pauseAI: 10.0"); };
GLOBAL = { ENTER = ("setSpeedFactorTo: 0.25", "setStateTo: FLY_HOME"); EXIT = (); UPDATE = (); }; }