Jump to content

[0.90] LetThereBeLight! v1.3 - Warp to next sunrise [2015.04.06][RSS compatible]


Comma_dose

Recommended Posts

Adds a button to the toolbar that when pressed, will time warp to the next sunrise

LetThereBeLight-1424343444.5292532.png

Please break this mod and report any new found issues, bugs, and the like to GitHub, or alternatively on this thread.

Known issues

Download: KerbalStuff / GitHub

Source: GitHub

Licenced under MIT licence

Installation:

  1. Download
  2. Extract
  3. Put contents of GameData to your [KSP root]/GameData

v1.3

  • Warping to sunrise now available while on other planetary bodies!
  • Squashed a critical issue with the toolbar button.

v1.2

  • Added RSS compatibility
  • Re-squashed an issue where time warp will not stop after pressing the button after a scene change

v1.1

  • Maths updated to use vectors
  • Sunrise now position dependent
  • Squashed an issue where time warp will not stop after pressing the button after a scene change

v1.0

  • (Initial version)

This mod is something whipped quickly together after user /u/MaturinTheTurtle asked on the KSP subreddit if someone could write a mod that adds a "Time warp to sunrise" button to space center.

Edited by Comma_dose
Link update
Link to comment
Share on other sites

Awesome! Let me know if you need a hand figuring out the CB/orbit stuff.

I'll take you up on that offer right here and now, then. :)

I need a way to figure out the surface normal of the KSC in stock, or the selected launch site in RSS. The ideal way would be without any static geographical coordinates and with a minimal use of configs, most preferably none at all.

This normal should simplify the code down to a check of the cross product between the normal and the CB=>Kerbol vector.

Link to comment
Share on other sites

Find PQSCity of name "KSC"*, get its repositionRadial (Vector3). That is the normal from the planet's center out of the space center. When RSS changes launch location, it changes KSC's location, so that should always be valid.

You then need to pass that through Kerbin's transform to, err, transform that vector into worldspace, IIRC.

*you can dig through the KSCSwitcher.cs source in the RSS repo for how, you can either do Findall(), slow, or get it as a component of the pqs (which is pointed to by a member of the Kerbin CelestialBody, which you can get with index [1] of FlightGlobals.bodies)

Edited by NathanKell
Link to comment
Share on other sites

Find PQSCity of name "KSC"*, get its repositionRadial (Vector3). That is the normal from the planet's center out of the space center. When RSS changes launch location, it changes KSC's location, so that should always be valid.

You then need to pass that through Kerbin's transform to, err, transform that vector into worldspace, IIRC.

*you can dig through the KSCSwitcher.cs source in the RSS repo for how, you can either do Findall(), slow, or get it as a component of the pqs (which is pointed to by a member of the Kerbin CelestialBody, which you can get with index [1] of FlightGlobals.bodies)

You are a modsaver! I think I'll be able to work with this.

Link to comment
Share on other sites

LetThereBeLight! v1.1 is up

Changelog:

  • Squashed an issue where pressing the button after a scene change made time warp unstoppable and button unusable.
  • Calculations now use vectors instead of solar days.
  • KSC's position on Kerbin's surface is now taken into account

Edited by Comma_dose
Link to comment
Share on other sites

  • 1 month later...
Will there be support for the idea of being able to warp to night? (Mostly if we are recreating stuff exactly in RSS)

No promises, but I'll look into it sometime.

Technically that shouldn't be an issue. I just suck at making a working UI.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...