@ [skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = If the command is to 'return' information. If a variable is used, this command will return a FLET_ responce.
<RefObj> = The 'Object' that the command is to be run on. 'Valid' objects must be a 'Ship'.
<Var/Ship> = The target that you want followed.
<Var/Number> = The distance to be maintained between follower and followed as an integer.
Causes the ship to follow the target object, launching first if it is landed/docked.
Where as escort ship is intended for use in formation flying and making one ship protect another, this instruction is mostly used to cause a ship to get up close to something as a prelude to something else - often an attack.
The autopilot will attempt to get the ship within <Var/Number> metres of the target object.
Like the escort ship instruction, this one is almost impossible to terminate. Executing a countervailing "fly command" instruction in another process will not cause this instruction to break. It is possible to get control of the ship back from this instruction with a script in a different process by using a set follow mode [FALSE] instruction, but that will not cause the original follow object instruction to return. Only the destruction of the target object, its removal to another sector, or the termination or interruption of the script running this instruction will stop it. Be very careful about using this instruction to make a ship follow a faster ship. In most cases, it is highly recommended to use the follow object ... timeout= <Var/Number> instruction instead.
Returns;
FLRET_TARGETREACHED upon success.
FLRET_INTERRUPTED if the script executing this instruction is interrupted.
FLRET_BREAK if the target is invalid or if the target is destroyed or moves to another sector.
FLRET_INVALIDPARMS if <RefObj> is invalid.
Example:
@ $follow.return = $ship -> follow object $target with precision 5000 m
The ship $ship should fly to a position 5000 m from the target $target and stay at this range. This would put $ship within firing range of some long range weapons if it was being used as part of an attack run on $target.
Command Location:
- »» Fly Commands
@ <RetVar/IF><RefObj> follow object <Var/Ship> with precision <Var/Number> m