Whitecat106 Posted April 20, 2016 Share Posted April 20, 2016 (edited) Hello everyone, Whitecat again; so here's a really annoying issue I have discovered. Basically I have been building a Solar Cycle Simulating plugin for my Orbital Decay mod, everything is going fine, data is being loaded from a config file into a config node and subsequently manipulated and saved again. However, my program relies on knowing the total elapsed time in the game to determine the position along the 11 year solar cycle. This is required on each scene transition and works for every transition except for one. When loading the SpaceCenter screen from the Main Menu for the first time, the function Planetarium.GetUniversalTime() returns a number from 0.0 - 0.2, irrespective of the current game duration; (for example, my testing scenario is currently at year 52, so the number of seconds since the save beginning should be around 506912827 seconds and not 0.2). In any other transition, for example, from the TrackingStation to the SpaceCenter, the function works fine and returns the correct value (Being called in either the Awake() or Start() subroutines), but just not after the initial transition from the MainMenu... Any ideas on this one? Seems like a pretty big issue, I have replicated the problem by calling the function within the first 2 seconds of the scene being loaded and still no change. Furthermore I tried using the function of Planetarium.fetch.time and this returned a similar false number. Whitecat106 Edited April 20, 2016 by Whitecat106 Link to comment Share on other sites More sharing options...
Whitecat106 Posted April 20, 2016 Author Share Posted April 20, 2016 Okay everyone I discovered that Highlogic.CurrentGame.UniversalTime produces the proper time, it would appear Planetarium.GetUniversalTime() only works after the Planetarium has been initialized. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now