Safe undocking / jumping . . . Written for AP. Not tested with TC.
Ever since Reunion came out, there have been certain ships that would explode when the player manually undocked them from certain stations.
This only got worse with TC and AP, since more and bigger ships and stations entered service.
I fixed it.
What this script does:
If the playership manually undocks from anything or enters a new sector by any means, it's collision detection is disabled.
Collisions are reenabled if any of these conditions is true:
- autopilot is enabled
- ship's speed is reduced
- ship's course is changed (10° dead zone for the benefit of joystick users)
- ship is clear of the closest ship, station, gate, and asteroid.
(these 4 objects are searched for once, at the moment of launch)
- the player changes ships
- the player goes to a different sector or docks somewhere
- 60 seconds expire
Not only does this fix the typical issue of undocking a Khaak Corvette from a Kyoto or many stations, it also avoids other stupid situations.
If you emerge from a gate in a TM and immediately launch in a fighter, you are usually catapulted straight into the gate superstructure. This can no longer happen since gates are one of the 4 types of checked navigational hazards.
If you emerge from a gate and find yourself inside another ship, don't panic and don't touch anything. Strafe (that is not a course change) or accelerate away.
The inspiration for this script was this. I just didn't agree with the way they did it. =P
Installation: extract the ZIP into the "X3 Terran Conflict" folder. The correct folder structure is already included.
Resources used: none