Jump to content

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


sarbian

Recommended Posts

7 hours ago, nightingale said:

Better option would be to ask @RoverDude to use :FOR[Karibou] in his configs (he already has MM configs, so it doesn't introduce a Module Manager dependency on his end that doesn't already exist).  That will allow other mods to use :NEEDS[Karibou].  Or better yet - submit a pull request with that change.

I know @sarbian has rejected doing subdirectories in the past (with good reason, the directory hierarchies in some mods get very deep, and there's a lot of exceptional stuff like "PluginData" that would need to be specifically excluded).

EDIT: Missed that the original issue has to do with Firespitter + Resources.  I'm less familiar with how that's set up, but could still be hypothetically fixed by using an appropriate FOR[xxx] somewhere.

This whole thing started when I saw errors in a log file someone sent me, and I made the (wrong) assumption that it was a problem with the mod.

Turns out, I was wrong.  If Firespitter is installed correctly, the resource will be there.  There is no need to check beyond checking for Firespitter.

Anyway, since the mod (SXT) has a number of dependencies on Firespitter, this whole discussion is moot, at least for me, since I'm going to make it a requirement that the entire mod be  installed.

Thanks for all the responses

Link to comment
Share on other sites

7 minutes ago, blowfish said:

@sebi.zzr That's just not how the NEEDS feature works (it looks for mods, not nodes).  I posted a workaround on the previous page but it's pretty involved.

 Yes i saw that,that's why i asked.
MM can look in any *.cfg(for edit),but can't find the subfolder.I was searching for solution to the problem that @linuxgurugamer has,so my closest working patch was:

PROPELLANT
 {
 name = #$@RESOURCE_DEFINITION[FSCoolant]/name$
 ratio = 0.01
 }

it gets applied correctly,but if i remove Firespitter/Resources/Firespitter.cfg,i get error on the loading screen,and

PROPELLANT:NEEDS[@RESOURCE_DEFINITION[FSCoolant]

does not apply patch at all.
Thank you for clarification.

Link to comment
Share on other sites

48 minutes ago, sebi.zzr said:

One brief question,if MM can:


@RESOURCE_DEFINITION[name]
{
stuf
}

why it can't:


:NEEDS[@RESOURCE_DEFINITION[name]]

?

Allowing that opens a can of worms. Say you have a mod that do a NEED check for that resource early and an other that remove it later. How do I handle that ?

Link to comment
Share on other sites

3 minutes ago, sarbian said:

Allowing that opens a can of worms.

:D

3 minutes ago, sarbian said:

Say you have a mod that do a NEED check for that resource early and an other that remove it later. How do I handle that ?

Maybe the mod that removes the resource could go :BEFORE,if there is no resource,then patch is not applied,or when this is allowed all the mods will need to respect the rule.But i'm !moder|!coder[through my eyes it was a simple solution] and i do understand the dependencies you need to consider.
Sometimes i envy you your knowledge,but i'm also happy for that you have it.

Link to comment
Share on other sites

33 minutes ago, sebi.zzr said:

:D

Maybe the mod that removes the resource could go :BEFORE,if there is no resource,then patch is not applied,or when this is allowed all the mods will need to respect the rule.But i'm !moder|!coder[through my eyes it was a simple solution] and i do understand the dependencies you need to consider.
Sometimes i envy you your knowledge,but i'm also happy for that you have it.

if all you want to do is check if that resourse exists then the solution is pretty simple (as blowfish explained before)

1- use HAS to check if the resourse exists on its root node

2- create a temporary variable which is either true or false depending on the presence of the resource

3- copy that value on the root node you want to edit

4- check for true or false and apply only if true

 

I don't know why @blowfish says this is a bad idea, I use it all the time and it works perfectly fine.

 

or, you know, you can keep insisting with sarbian untill he breaks and adds the feature :D

Edited by Sigma88
Link to comment
Share on other sites

Ok. I'll try my questions again now that the dust has settled from the poptart furriness has finally settled. I've got a couple of questions. For 1. I had created a patch to add research lab ability to Raidernick's Skylab. It works good. My friend asked me to patch the salyut 6. Do the same patch for it, changing the pertinent details like name, etc. But it's otherwise the same file. The problem is, while the new research ability is shown in it's details in the VAB. Right clicking it won't come up, and also is broken for any other attached part. Swapping ships away and back fixes the rest of the parts' right click menus. But right clicking, breaks it again. Makes me wonder if having to add that extra  couple of options in the right click menu and breaks the UI. Not sure how. But while the Saluyt lab may be able to research, you won't be able to try it without the menu. LoL

I'll copy the Salyut patch here, and then the original (working) skylab patch.

Quote

@PART[salyut6]:Final{
    MODULE
    {
        name = ModuleScienceLab
        containerModuleIndex = 5
        dataStorage = 250
        crewsRequired = 1
        canResetConnectedModules = True
        canResetNearbyModules = True
        interactionRange = 2
        SurfaceBonus = 0.5
        ContextBonus = 0.5
        homeworldMultiplier = 0.15
        RESOURCE_PROCESS
        {
            name = ElectricCharge
            amount = 5
        }
    }
    MODULE
    {
        name = ModuleScienceConverter
        scientistBonus = 0.5    //Bonus per scientist star - need at least one! So 0.25x - 2.5x
        researchTime = 2.5        //Larger = slower.  Exponential!
        scienceMultiplier = 2    //How much science does data turn into?
        scienceCap = 250        //How much science can we store before having to transmit?        
        powerRequirement = 2    //EC/Sec to research
        ConverterName = Research
        StartActionName = Start Research
        StopActionName = Stop Research
    }

}

And the skylab patch.

Quote

@PART[skylab]:Final{
    MODULE
    {
        name = ModuleScienceLab
        containerModuleIndex = 3
        dataStorage = 750
        crewsRequired = 1
        canResetConnectedModules = True
        canResetNearbyModules = True
        interactionRange = 5
        SurfaceBonus = 0.15
        ContextBonus = 0.5
        homeworldMultiplier = 0.15
        RESOURCE_PROCESS
        {
            name = ElectricCharge
            amount = 15
        }
    }
    MODULE
    {
        name = ModuleScienceConverter
        scientistBonus = 0.33    //Bonus per scientist star - need at least one! So 0.25x - 2.5x
        researchTime = 7.5        //Larger = slower.  Exponential!
        scienceMultiplier = 4    //How much science does data turn into?
        scienceCap = 850        //How much science can we store before having to transmit?        
        powerRequirement = 8    //EC/Sec to research
        ConverterName = Research
        StartActionName = Start Research
        StopActionName = Stop Research
    }

}

 

Link to comment
Share on other sites

5 hours ago, samamstar said:

So if module manager didn't break in 1.2.1, then why doesn't this work?

Perhaps you should look at the log and config cache to see if the problem is with ModuleManager applying the patch, something else overwriting it, or KSP interpreting the end result.

Link to comment
Share on other sites

7 hours ago, sebi.zzr said:

:D

Maybe the mod that removes the resource could go :BEFORE,if there is no resource,then patch is not applied,or when this is allowed all the mods will need to respect the rule.But i'm !moder|!coder[through my eyes it was a simple solution] and i do understand the dependencies you need to consider.
Sometimes i envy you your knowledge,but i'm also happy for that you have it.

Part of the problem is that NEEDS conditions are processed before any patching actually occurs.  So really I think you're asking for a new type of condition that is evaluated at the time of the patch, e.g. :REQUIRES[@RESOURCE_DEFINITION[FSCoolant]]

Link to comment
Share on other sites

1 hour ago, blowfish said:

Part of the problem is that NEEDS conditions are processed before any patching actually occurs.  So really I think you're asking for a new type of condition that is evaluated at the time of the patch, e.g. :REQUIRES[@RESOURCE_DEFINITION[FSCoolant]]

I would have gone with :WHEN[@RESOURCE_DEFINITION[FSCoolant]]

:)

that would be a very welcome addition, and I had actually thought of it multiple times in the past, but never said anything because I didn't want to put even more work on sarbian's plate.

:WHEN would basically work as a modified :HAS[] that looks at nodes using the same syntax as the "copy node" feature (#NEWNODE {})

:WHEN would also start from the assumption you are defining the whole "url" from the root

ROOT/NODE/SUBNODE/key[value]

 

so that you can use the same symbols as :HAS[] to tell MM what to look for

:WHEN[#ROOT/NODE/SUBNODE/key[value]]    // key[value] has to exist in the specified path
:WHEN[~ROOT/NODE/SUBNODE/key[value]]    // key[value] has to NOT exist in the specified path
:WHEN[@ROOT/NODE/SUBNODE[value]]        // SUBNODE:HAS[name[value]] has to exist in the specified path
:WHEN[!ROOT/NODE/SUBNODE[value]]        // SUBNODE:HAS[name[value]] has to NOT exist in the specified path

 

Edited by Sigma88
Link to comment
Share on other sites

Though I posted this already, but guess not:

 

Is it possible to "modify" the settings in the contracts file?

Survey -> second survey defintion.

    Survey
    {
        MaximumAvailable = 3
        MaximumActive = 6
        TrivialWaypoints = 1
        SignificantWaypoints = 2
        ExceptionalWaypoints = 3
        TrivialHomeNearbyChance = 70
        SignificantHomeNearbyChance = 35
        ExceptionalHomeNearbyChance = 0
        TrivialHomeNearbyRange = 2000
        SignificantHomeNearbyRange = 4000
        ExceptionalHomeNearbyRange = 6000
        TrivialRange = 2000
        SignificantRange = 4000
        ExceptionalRange = 6000
        MinimumTriggerRange = 500
        MaximumTriggerRange = 15000
        MinimumThreshold = 1400
        MaximumThreshold = 30000
        ThresholdDeviancy = 10
        Expiration
        {
        }
        Funds
        {
        }
        Science
        {
        }
        Reputation
        {

        }
        SURVEY_DEFINITION
        {
	        }
	        SURVEY_DEFINITION
        {
            Title = Perform seismic surveys on @.
            Briefing = We want to confirm some theories about what is going on inside @. Head there and take a few accelerometer readings.
            Debriefing = These are the seismic readings we needed to proceed on @. Thank you.
            FundsReward = 53000
            FundsPenalty = 0
            ScienceReward = 0
            ReputationReward = 9
            ReputationPenalty = 9
            PARAM
            {
                Experiment = seismicScan
                Description = Take seismic readings
                Texture = seismic
                Tech = sensorAccelerometer
                AllowGround = True
                AllowLow = False
                AllowHigh = False
                AllowWater = False
                AllowVacuum = True
                FundsMultiplier = 1.1
                ScienceMultiplier = 1
                ReputationMultiplier = 0.9
            }
        }

 

How would I edit this definition, since it doesn't hold a name-field?

Link to comment
Share on other sites

1 hour ago, paul23 said:

How would I edit this definition, since it doesn't hold a name-field?

you don't need names

if the node you want is always the second, then use this:

@SURVEY_DEFINITION,1
{
    // stuff here
}

otherwise you'll have to get creative with :HAS[] checks

1 hour ago, paul23 said:

How would I edit this definition, since it doesn't hold a name-field?

you don't need names

if the node you want is always the second, then use this:

@SURVEY_DEFINITION,1
{
    // stuff here
}

otherwise you'll have to get creative with :HAS[] checks

 

-------------------------------------------------------------------------------------------------------------------

 


@blowfish @sarbian I used to be able to be able to append a string to the end of another string by doing :

key = hello

@key ^= :$: world:

 

which would lead as a result to:

key = hello world

this isn't working anymore, any idea if that's a bug or a deliberate decision?

 

EDIT:

after a bit of testing it looks like my issue was not with the fact that I want to use 

@key,* ^= :$:stuff:

 

it works when not using the ,*   but it stops working with ,*

logs incoming (I'll open a github issue)

Edited by Sigma88
Link to comment
Share on other sites

On 03/11/2016 at 2:39 PM, Sigma88 said:

if you run ksp with the option "-nyan-nyan" it MM will always show our favourite pu feline.

Oh, I opened this thread to ask about this and it's the second comment on the page. Many thanks :cool: 

Link to comment
Share on other sites

Hey I'm still wondering a bit about modular manager. - For balancing purposes I wish to make the "contracts outside kerbin SOI" worth more money (I'm rpging so I wish to maximize "yearly profits", and in that sense it is really silly to do anything other than LKO missions). 

Is there any way I can do this with module manager? Looking into the contracts file I can't seem to find a realistic way to change the contract definitions, where are the "money multipliers" for the different bodies stored?

Link to comment
Share on other sites

9 minutes ago, Benji13 said:

Can someone please tell me why I'm getting errors with this patch?

Check your braces - {

A second look I see you mistakenly used a bracket ] instead of a brace {

A third look and you probably didn't mistake the bracket but instead copy/pasted and forgot the brace

Ok I'm done looking

Edited by Drew Kerman
Link to comment
Share on other sites

2 hours ago, Starwaster said:

@Benji13

@Drew Kerman

In other words:


@PART[*]:HAS[@MODULE[ModuleEnginesFX]]
{
	@MODULE[ModuleEnginesFX]
	{
		heatProduction *=2.5
	}
}

 

Thanks. I'll replace the ModuleEnginesFX with ModuleEngines* too.

Nope, just tried this:

@PART[*]:HAS[@MODULE[ModuleEnginesFX]]
{
	@MODULE[ModuleEnginesFX]
	{
		heatProduction *=2.5
	}
}

An I get this:

Error - Cannot use operators with insert value: @MODULE[ModuleEngines*]

Can you not use * in the fist line of the patch? If not, is there a way to get around this? 

Link to comment
Share on other sites

13 minutes ago, Benji13 said:

Thanks. I'll replace the ModuleEnginesFX with ModuleEngines* too.

Nope, just tried this:


@PART[*]:HAS[@MODULE[ModuleEnginesFX]]
{
	@MODULE[ModuleEnginesFX]
	{
		heatProduction *=2.5
	}
}

An I get this:

Error - Cannot use operators with insert value: @MODULE[ModuleEngines*]

Can you not use * in the fist line of the patch? If not, is there a way to get around this? 

You need an @ before the key

Link to comment
Share on other sites

23 minutes ago, Sigma88 said:

heatProduction *=2.5

It is complaining about this bit because it is saying "add a new value called heatProduction and set it to the existing value of heatProduction multiplied by 2.5" but this is illogical.  Just add an @ to the start, e.g.

@heatProduction *= 2.5

The error message is a little misleading, the "@MODULE[ModuleEngines*]" bit makes it look like this is the bit with the problem but it is actually the section the problem is in...

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