As some of you may know, I have been trying to work out how to make the Taiidan Republic platforms link together in a reliable way. The current solution is far from ideal. This thread is to chart my re-write of the linking scripts with (hopefully) community input.
- Platforms that link together in a ring of three
- Platforms that are already deployed cannot move to link with another platform
- Once platforms are linked, they cannot move
- The player should not be allowed to do anything silly:
a) It should not be possible to command a platforms to link with a platform that is already “full” of neighbours
b) It should not be possible to command two platforms to link with the same target platform
- The linking process should not disrupt the game by cancelling orders or resetting things:
a) Any fighters docking/docked/launching from a platform should not be affected by the linking operation
b) The health/targets/attackers/guarders of the platforms should not be affected by the linking operation
- When a linked platform is destroyed, its neighbours should become available for linking again
- Linked platforms should have health/functionality bonuses for being linked
The current solution
The current solution uses the vanilla docking function managed through customcode. When created, platforms can dock and be docked with. As soon as a platform docks, its “parent” is swapped for an identical HOD with no dockpaths, to prevent it being docked with again. This only happens on docking, so it does not prevent a player from order multiple platforms to dock with the same target. Nor does it prevent commands to dock with the moving platform, which confuses things (or maybe it should be possible)… On docking, the “child” platform is swapped with an identical HOD that is “immovable”, so it stays put and does not drift away from its parent.
The problems are:
- No management of docking commands - it is always possible to dock with a “booked” platform until the moment of docking. This is because it is impossible to know the target of a ship that is docking until it has docked.
- Spurious bugs when docking lead to misalignments.
- Health/targets/attackers are not retained due to HOD-swapping (although this could be worked in by logging the health/targets/attackers and re-applying them after HOD-swap)
- Use the “form hyperspace gate” command to link the platforms. This command would momentarily link the platforms as hyperspace gates (to pair them). The script would then remove the ability to hyperspace, and order the platform to dock.
- A custom command with its own icon - I’m not even sure if this is possible…