Confused Stations...
Moderators: winston, another_commander
- Mauiby de Fug
- ---- E L I T E ----
- Posts: 847
- Joined: Tue Sep 07, 2010 2:23 pm
- Cmd. Cheyd
- ---- E L I T E ----
- Posts: 934
- Joined: Tue Dec 16, 2008 2:52 pm
- Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...
I use the following in my script that requires similar logic:
The this.systemDone is a Boolean I set when I have determined I've done everything in the system I need to, so I don't repeat doing it on subsequent launches within the same system.
Code: Select all
if (this.systemDone || system.isInterstellarSpace || system.sun.hasGoneNova) return;
Find my OXP's at:
Deep Horizon Industries - Your Planet Our Design
Deep Horizon Industries - Your Planet Our Design
Code: Select all
if(system.isInterstellarSpace || system.sun.isGoingNova || system.sun.hasGoneNova || !this.firstLaunch)
Interstellar space is the only time when the "system" won't have a sun, so implicitly you have a check that there is a sun. The other two confirm that the sun isn't in a Nova state (either in the process of doing so or has finished doing so). The last one of course is the first launch check.
On the first launch though, what I find simpler is to have a snippet using the this.shipWillLaunchFromStation function which as its final action deletes itself (with the stations added via this.shipWillExitWitchspace for every other situation).
This works well, as if it's a save-game you know you will be launching from a main station (as that's the only place you can save) and once you have launched once, then the system is all set up and ready (and that code section is never needed again as for all other systems you will enter them from witchspace).
Last edited by Thargoid on Sun Nov 21, 2010 7:11 pm, edited 1 time in total.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
JS will still see the sun as there, but as a nova sun. If system.sun doesn't exist then system.sun.hasGoneNova doesn't make sense, as it's a property of it (and will generate a JS error).Switeck wrote:Still wouldn't !system.sun basically be true for both system.isInterstellarSpace and system.sun.hasGoneNova ?
If !system.sun is true, then there's nothing for the script to be testing for being nova or not iyswim.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
No, SA just moves you to the main station to save (you still can't save anywhere other than the main station in Oolite, SA just cheats it in the same way that PF cheats for planetary landings).Switeck wrote:Might that interfere with save anywhere OXP, which saves the game at OXP stations?Thargoid wrote:This works well, as if it's a save-game you know you will be launching from a main station (as that's the only place you can save)
So when you do that you'll generate your system in exactly the same way.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link