Skip to content

Making an IVA that works both with and without RasterPropMonitor

Eugene Medvedev edited this page Jun 30, 2014 · 3 revisions

At times, you might want to supply your part in two versions -- one that makes use of RasterPropMonitor modules to create a populated IVA, and one that does not. There is a neat way to do this using ModuleManager in a completely automatic fashion:

Create two internal.cfg files -- one for IVA using only stock props, and one for IVA using RasterPropMonitor. You can keep both in the same directory, (The time when config files absolutely had to be called 'internal.cfg' and 'part.cfg' went away around KSP 0.20.) which will make them implicitly reference the same model file, or you can use the MODEL {} node to reference the model from another directory, it makes no difference. An extra internal configuration will not consume a significant amount of memory, though whatever props you bundle, of course, will.

Then, create a ModuleManager patch like this and bundle it together with everything else:

 @PART[NameOfMyPod]:NEEDS[RasterPropMonitor]
 {
     @INTERNAL
     {
         @name = NameOfRPMSpecificInternal
     }
     MODULE
     {
         name = RasterPropMonitorComputer
     }
 }

This will neatly slot the RPM-specific internal in place of the one you make the default if RasterPropMonitor is installed, and remain inactive if it isn't. Since RasterPropMonitor already comes bundled with ModuleManager, and won't work properly without it anyway, you don't have to bundle it either.