Jump to content

[1.1] Solar Cycle Simulator - (1.0.2) - Actually made it work... silly me!


Whitecat106

Recommended Posts

Solar Cycle Simulator (SCS)

Hello everyone! Whitecat here, creator of the Historic Missions contract pack, Orbital Decay plugin and the Boat Navigation Plugin. Here I present to you a small project which I required as an addon to my Orbital Decay mod.

 

This plugin simply generates and tracks the constantly changing solar cycles of the sun, this can be used in conjunction with RSS or a Stock game.

gIl0ITt.png

 

This however is more of a tool for modders than an actual plugin, installed on its own it will simply track and display information on the solar cycle in the Tracking Station, but together with some programming skills a mod maker could create accurate (realistic) solar flare, coronal mass ejection, solar storm or other interesting solar activity based plugins.

For Players:

Simply download the pack and install the GameData folder into your GameData directory; remember this does not add much appart from a small tracking station UI! (It is also a dependency of Orbital Decay).

Download:

 

Dropbox

 

For Mod Makers:

Download the pack from the link above and install into your GameData directory, remember that this pack will be a dependency of any mods you create using it, so ensure you provide a link to this page for the latest release. You can include the latest version of this plugin as a reference in your C# development project, from this you will be able to access the following functions: (limited at the moment I know, but bear with me and I will add some more!) The following can be retrievied by using for example:

SCSManager.FetchCurrentF107()

or

SCSManager.FetchCurrentAp()

 

Here are the available functions:

Spoiler

 public static double FetchCurrentF107()
        {
                string Temp = FetchCurrentCycle().GetValue("CurrentF107");
                double F107 = double.Parse(Temp);
                return F107;
        }

        public static double FetchCurrentAp()
        {
                double Ap = double.Parse(FetchCurrentCycle().GetValue("CurrentAp"));
                return Ap;
        }

        public static double FetchAverageF107()
        {
            double F107 = 0.0;
            double F1071 = double.Parse(FetchCurrentCycle().GetValue("MaxF107"));
            double F1072 = double.Parse(FetchCurrentCycle().GetValue("MinF107"));
            F107 = (F1071 + F1072) / 2;
            return F107;
        }

        public static double FetchAverageAp()
        {
            double Ap = 0.0;
            double Ap1 = double.Parse(FetchCurrentCycle().GetValue("MaxAp"));
            double Ap2 = double.Parse(FetchCurrentCycle().GetValue("MinAp"));
            Ap = (Ap1 + Ap2) / 2;
            return Ap;
        }

        public static double FetchCurrentIPMF()
        {
            double IPMF = double.Parse(FetchCurrentCycle().GetValue("CurrentIPMF"));
            return IPMF;
        }

        public static double FetchCurrentIrradiance()
        {
            double Irradiance = double.Parse(FetchCurrentCycle().GetValue("CurrentIrradiance"));
            return Irradiance;
        }

        public static double FetchCurrentSunSpots()
        {
            double SunSpots = double.Parse(FetchCurrentCycle().GetValue("CurrentSunSpots"));
            return SunSpots;
        }

 

Of course there are more Static functions in the code but these will require a little digging into the source but it should be relatively easy for anyone to find anything you are looking for!

As I said this is a little bare-bones at the moment, I will include more functions as time progresses and if anyone takes an interest in this small tool!

 

License:

This code is licensed under the Attribution-NonCommercial-ShareAlike 3.0 (CC BY-NC-SA 3.0) creative commons license.

Edited by Whitecat106
Link to comment
Share on other sites

Hmm. Very interesting. I't would be interesting if like a solar flare accured and all electrical systems on your ship would go down temporarely. Also a contract idea. Maybe when it happens you need to replace some module on space station? :)

Link to comment
Share on other sites

  • 1 month later...

@Whitecat106

Would you change the code so that the data.cfg file is saved and loaded from a plugindata folder within SCS. This allows MM to skip over the file and use the cache file to save time. Hope that makes sense. Thanks!

Link to comment
Share on other sites

16 hours ago, Svm420 said:

@Whitecat106

Would you change the code so that the data.cfg file is saved and loaded from a plugindata folder within SCS. This allows MM to skip over the file and use the cache file to save time. Hope that makes sense. Thanks!

Good idea!

I will be updating this plugin soon to try and fix some issues with RSS Date-Time formatter, I will rearrange the folder structure at the same time!

Whitecat106 :)

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...