The flight phases of an airship.
When the airship is loaded from RTSim data there is no โcurrent approach
indexโ, so the โResetโ phases are used to get the airship back on the route.
The non-โResetโ phases are used for the normal flight loop.
Get the target position for airship movement given the target position, the
default height above terrain, and the height above terrain for the airship
route cruise phase. This samples terrain points aound the target pos to get
the maximum terrain altitude in a 200 block radius of the target position
(only checking 4 cardinal directions). and returns the input approach_pos
with z equal to the maximum terrain alt + height or the default_alt
whichever is greater.
Called from pilot_airship to move the airship along phases of the route
and for initial routing after server startup. The bulk of this action
is collision-avoidance monitoring. The frequency of the collision-avoidance
tests is controlled by the radar_interval parameter.
The collision-avoidance logic has the ability to change the airshipโs speed
and to hold position.
The NPC is the airship captain. This action defines the flight loop for the
airship. The captain NPC is autonomous and will fly the airship along the
assigned route. The routes are established and assigned to the captain NPCs
when the world is generated.
Calculates how to resume a route. Called when the server starts up.
The airship will be at the approach final point, and this function
just needs to figure out to which approach index that correlates.
Returns the index of the approach to resume on.