event name
.when
....< (this is a logical)
.........500 (or whatever amount you want)
.........Distance (this is under status)
.............Alpha 1
.............Ship X
....send message
.........whoever
.........high
.........RTB
then chain this to it
event name
.....when
........is key depressed (training)
............alt-J
.....do nothing
in the second sexp write return to base as the directive text
If you are using SCP, and the ship you are aproaching has a fighter bay might i suggest this instead?
first, instead of a message telling the player to go to the ship, tell the polayer to go the fighter bay for recovery. then use the following:
....< (this is a logical)
.........500 (or whatever amount you want)
.........Distance to subsystem (this is under status)
.............Alpha 1
.............Ship X
....end mission (if you do not have this option as part of whichever SCP version you have, have the mission end in red alert, but don't make the next mission a red alert mission, it has the same effect)