Jump to content

Module manager exampels


maculator
 Share

Recommended Posts

I should have clarified a bit better. I was able to find documentation that explained usageReqMaskInternal but was unable to properly implement it. I have more or less done the same thing you have, except I just straight up added the Mystery Goo experiment to the 1-3 pod as opposed to implementing it as an upgrade. In any event, I get the following error when trying to activate the experiment from the pod using usageReqMaskInternal = 8

sW2gdwQ.png

If I use something like usageReqMaskInternal = 8, 4 or usageReqMaskInternal = 4, 8 the game seems to ignore the '8' because I can activate the experiment using a non Scientist, which is not what I want to happen, nor what I would expect from the above information. I'm gussing maybe that the game sees the pod as the goo canister or something and doesn't expect the experiment to be run from inside it self. Or something. I'd like to be able to 'specify where' in order to alleviate the above error.

Cheers,

Link to comment
Share on other sites

20 hours ago, Stratickus said:

If I use something like usageReqMaskInternal = 8, 4 or usageReqMaskInternal = 4, 8 the game seems to ignore the '8' because I can activate the experiment using a non Scientist, which is not what I want to happen, nor what I would expect from the above information. I'm gussing maybe that the game sees the pod as the goo canister or something and doesn't expect the experiment to be run from inside it self. Or something. I'd like to be able to 'specify where' in order to alleviate the above error.

you need to use

usageReqMaskInternal = 12   //(4+8)
usageReqMaskExternal = -1

 

Link to comment
Share on other sites

14 minutes ago, nascarlaser1 said:

how does one create a MM patch? Do I need to edit preexisting files or just make a new one?

It's too much to explain in a single post. Basically you create a new cfg to tell module manager what other cfgs to target and edit.

This is the best place to look to figure out MM

https://github.com/sarbian/ModuleManager/wiki

Link to comment
Share on other sites

  • 2 weeks later...
6 hours ago, Stratickus said:

I might have missed it, but does anyone have an example of increasing/decreasing something by a percentage?

Such as increasing the cost of a part by 10% or reducing its mass by 25% etc.

Cheers,

 

With math:

 @PART[*]
  {
    @mass *= 0.25
    @maxTemp -= 500
    @scale += 2
  }

 

Link to comment
Share on other sites

  • 2 months later...

I'm not sure if this is possible via MM, but I figured if it was, someone here would know how to do it.

I have added the various stock MODULE[ModuleEnviroSensor] to the Mk1 Command pod. I would like to edit the interface of the command pod via MM to make it more user friendly and change the Sensor Display buttons to read "Toggle Temperature Display, Toggle Pressure Display" etc. instead of the confusing multiple "Toggle Display."

Spoiler

1JWsQPI.png

I have looked at KSP documentation and tried out a few different patches, but none were successful.  https://kerbalspaceprogram.com/api/class_module_enviro_sensor.html

I'm not sure if a plugin is required to edit the part interface window.

Cheers,

Link to comment
Share on other sites

On 10.3.2016 at 6:38 AM, SingABrightSong said:

Stock repeatable experiments set to full transmission efficiency

@PART[sensorAccelerometer]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[sensorGravimeter]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[sensorBarometer]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[sensorThermometer]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[InfraredTelescope]:NEEDS[AsteroidDay]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}

Hardcoded for the stock "envirosensor" experiments(plus the official AsteroidDay telescope, if present), I figure that this makes unmanned craft more viable, while still limiting the materials bay and goo pod to recovery on Kerbin. While it makes sense to have to recover physical objects to evaluate them, there is no reason to require the physical thermometer to evaluate the temperature I actually thought of several reasons while typing this, but none of them apply in KSP :sticktongue:

Just stumbled upon this and wanted to make it mod/multipart-friendly. (other words: the experiment itself is adressed, not the parent-part)

here's the outcome:

@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[gravityScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[seismicScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[temperatureScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[barometerScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}

}
@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[temperatureScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}
@PART[*]:HAS[@MODULE[*]:HAS[#experimentID[barometerScan]]]
{
	@MODULE[ModuleScienceExperiment]
	{
		@xmitDataScalar = 1.0
	}
}

 

Edited by Speadge
asteroidDay
Link to comment
Share on other sites

OK a quick question:

I want to modify the flow mode setting of the stock fuel cell parts (both of them from "stage flow" to "stack search". A quick read through this thread makes me think the following might work...

Spoiler

@PART[FuelCell*]

{

    @MODULE[ModuleResourceConverter]

    {

        @[INPUT_*]

        {

            %FlowMode = STACK_PRIORITY_SEARCH

        }

    }

}

I'm going to test it anyway, but if anyone can find obvious errors then I would appreciate any constructive feedback. It's been 32 years since I last coded - jeeze! But that's no excuse :wink:

Thanks in a advance!

Link to comment
Share on other sites

  • 4 months later...

Hey there I was wondering if anyone could help me with an MM mod for Interstellar

The new version of Interstellar changes the Refinery process of Water Electrolysis to produce LqdHydrogen + LqdOxygen. I just wanna edit it to give LiquidFuel + Oxidizer
I looked at the .cfg files for the parts but apparently, the part uses a .cs script to do the conversion.
 

Thanks in advance!

Link to comment
Share on other sites

  • 1 month later...

MM patch to change the default settings of any part that has the BD Armory AI Module:

Spoiler

@PART[*]:HAS[@MODULE[BDModulePilotAI]]:NEEDS[BDArmory]:FINAL
{
    %MODULE[BDModulePilotAI]
    {
    %isEnabled = True
    %pilotEnabled = False
    %defaultAltitude = 2000
    %minAltitude = 500
    %steerMult = 8
    %pitchKiAdjust = 0
    %maxSteer = 1
    %steerDamping = 3
    %maxSpeed = 800
    %takeOffSpeed = 90
    %minSpeed = 80
    %idleSpeed = 120
    %maxAllowedGForce = 18
    %maxAllowedAoA = 45
    standbyMode = False
    }    
}

        //Default values for comparison
        
        //isEnabled = True
        //pilotEnabled = False
        //defaultAltitude = 1500
        //minAltitude = 500
        //steerMult = 6
        //pitchKiAdjust = 5
        //maxSteer = 1
        //steerDamping = 3
        //maxSpeed = 325
        //takeOffSpeed = 70
        //minSpeed = 60
        //idleSpeed = 120
        //maxAllowedGForce = 10
        //maxAllowedAoA = 35
        //standbyMode = False

 

Link to comment
Share on other sites

  • 2 weeks later...

Is there a way to use MM to set a variable based on the current throttle position? I want to have the minThrust get set to 0 when the throttle is also at zero. The reason is that I am working on an MM config to set limited throttle depth on the liquid engines. The problem is that having a none-zero minThrust messes with betterburntime. Shutting the engines down is the way that I would use to stop a burn, but having the engine in the shutdown-state means that betterburntime will not look at it. Here is a sample of my MM script so far:

 

@PART[liquidEngine]
{
	@description ^= :(.)$:$0 Shallow throttle, minimum thrust down to 80% of maxThrust.:
	@MODULE[ModuleEngines*]
	{
		@minThrust = #$maxThrust$
		@minThrust *= 0.8
	}
}

EDIT: Another possible solution is if it were possible to create an action for engines that sets minThrust to zero as a toggle, which could then be used instead of an action group for shutting down the engines. Anyone know if we can create action groups like that with MM?

EDIT2: Another possibility is if it were possible to create a statement that says "IF the throttle position is bellow 80% THEN set maxThrust = 0" 

Edited by Errol
Link to comment
Share on other sites

  • 4 weeks later...

I seem to be having some issues with the HAS condition on a patch I'm writing for the USI Life Support mod. My goal is to get all command pods that have a crew capacity to have a base level of supplies. Ideally this should increase depending on how large the crew capacity is and not affect non-command pods (ie Science Lab, Hitchhiker Storage Container). I'm trying to write it with two different HAS conditions, but it only uses the first one and ignores the second. Does anyone have any ideas how I can get this to meet both conditions before applying the modification to resources?

This affects all command pods including unmanned pods:

Spoiler

@PART[*]:HAS[@MODULE[ModuleCommand]]:HAS[#CrewCapacity[2]]:NEEDS[USILifeSupport]:Final

{
    %RESOURCE[Supplies]
    {
        %amount = 172.8
        %maxAmount = 172.8
    }
    %RESOURCE[Mulch]
    {
        %amount = 0
        %maxAmount = 172.8
    }
}

 

This affects anything with a crew capacity of 2, including the Science Lab:

Spoiler

@PART[*]:HAS[#CrewCapacity[2]]:HAS[@MODULE[ModuleCommand]]:NEEDS[USILifeSupport]:Final
{
    %RESOURCE[Supplies]
    {
        %amount = 172.8
        %maxAmount = 172.8
    }
    %RESOURCE[Mulch]
    {
        %amount = 0
        %maxAmount = 172.8
    }
}

 

Link to comment
Share on other sites

@aquist I'd say the first one initially filters for anything with ModuleCommand and then of those any with CrewCapacity=2.

The second filters for the reverse case CrewCapacity then ModuleCommand.

If you want to target both try this:

@PART[*]:HAS[@MODULE[ModuleCommand]&#CrewCapacity[2]]:NEEDS[USILifeSupport]:FINAL

Link to comment
Share on other sites

  • 1 month later...
On 16.01.2016 at 2:40 PM, Warzouz said:

Full throttle on the launchpad

  Reveal hidden contents

@PHYSICSGLOBALS
{
   prelaunchDefaultThrottle = 1
}

 

What about SAS, light, Presize control (CapsLock) on the launchpad using MM?

Link to comment
Share on other sites

  • 3 weeks later...

Default all fairings to 2 sides, clamshell, 400 ejection force

Spoiler

@PART[*]:HAS[@MODULE[ModuleProceduralFairing]]:FINAL
{
    @MODULE[ModuleProceduralFairing]
    {
        %nArcs = 2
        %ejectionForce = 400
        %useClamshell = True
    }
}

 

Link to comment
Share on other sites

  • 2 years later...

If you want to select just probes, use this header:

@PART[*]:HAS[@MODULE[ModuleCommand],#CrewCapacity[0]]

If you want to select command modules (manned):

@PART[*]:HAS[@MODULE[ModuleCommand],#CrewCapacity[>0]]

There's also an alternate way to filter for probes, via:

vesselType = Probe

 

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.

 Share

×
×
  • Create New...