This page is meant to be a resource for information about creating mods for SimpleRockets 2. It is a work in progress so please bear with us as we continue adding additional content and refine the page.

With the 0.7.2 release, official mod support is finally here! The initial release of mod support focused primarily on the core modding framework, part creation, and some UI related modding. The goal is to continue to add additional support and features over time. The most notable thing we did not do for this release is planet modding. With the planet builder on the horizon, we held off on planet related modding for now since we are not yet sure how planet builder related changes would impact things. You are still welcome to experiment with it, but just be aware that things may change in the future.

Getting Started

Mod Tutorial: Getting Started
Mod Tutorial: Rocket Engines
Mod Tutorial: UI Basics
Mod Tutorial: Inspector Panels

FAQ

I am getting a ton of warnings/errors regarding 'Library\PackageCache\com.unity.textmeshpro'

Remove the TextMeshPro package from your project using Unity's Package Manager (Menu Bar -> Window -> Package Manager).

I am getting a ton of warnings/errors regarding 'Library\PackageCache\com.unity.ugui'

Remove the Unity UI package from your project using Unity's Package Manager (Menu Bar -> Window -> Package Manager).

What is up with all these assemblies in the mod tools? Should I only use the ModApi namespace?

When we first started SimpleRockets 2, we started with the same modding framework we used in SimplePlanes. All interaction with the game was done via a few SimplePlanes mod tools assemblies and more advanced mods needed to use lots of reflection to access anything in the core game assembly. During the development of SR2, a few Unity updates really opened the doors and allowed us to take things to the next level (while also simplifying implementaion). To give modders as much control as possible while avoiding painful reflection-based code, we have included most of the game's assemblies in the mod tools package for use by modders. Because of this, there was no longer a technical need for a modding API separated out into its own assembly, however we were way too far down this path when these changes were made, so it's here to stay. We recommend trying do most stuff via the ModApi namespace (may be more stable between updates), but if you want to do some advanced stuff, by all means, access whatever you need from wherever you need it.

Will the Steam Workshop be supported?

The game does not currently support the Steam Workshop but it is something that we are considering.

There is no API method/event to do what I want to do. Can you add it?

Maybe, please ask! We would love to help, but we can't always predict what you may want or need. Let us know what exactly you need and we can see what we can do to help.


Comments

  • Log in to leave a comment
  • Profile image

    @Mrmaraunet You might need to do a combination of the two. Some crafts that are loaded in the scene have not written their XML to file yet, so the LoadCraftXml method would throw an exception. You should probably attempt to use the craftNode.CraftScript property, and if it is null, then try loading XML via _flightState.LoadCraftXml (craftNode.NodeId);

    Completely untested, but it might work.

    3 months ago
  • Profile image
    9,229 Mrmaraunet

    Hi @AndrewGarrison, for one of my mod project I need to get a list of all the parts in every craft in the flight scene to find wich crafts have a specific part. I've tried many different things and asked Nathan for some help but nothing really worked. What do you think would be the best way to achieve that? I've tried to load each craft xml with

    craftXml = _flightState.LoadCraftXml (craftNode.NodeId);

    and then looping through each part

    foreach (XElement element in craftXml.Element ("Assembly").Element
    ("Parts").Elements ()) {

    but when I launched a craft this craft xml wouldn't load (image 1) I had to quit and resume the flight for it to work. Then I tried using

    foreach (PartData part in craftNode.CraftScript.Data.Assembly.Parts) {

    I think for this to work the craft has to be loaded but even then, loaded or not it just doesn't find the CraftScript or CraftData (image 2). I also tried to have some delay between the flight scene start and the time I try to access the parts but it doesn't change anything. Btw I find the craftnode with

    foreach (CraftNode craftNode in _flightState.CraftNodes) {

    Here are the scripts

    3 months ago
  • Profile image

    @pedro16797 OK

    4 months ago
  • Profile image

    @sujun you should upload it with the new method, uploading it in mod posts will soon be deprecated

    4 months ago
  • Profile image

    @pedro16797 Yes, I know, but uploading my solar system works to the mod post requires the sr2-mod file

    4 months ago
  • Profile image

    @sujun solar systems don't work like that, they're stored internally in GameData/CelestialDatabase and in UserData/CelestialDatabase for custom systems you're making

    4 months ago
  • Profile image

    how to turn a solarsystem.xml into a sr2_mod file

    4 months ago
  • Profile image

    How are you able to update data/text? Such as I have multiple variables containing data about the craft. The problem is that they dont update. I tried a while loop and a IEnumerator in which none of them worked. How can I get it to update? It is being used in Text Models. Sorry for all the questions im just stuck on this one.

    11 months ago
  • Profile image

    The tutorials have to be updated to prompt people to use unity 2019.2

    +1 11 months ago
  • Profile image
    3,358 McDuetchVan

    @AndrewGarrison thank you so much!

    11 months ago
  • Profile image

    @McDuetchVan You could check the fuelSource.FuelType.Id to just add to certain fuel types. Check the Propulsion.xml for fuel type IDs.

    11 months ago
  • Profile image
    3,358 McDuetchVan

    @AndrewGarrison so would that work if I just pasted it into the parts script? Also how would I be able to just add certain fuels? Sorry for all the questions.

    11 months ago
  • Profile image

    @McDuetchVan Something like this should do the trick:

    foreach (var fuelSource in this.CraftScript.FuelSources.FuelSources)
    {
        fuelSource.AddFuel(100);
        fuelSource.RemoveFuel(100);
    }

    +1 11 months ago
  • Profile image
    3,358 McDuetchVan

    Is there a function I could use to add/subtract from a crafts fuel in a parts script? Im sorta new to this so any advice will help.

    11 months ago
  • Profile image
    100 JoshuaW

    My most wanted feature of SR2/SP modding:
    Custom I/O channels (in other words more spare input channels) for existing parts !

    For example, vanilla rotators can only be controlled by existing game inputs (pitch, roll, trim etc), when I want to control it with a custom variable, either one of the existing channels should be occupied, either I have to make a new rotator by my own, which is super complex and brings tons of problems.

    Plz plz help me with this, just add like 16 more "trim"s with different names, shouldn't be a huge challenge.

    1.1 years ago
  • Profile image

    @Mrmaraunet ICraftScript.FlightData has a bunch of stuff related to velocity and altitude. Game.Instance.FlightScene.CraftNode.CraftScript.FlightData I think is how you would go about accessing that stuff in a script.

    +1 1.2 years ago
  • Profile image
    9,229 Mrmaraunet

    also is there a script/function to get infos on the craft like speed/height?

    1.2 years ago
  • Profile image
    9,229 Mrmaraunet

    @AnotherFireFox I would like to know too

    1.2 years ago
  • Profile image

    @MorrissetteAirplaneCo yes

    1.2 years ago
  • Profile image

    @NathanMikeska mm... i think im gonna reinstall

    1.2 years ago
  • Profile image

    Since you seem like online, how can I place a thrust vector or whatever-you-call-it to tell the engine to where it should thrust?

    1.2 years ago
  • Profile image

    @SuperCracket Are you building on Windows but didn't install MacOS build components when installing Unity? You need both Windows and MacOS build components installed to build a release version of your mod, but you should be able to successfully build a debug version. Is that the issue you are seeing or is it something different?

    1.2 years ago
  • Profile image

    @AnotherFireFox Ive done it so i removed it some error just kinda happened

    1.2 years ago
  • Profile image

    @NathanMikeska Im pretty new at Mod support.
    I was following all steps when an error happened.
    Number 7 did not happen meaning there's no such folders and somewhere it says that my version does not support it meaning it will fail or error to load.What im using is Unity 2018.3.8f1 and it says i should use that version although im using it.Was it part of that?or i just need to install Mac Support something showed like that so i can make mods on windows.btw the Mod failed to load.any help would be appreciated.

    1.2 years ago
  • Profile image

    @SuperCracket step 6 is the easiest above all. If you can't find SimpleRockets tab in menu bar, you haven't imported modtool properly.

    1.2 years ago
  • Log in to see more comments

33 Upvotes

Log in in to upvote this post.
33.5k XxxNico420xxX
8,490 AnotherFireFox
34 Gabepasc
Mod SupremeDorian
Mod Mod
Dev pedro16797
6,487 Exospaceman
100 Roswell
1,499 KitKart
31.3k KellyNyanbinary
555 InConstantStagnation
Dev HellFireKoder
495 swope
4,507 ZetaFox
9,229 Mrmaraunet
960 QarabinaKa
240 ActionStations
3,081 Renamed71220
225 Fressabr
Dev WNP78
13.7k Rafaele
1,802 AN2Felllla
6,454 Yoon
10 SuperCracket
9,720 KraZIvan
296 JVGG
34.6k InfinityTechnology
857 deusalgor
75 talhahtaco
Dev PhilipTarpley
3,358 McDuetchVan
4,258 IcePing