RisingShuttleAI
From Elite Wiki
This script describes the behaviour of shuttles taking off from planet-side and docking with station.
Defined states:
- GLOBAL: →LIFT_OFF
- LIFT_OFF: →GO_TO_STATION, →FLEE
- GO_TO_STATION: →GO_TO_WAYPOINT, , →FLEE
- GO_TO_WAYPOINT: →GO_TO_STATION, →FLEE
- FLEE: →GLOBAL, →FLEE
Refered to AI's: dockingAI.plist
{ "GO_TO_WAYPOINT" = { ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination); "COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination); "WAYPOINT_SET" = ("setDesiredRangeTo: 50.0", checkCourseToDestination); "DESIRED_RANGE_ACHIEVED" = ("setStateTo: GO_TO_STATION"); ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); EXIT = (); UPDATE = (); };
"GO_TO_STATION" = { ENTER = (setTargetToStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination); "COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination); "WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT"); "DESIRED_RANGE_ACHIEVED" = ("setAITo: dockingAI.plist"); EXIT = (); ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); UPDATE = (); };
"LIFT_OFF" = { ENTER = (setTakeOffFromPlanet, "setSpeedFactorTo: 1.0", performFlyToRangeFromDestination); "DESIRED_RANGE_ACHIEVED" = ("setStateTo: GO_TO_STATION"); ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage, "setStateTo: FLEE"); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); EXIT = (); UPDATE = (); };
FLEE = { "TARGET_LOST" = (performIdle, "setStateTo: GLOBAL"); ENTER = ("setDesiredRangeTo: 25600", performFlee); EXIT = (); "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE"); "REACHED_SAFETY" = ("setSpeedTo: 0.0", performIdle, "pauseAI: 30.0"); UPDATE = (); };
GLOBAL = { ENTER = ("setSpeedTo: 0.0", "setStateTo: LIFT_OFF"); EXIT = (); UPDATE = (); }; }