Commander McLane wrote:I need to immediately launch the player ship from a certain station after he has docked, without giving him any choice. This is because he isn't supposed to be able to dock with the station in the first place, but there is no scripting way to prevent that from happening.
If the carrier doesn't need to
dock Thargoids again once it's launched them, a potential hack is to make the docking bay visible on the outside a fake, and then have a long fake docking tube running the inside of the carrier (the coding is easier if this tube and the fake docking bay are both aligned to the carrier's z-axis, but this isn't entirely necessary if you're willing to mess with quaternions a little)
Then you can use
this.stationLaunchedShip()
in the carrier script to immediately reposition any launching ships so that they look like they've just launched from the fake docking bay.
If the carrier
does need to dock Thargoids, while the player might be watching, it gets harder, but it's doable if you write your own dockingAI for the Thargoids - navigate them to a stop within the fake docking bay, and then reposition them to the real one. I suggest you have two fake docking bays in this case - one for launch, and one for landing - or you may notice a few traffic control problems.
(The much easier option is instead of
player.ship.launch()
to call
player.ship.explode()
on the principle of "serves you right for trying something so phenomenally stupid", of course; if you could prevent docking then running into something carrier-sized would generally do that anyway)