Jump to content

How do I make a mod RO compatible


Sampa

Recommended Posts

So, I am presently working on resurrecting a couple old mods and planning a new one out.  I was wondering... since the focus of the mods will be compatibility in RSS/RO, what kind of things would I need to look to do to make them compatible?  Is it cfg file "trickery"? And if possible, please teach me how to do this... I am very new to it and want to give the mods the best chance possible.

Edited by Sampa
Link to comment
Share on other sites

41 minutes ago, Sampa said:

the focus of the mods will be compatibility in RSS/RO, what kind of things would I need to look to do to make them compatible?

I assume by this you mean that you would be making parts, and that by default they would have stock-friendly properties, but if RealismOverhaul is installed, there would be some scaling or other alterations to make them fit a real size solar system. Please correct me if I'm mistaken about any of that.

41 minutes ago, Sampa said:

Is it cfg file "trickery"?

Yes, probably a lot of that; you can take a look at what RealismOverhaul itself does at its GitHub repository:

https://github.com/KSP-RO/RealismOverhaul/tree/master/GameData/RealismOverhaul/Parts

There are some important differences to note: since those files are part of RO whereas your mod is not, when those files say :FOR[RealismOverhaul], your mod would do :NEEDS[RealismOverhaul] instead (:FOR[] indicates that your mod is the given identifier, not that it depends on it, so definitely only do that with your own mod's name). Any config nodes tagged in that way would only be activated when RealismOverhaul is installed. For example:

PART
{
	name = MyPart
	// Default stock stuff here
}

@PART[MyPart]:NEEDS[RealismOverhaul]
{
	// RO stuff here
}
Link to comment
Share on other sites

alright....  That makes sense.  and yes, the mods, part mods, are going to primarily be set up for RSS/RO, but I intend to later provide full compatibility with stock Kerbin...  sort of an opposite direction, but it is mostly coming from a position of, most supporting stuff for the mods are only really available for RSS/RO... so, best to make that the primary.  hopefully I can create a set of support stuff to make it standalone fully, with compatibility in both ends...

Link to comment
Share on other sites

On 8/26/2022 at 6:00 PM, Sampa said:

alright....  That makes sense.  and yes, the mods, part mods, are going to primarily be set up for RSS/RO, but I intend to later provide full compatibility with stock Kerbin...  sort of an opposite direction, but it is mostly coming from a position of, most supporting stuff for the mods are only really available for RSS/RO... so, best to make that the primary.  hopefully I can create a set of support stuff to make it standalone fully, with compatibility in both ends...

To go the other direction (i.e., scale in the .cfg only if RO is not installed), you simply need to add '!' before RealismOverhaul in NEEDS. That will allow the changes to only execute if RO isn't present. So taking HebaruSan's example above:

@PART[MyPart]:NEEDS[!RealismOverhaul]
{
	// Stock scaling stuff here
}

You can learn more about ModuleManager dependency checking, patch ordering, etc here: https://github.com/sarbian/ModuleManager/wiki

Edited by Zelda
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...