How it works for the player:
When a station has been assigned an external dock, the player only needs to approach the indicated point directly, and slow to less than 100m/s. When the player is close enough, the docking sequence will be initiated.
If the OXP doesn't do anything to change the behaviour, when the player launches from the station, it will be from the external port they landed at.
How it works for the developer:
There are a couple of steps to getting the system to work.
1. Have some sort of visual clue for the player about where the external dock is. Flashers are the obvious choice, and a set of flashers can be found in the effectdata.plist file of this OXP (they are currently commented out).
2. Make sure it will be possible for the player to reach the external dock at less than 100m/s. That might seem like an odd instruction, but it will be critical if your carrier/station is either (a) rotating or (b) moving. Docking head on with a moving landing pad will be tricky. Ideally, external docking ports should only be added to stationary ships.
3. Add the following code somewhere in your station spawning script.
Code: Select all
var eds = worldScripts.ExternalDockSystem;
eds.$addExternalDock({
station:my_station,
position:[2400, 0, 0],
preDockCallback:this.$preDockSetup.bind(this),
preDockCallback:this.$postDockSetup.bind(this)
});
Code: Select all
station:ship, // The station to which you are attaching an external port
position:[x,y,z] // The x, y and z coordinates for the docking port, relative to the centre of your station
scale:1, // To change the size of the docking port (1 = no change; 0.5 = half size; 2 = double size; etc). Default is 1.
allowLaunch:true, // Indicates whether ships that dock at the external port should launch through it as well. Default is false.
launchSubEntityIndex:5 // If launches will be conducted through the external port, this specifies the index of the subentity that will be used to work out
// the orientation the player ship will have on launch
preDockCallback, // The function to call just before the player is docked at the station (and prior to all docking-related world events)
postDockCallback // The function to call just after the player is docked at the station (after shipWillDockWithStation but before shipDockedWithStation)
Re: changing the size of the docking port. By default, EDS will notify the player of excess speed when they are within 2000m of the dock port. If that distance is too great, such that it would conflict with other functions of the station, changing the size property will scale the distance as required. So, a value of 0.5 would reduce the distance of the point to 1000m.
See "Space Bar Face Lift" or "Extra Rock Hermits" for a simple example of this in action. See the Nuit Station 2.0 for a more complex example, with 4 external docking ports.
You can download the mod from here: ExternalDockingSystem.oxz or from the manager.