Jump to content

[1.8.x-1.12.x] Module Manager 4.2.3 (July 03th 2023) - Fireworks season


sarbian

Recommended Posts

2 hours ago, blowfish said:

If it's in a .cfg file, and the contents change, then ModuleManager will re-apply every patch rather than using the cache.  If you're saving settings to a config file, it should be in a PluginData folder (and thus will be ignored by the game database and MM's caching)

Which is how caches work. It's not accurate to say that cache functionality is broken

Link to comment
Share on other sites

1 hour ago, Starwaster said:

Which is how caches work. It's not accurate to say that cache functionality is broken

I have clarified my original post, however I maintain that putting any settings in a cfg outside of PluginData is a bad idea, because it causes the cache to be invalidated when it shouldn't be.  In effect, it breaks a convenient, but not strictly necessary feature.

Edited by blowfish
Link to comment
Share on other sites

Is it possible to apply a MM patch when the crew capacity is greater than zero? So for instance, something like this:

@PART[*]:HAS[@MODULE[ModuleCommand],#CrewCapacity[>0],!RESOURCE[Snacks]]:FOR[Snacks]
{ ...}
 

If so, what would be the correct syntax? Thanks again for all your hard work @sarbian! :)

Link to comment
Share on other sites

What is the correct notation to modify values in a part that has multiple modules of the same name?
In this specific case I'm trying to tweak the afterburning turbojet (part turboJet ) which has multiple ModuleEnginesFX modules in it, one for "dry" one for "wet"

My MM attempt:

Spoiler

@PART[turboJet]
{
  @MODULE[ModuleEnginesFX]
    {
     @atmosphereCurve
      {
        @key = 0 4000 0 0
          }
    }
  @MODULE[ModuleEnginesFX]
    {
     @atmosphereCurve
      {
        @key = 0 1500 0 0
          }
    }
}

This ends up modding the "dry" mode twice. Not sure how to specify which patch goes to which module?

For ref: the relevant part of the engine's stock CFG:
 

Spoiler

 

MODULE
    {
        name = ModuleEnginesFX
        engineID = Dry
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 85
        heatProduction = 15
        useEngineResponseTime = True
        engineAccelerationSpeed = 0.5
        engineDecelerationSpeed = 0.5
        useVelocityCurve = False
        flameoutEffectName = flameout
        powerEffectName = power_dry
        //runningEffectName = running_thrust
        engageEffectName = engage
        disengageEffectName = disengage
        spoolEffectName = running_dry
        engineSpoolIdle = 0.05
        engineSpoolTime = 2.0
        EngineType = Turbine
        exhaustDamageMultiplier = 5
        clampPropReceived = True
        PROPELLANT
        {
            name = IntakeAir
            ignoreForIsp = True
            ratio = 40
        }
        PROPELLANT
        {
            name = LiquidFuel
            resourceFlowMode = STAGE_STACK_FLOW_BALANCE
            ratio = 1
            DrawGauge = True
        }
        atmosphereCurve
        {
            key = 0 9000 0 0
        }
        // Jet params
        atmChangeFlow = True
        useVelCurve = True
        useAtmCurve = True
        flowMultCap = 1.1
        machLimit = 1.75
        machHeatMult = 20.0
        velCurve
        {
            key = 0 1 0 0
            key = 0.35 0.932 0 0
            key = 1 1.13 0.4510796 0.4510796
            key = 1.75 1.5 0 0
            key = 2 1.38 -1.126258 -1.126258
            key = 2.5 0 0 0
        }
        atmCurve
        {
            key = 0 0 1.069445 0.7244952
            key = 0.072 0.08 1.472049 1.472049
            key = 0.17 0.21 1.227685 1.227685
            key = 0.34 0.39 1.01426 1.01426
            key = 1 1 0.969697 0.969697
        }
    }
    MODULE
    {
        name = ModuleEnginesFX
        engineID = Wet
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 130
        heatProduction = 75
        useEngineResponseTime = True
        engineAccelerationSpeed = 0.8
        engineDecelerationSpeed = 0.8
        useVelocityCurve = False
        flameoutEffectName = flameout
        //powerEffectName = running_wet
        runningEffectName = power_wet
        engageEffectName = engage
        disengageEffectName = disengage
        spoolEffectName = running_wet
        engineSpoolIdle = 0.05
        engineSpoolTime = 2.0
        EngineType = Turbine
        exhaustDamageMultiplier = 20
        clampPropReceived = True
        PROPELLANT
        {
            name = IntakeAir
            ignoreForIsp = True
            ratio = 12
        }
        PROPELLANT
        {
            name = LiquidFuel
            resourceFlowMode = STAGE_STACK_FLOW_BALANCE
            ratio = 1
            DrawGauge = True
        }
        atmosphereCurve
        {
            key = 0 4000 0 0
        }
        // Jet params
        atmChangeFlow = True
        useVelCurve = True
        useAtmCurve = True
        flowMultCap = 1.1
        machLimit = 1.75
        machHeatMult = 20.0

        velCurve
        {
            key = 0 1 0 0
            key = 0.18 0.97 0 0
            key = 0.43 1 0.202683 0.202683
            key = 1 1.42 1.280302 1.280302
            key = 2.5 3.63 0 0
            key = 3 0.58 -2.708558 -2.708558
            key = 3.35 0 -0.6150925 0
        }
        atmCurve
        {
            // less linear because AB has a big ram effect at high speed at high alt.
            key = 0 0 1.666667 1.666667
            key = 0.07066164 0.1397133 1.961396 1.961396
            key = 0.34 0.56 1.084002 1.084002
            key = 1 1 0.5302638 0.5302638
        }
    }


 

 

Any insight/advice?

Link to comment
Share on other sites

@PART[turboJet]
{
  @MODULE[ModuleEnginesFX]:HAS[#engineID[Dry]]
    {
     @atmosphereCurve
     {
        @key = 0 4000 0 0
     }
    }
  @MODULE[ModuleEnginesFX]:HAS[#engineID[Wet]]
  {
    @atmosphereCurve
    {
       @key = 0 1500 0 0
    }
  }
}

Alternatively you can use @MODULE[ModuleEnginesFX],0 for the first one, and @MODULE[ModuleEnginesFX],1 for the second.

Link to comment
Share on other sites

15 minutes ago, tjt said:

If I modify a MM config file, is there a quicker way to see the changes than quitting and reloading the entire game?

From the main menu or space center, Alt+F11 and click "Quick reload database" (the only thing that the normal "reload database" gives you in addition is re-rendering drag cubes, which you probably don't need)

Link to comment
Share on other sites

4 hours ago, blowfish said:

From the main menu or space center, Alt+F11 and click "Quick reload database" (the only thing that the normal "reload database" gives you in addition is re-rendering drag cubes, which you probably don't need)

Thanks! :) 

Link to comment
Share on other sites

4 hours ago, Warezcrawler said:

Is it possible to create a part only when other specific mods are present? something like:


PART:NEEDS[SolarisHypernautics,FTLDrive]
{
	name = GTI_Hyperdrive
	...etc...
}

The above does not work, but maybe I'm just missing some notation?

This should work, to my knowledge.  You should be able to tell what's going on based on the log and config cache.  Any clues in there?

Link to comment
Share on other sites

14 hours ago, blowfish said:

This should work, to my knowledge.  You should be able to tell what's going on based on the log and config cache.  Any clues in there?

Thanks. I will take a look when I get home from work... Hope that has a clue, since right now I either have no check, or no part...

Link to comment
Share on other sites

1 hour ago, Drew Kerman said:

I thought the proper syntax for part creation was +PART - that's what I've been using anyways

That's for duplicating an existing node.  If you're creating it from scratch you wouldn't use the operator.

Link to comment
Share on other sites

18 hours ago, blowfish said:

This should work, to my knowledge.  You should be able to tell what's going on based on the log and config cache.  Any clues in there?

Thanks you blowfish. It seem's I was looking in the wrong place. My case was, that I was referencing a model in another mod, but this reference is case sensitive...

i.e. this
model = Solaris Hypernautics/Parts/Resources/DustRing/warp

is NOT this
model = Solaris Hypernautics/Parts/Resources/DustRing/Warp

You where right that my syntax in the moduleManager part was correct, except for the fact that FTLDrive have change name to FTLDriveContinued. :confused:

So two errors, and none of which was my question.... lol.... Thanks, your answer made me look more focused!

Link to comment
Share on other sites

Related to KSP's GameDatabase, is it possible to change the UrlDir.UrlConfig's variable 'url' when duplicating an existing CFG node, using MM only? More specifically, consider the following scenario:

Let the default_settings.cfg file be

RemoteTechSettings
{
    ...
}

Then, suppose I create a MM patch to make a copy of and pass the default_settings.cfg off as a third-party mod's settings.cfg

+RemoteTechSettings:FOR[ExampleMod]
{
    //some tweaks like no signal delay
}

However, both CFGs in the GameDatabase (I verified MM indeed duplicated the original CFG and then modified it) have the same url.

(I am member of RemoteTech team, working with a third-party developer on how RemoteTech should apply his/her RT settings to existing save settings)

Edited by TaxiService
Link to comment
Share on other sites

12 minutes ago, TaxiService said:

Related to KSP's GameDatabase, is it possible to change the UrlDir.UrlConfig's variable 'url' when duplicating an existing CFG node, using MM only? More specifically, consider the following scenario:

Let the default_settings.cfg file be


RemoteTechSettings
{
    ...
}

Then, suppose I create a MM patch to make a copy of and pass the default_settings.cfg off as a third-party mod's settings.cfg


+RemoteTechSettings:FOR[ExampleMod]
{
    //some tweaks like no signal delay
}

However, both CFGs in the GameDatabase (I verified MM indeed duplicated the original CFG and then modified it) have the same url.

(I am member of RemoteTech team, working with a third-party developer on how RemoteTech should apply his/her RT settings to existing save settings)

I never got why RT loads settings like it does. wouldn't it be simpler to just have 1 single RemoteTech node and third party mods can edit that node instead of every mod having to create their own?

Link to comment
Share on other sites

14 minutes ago, Sigma88 said:

I never got why RT loads settings like it does. wouldn't it be simpler to just have 1 single RemoteTech node and third party mods can edit that node instead of every mod having to create their own?

RemoteTech already has this kind of feature: modders supply their own MM patches to edit RemoteTech's default settings during the KSP's squad monkey screen. When a player starts a new game, the modified default settings are used and saved persistently. But what if a player has an existing save (and its RT settings) and installs another mod with its MM patch for RT? Since the player does not take the modified default settings when resuming his/her save, we currently offer a cumbersome interface of overwriting the player's RT settings with third-party mods's RT-settings-cfg copies. I am looking at the approach of overwriting the existing save settings with a second copy of modified default settings while we retain our own default settings to revert in event of setting corruption (we can't have a single modified default settings in the interface or this would confuse a player).

Edited by TaxiService
Link to comment
Share on other sites

3 minutes ago, TaxiService said:

RemoteTech already has this kind of feature: modders supply their own MM patches to edit RemoteTech's default settings during the KSP's squad monkey screen.

oh this must have been added after last time I checked then, nice to hear it's possible to do that now :)

it used to be that third party mods had to create a new RemoteTechSettings node, like RSS does here

 

regarding your question, what if instead of copying the whole node you create a new node and copy its content?

Edited by Sigma88
Link to comment
Share on other sites

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