however, I found that every time you launch then system.planets is rearranged.
example... i load a commander... no planets have been added
I write system.planets in the debug console and I get this
Code: Select all
[Planet ID: 143 position: (0, 0, 340600) type: PLANET_TYPE_GREEN radius: 34.060km]
Code: Select all
[Planet ID: 143 position: (0, 0, 340600) type: PLANET_TYPE_GREEN radius: 34.060km],[Planet ID: 193 position: (23511.5, -97614.9, 406344) type: PLANET_TYPE_GREEN radius: 9.000km],[Planet ID: 192 position: (-64386.9, 52011, 270741) type: PLANET_TYPE_GREEN radius: 7.000km],[Planet ID: 194 position: (65069.1, 9371.3, 244347) type: PLANET_TYPE_GREEN radius: 8.000km],[Planet ID: 195 position: (0, 0, -4.91e+007) type: PLANET_TYPE_GREEN radius: 90.000km]
I then enter my jumpgate, and my script moves planets and moons around, so that everything stays inside the stable precision coordinate system..
then on the other side of the jumpgate, i again type system.planets
and i get this...
Code: Select all
[Planet ID: 195 position: (0, 0, 900000) type: PLANET_TYPE_GREEN radius: 90.000km],[Planet ID: 194 position: (65069.1, 9371.3, 5.02443e+007) type: PLANET_TYPE_GREEN radius: 8.000km],[Planet ID: 192 position: (-64386.9, 52011, 5.02707e+007) type: PLANET_TYPE_GREEN radius: 7.000km],[Planet ID: 143 position: (0, 0, 5.03406e+007) type: PLANET_TYPE_GREEN radius: 34.060km],[Planet ID: 193 position: (23511.5, -97614.9, 5.04063e+007) type: PLANET_TYPE_GREEN radius: 9.000km]
The only possible reason for this is that, the code recontructs system.planets on every launch event... and when planets have been moved around, these are not any longer in the original order. this is cosmetics, but not logical. That elements of an array will get a new place in the array, according to some set distance measurement to either the sun, or the witch point...
I find it a bit wasted CPU time,that the code reconstruct system.planets every time the player is launched, so a few cycles could maybe be saved here...
Of course with my limited insight to the scripting engine, something like this may be needed for some to me unimaginable reason...
There might be other arrays that are reconstructed on every launch event, like system.allShips, all though I have not tested that yet, but from a scripters point of view, I think at least system.planets order, should stay static, and of course expand by 1 every time a new planet/moon is added, and not rearrange its order at any time.
Luckly i had build my own array, and set that to the system.planets array, on the very first launch, and its order stays static. imagine the trouble I would have had with an array, that had a dynamic order...
Cheers Frame....