cim wrote:We could then have a discussion over whether you should be allowed to call that function if there already was a main station.
The answer is yes. If the answer were no, it would just force script writers to explode stations unnecessarily. No need for any more discussion.[/quote]
True. I was missing the obvious there...
Okay, now for the complications in implementing it caused by the current special properties of main stations. (These are all problems right now, but if it's an obscure event that no-one ever sees they can mostly be ignored, whereas they probably do need some sort of fixing if setMainStation is actually a supported activity)
Some of these could probably be less urgent to address if setMainStation could only be called if the player wasn't docked at either the old or new main station.
- save games only at main station
Mostly these are for the OXPer to work around to make sure that the main station is changed again (by system.info or by scripting) after the save game is reloaded, and that the player ends up inside it. Well, it might be better to remove this restriction so that the player can save anywhere without needing Save Anywhere, but that is not at all straightforward, and mostly a separate problem.
- export penalty checks are only applied at the main station
Trivial to work-around with OXPs, unless you wanted the new main station not to apply those checks, in which case still possible but potentially messy. Perhaps this could be solved by making "apply_export_penalties" or similar a shipdata property, and setting it on the core game's stations?*
That would be more flexible for many things, and it could default to false.
- non-main stations will give docking clearance to Fugitives
Will look a bit silly if you give a pirate cove main station status, but otherwise probably harmless. Better handling of docks and docking has been requested elsewhere anyway, so it's not really a "main station" issue as such.
- cargo/passenger contracts are only fulfilled at the main station
- lots of OXP mission screens only run at the main station
Fine, just dock at the new one. Everything then just works, I think.
- buy new ships only at main station
- cargo/passenger contracts can only be picked up at the main station
I can see there being a real mess if setMainStation is called while the player is on the F8 F8 or the F3 F3 screen, especially with the GUI code being as arcane as it is... Nicest solution might be to allow cargo/passenger contracts/ships to be picked up at other stations designated through shipdata.plist*
, and check that instead.
- F8 screen in flight shows main station market
Probably okay. Presumably the goods should stay where they are, rather than teleport to the new main station, which I think will require some minor internal tweaks before system.setMainStation can be written, but should be fine in general.
- some AIs (core and OXP) use the main station as a waypoint.
...and some of them mean it, and some of them really mean "a station near the planet". Should be safe to unpick which is which, though it might be a bit of work for OXPers, and might need some extra AI commands.
- COMPASS_TARGET_STATION expects the main station to be near the planet
Wait, we've been here before... Making it visible from anywhere in the system is the "easy" fix, but looks a bit odd with the N beacon if people haven't been messing with the main stations. If we're making it easy to non-destructively cycle main stations, we can't just say "Well, it's a calamity, and the compass being odd is probably the least of your worries right now", which is the current state of the code. Possibly it could be changed to show COMPASS_TARGET_STATION if you're no more than X% further away from the planet than the main station is? That matches current behaviour in a default system, at least once I've looked up 'X', and does something reasonably sensible with other main station locations. (Perhaps have the current distance of 3 planetary radii as a minimum, too, for ones closer to the planet than normal)
- Other stuff I haven't thought of that's tied to the main station
This is probably going to be a problem...
Of course, changing properties in shipdata.plist causes problems with shipset OXPs which will redefine the entity back to what it was before, at least until they're updated. Is it worth doing this if - for instance - it subtly breaks the DeepSpace Ships OXP? Probably can be worked around so it's compatible both ways, but that needs to be done carefully.
Kaks wrote:- since a huge amount of code is based on the concept of there being at most 1 main station, setting a new mainStation will have to 'demote' the previous one.
Yep. On the other hand, looking at the above list, at least some of the things that are currently attached to the main station probably shouldn't be anyway. Being able to reassign the main station in a sensible (and supported) way is good, not having to reassign it just to get a contract market at the constore is also good.
Kaks wrote:Sounds like it's time for a poll!
Great! Diamond is in the current nightly builds for testing; have a look and decide you hate/love it after all...
Thargoid wrote:Just to throw another "idea" onto the table.
That one's been on my list of "vaguely thought-out but not started" OXPs ever since your Kiota stations were released. I think it's possible entirely in OXP code in 1.76... [/optimist]