Jump to content

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


sarbian

Recommended Posts

So, I love Near Future, but I dislike all the extra resources that it adds in to the game. I used to manually edit all the engine CFG files in it to change the ArgonGas to XenonGas and the Lithium to LiquidFuel, but with all the crazy updating, I thought I could just write my own lil MM config for it, but due to my lack of experience with MM cfgs, I do not know what I did wrong.

 

@PART[*]:HAS[@PROPELLANT[ArgonGas]] 
{  
	@MODULE[ModuleEnginesFX]
	{
		@PROPELLANT[ArgonGas]
		{
			@name = XenonGas
		}
	}
}
@PART[*]:HAS[@PROPELLANT[Lithium]] 
{  
	@MODULE[ModuleEnginesFX]
	{
		@PROPELLANT[Lithium]
		{
			@name = LiquidFuel
		}
	}
}

Can someone please point out what I got wrong here?

Thank you in advance for your assistance, time and effort.

Edited by Haze-Zero
Link to comment
Share on other sites

55 minutes ago, Haze-Zero said:

So, I love Near Future, but I dislike all the extra resources that it adds in to the game. I used to manually edit all the engine CFG files in it to change the ArgonGas to XenonGas and the Lithium to LiquidFuel, but with all the crazy updating, I thought I could just write my own lil MM config for it, but due to my lack of experience with MM cfgs, I do not know what I did wrong.

 


@PART[*]:HAS[@PROPELLANT[ArgonGas]] 
{  
	@MODULE[ModuleEnginesFX]
	{
		@PROPELLANT[ArgonGas]
		{
			@name = XenonGas
		}
	}
}
@PART[*]:HAS[@PROPELLANT[Lithium]] 
{  
	@MODULE[ModuleEnginesFX]
	{
		@PROPELLANT[Lithium]
		{
			@name = LiquidFuel
		}
	}
}

Can someone please point out what I got wrong here?

Thank you in advance for your assistance, time and effort.

try this:

@PART:FINAL
{  
	@MODULE[ModuleEnginesFX]
	{
		@PROPELLANT[ArgonGas]
		{
			@name = XenonGas
		}
		@PROPELLANT[Lithium]
		{
			@name = LiquidFuel
		}
	}
}

 

Link to comment
Share on other sites

1 hour ago, blowfish said:

@Haze-Zero Parts don't have PEOPELLANT nodes, so the HAS block will never be true.

in addition, if you were to check for:

@PART:HAS[@MODULE:HAS[@PROPELLANT[ArgonGas]]]

the patch will likely fail, I can't remember the circumstances very well right now, but I remember that using those checks is not reliable in the root level for some reasons

Link to comment
Share on other sites

I can not test it atm, I am at work, but would the following work?

@PART[ionArgon-0625,ionArgon-0625-2,ionArgon-0625-3,ionArgon-125,mpdt-0625,mpdt-125,mpdt-25,pit-0625,pit-125,pit-25,vasimr-0625,vasimr-125,vasimr-25]:AFTER[NearFuturePropulsion]
{  
    @MODULE[ModuleEnginesFX]
    {
        @PROPELLANT[ArgonGas]
        {
            @name = XenonGas
        }
        @PROPELLANT[Lithium]
        {
            @name = LiquidFuel
        }
    }
}

Again, thank you in advance for your assistance, time and effort.

Link to comment
Share on other sites

Need a little help here, please:

I have a part, which has a ModuleEngines, and in that is a PROPELLANT for FSCoolant.  FSCoolant comes from FireSpitter, but apparently the FSCoolant isn't always installed, so this module generates a mostly harmless message:

MODULE
{
// unnecessary lines deleted for clarity

        PROPELLANT
        {
                name = FSCoolant
                ratio = 0.01
        }
}

How can I write this so that if FSCoolant is only there IF it's available?

FSCoolant is in the directory:

     Firespitter/Resources/Firespitter.cfg

thanks in advance

Edited by linuxgurugamer
Link to comment
Share on other sites

On 10/29/2016 at 4:18 PM, sarbian said:

Do NOT use Final in a distributed mod !!!! If you need something to go after an other mods patch use AFTER.

Glad I saw this, thanks.  I'll change the cfgs to AFTER

and it screwed up the two mods :-(

I reverted the change, will ignore this for now, it seems to be ok

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

Need a little help here, please:

I have a part, which has a ModuleEngines, and in that is a PROPELLANT for FSCoolant.  FSCoolant comes from FireSpitter, but apparently the FSCoolant isn't always installed, so this module generates a mostly harmless message:


MODULE
{
// unnecessary lines deleted for clarity

        PROPELLANT
        {
                name = FSCoolant
                ratio = 0.01
        }
}

How can I write this so that if FSCoolant is only there IF it's available?

FSCoolant is in the directory:

     Firespitter/Resources/Firespitter.cfg

thanks in advance

So, I have it partially working:

This works checking for Firespitter:

PROPELLANT:NEEDS[Firespitter]

But neither of the following work, looking for a directory under Firespitter:

PROPELLANT:NEEDS[Firespitter/Resources]

or

PROPELLANT:NEEDS[FirespitterResources]

 

Link to comment
Share on other sites

6 hours ago, linuxgurugamer said:

But neither of the following work, looking for a directory under Firespitter:


PROPELLANT:NEEDS[Firespitter/Resources]

or

PROPELLANT:NEEDS[FirespitterResources]

 

I have the same problem looking for Karibou inside UmbraSpaceIndustries, this should work :

@PROPELLANT:FOR[Firespitter/Resources]:NEEDS[Firespitter/Resources]

Not sure if the NEEDS: is of any use here but it work, if someone has more info on how FOR / NEEDS work I'd like to hear

Link to comment
Share on other sites

16 minutes ago, Li0n said:

if someone has more info on how FOR / NEEDS work I'd like to hear

 

On ‎25‎.‎10‎.‎2013 at 3:02 PM, sarbian said:

The following parameters are currently implemented:

:BEFORE[ModName] - execute this patch BEFORE ModName executes its patches.

:FOR[ModName] - I am ModName, and these are my patches.

:AFTER[ModName] - execute this patch AFTER ModName executes its patches.

:NEEDS[ModName1] - execute this patch only if ModName1 is installed.

:NEEDS[!ModName2] - do not execute this patch if ModName2 is installed.

You can combine NEEDS nodes like this:

:NEEDS[ModName1, !ModName2]

Pretty much like this,but it's all described in first two posts in this thread.

Link to comment
Share on other sites

1 minute ago, sebi.zzr said:
On 10/25/2013 at 9:02 AM, sarbian said:

The following parameters are currently implemented:

:BEFORE[ModName] - execute this patch BEFORE ModName executes its patches.

:FOR[ModName] - I am ModName, and these are my patches.

:AFTER[ModName] - execute this patch AFTER ModName executes its patches.

:NEEDS[ModName1] - execute this patch only if ModName1 is installed.

:NEEDS[!ModName2] - do not execute this patch if ModName2 is installed.

You can combine NEEDS nodes like this:

:NEEDS[ModName1, !ModName2]

Pretty much like this,but it's all described in first two posts in this thread.

the problem here, is that Firespitter can be installed, but the resources may not be there, depending on how it was installed.  The way the NEEDS is described, when using it in a NEEDS[dirname], the docs indicate it will only work for the first directory under the GameData directory, but in this case, I need to check for a directory below an existing directory, in this case: NEEDS[existDir/searchDir], which I need to know if searchDir is there; actually, I need to know that both are there, obviously. 

 

34 minutes ago, Li0n said:

I have the same problem looking for Karibou inside UmbraSpaceIndustries, this should work :


@PROPELLANT:FOR[Firespitter/Resources]:NEEDS[Firespitter/Resources]

Not sure if the NEEDS: is of any use here but it work, if someone has more info on how FOR / NEEDS work I'd like to hear

Nope, didn't work.  So for now, I'll just have to check for Firespitter and deal with the inevitable complaints about the FSCoolant error in logs, if anyone asks

Link to comment
Share on other sites

@Li0n @linuxgurugamer

there are two options here, either:

1- firespitter is supposed to be used all together and you are removing folders at random

2- firespitter is actually modular and it's possible to have different folders inside of it

ok they are three options (3- some other mod dev is putting stuff inside firespitter just for funz)

 

if the case 2 is what is happening (I have no idea) it seems reasonable that the mod developer would have put :FOR[] tags inside the cfgs of each subfolder in order to help track if that folder is installed.

if he didn't put any :FOR[] tags, and you need to release a mod that needs to check for that specific folder, I think you can ask the developer of firespitter if he can add a :FOR[] tag to that particular folder.

 

in the meantime you will need to be creative and find a way to understand if that folder is intalled by yourself.

 

I have no idea what that folder contains, if you give me a description of what kind of cfgs are in that folder I can help you set up a cfg that checks for it's presence

 

I can't download stuff since I'm on my phone, use pastebin links :wink:

Edited by Sigma88
Link to comment
Share on other sites

@sebi.zzr, @Sigma88 thanks for the info (I should have read past the first post...)@linuxgurugamer I think I don't found a way to check subdirectory with NEEDS:.

Spoiler

@PART[KER_PassengerCab]:NEEDS[UmbraSpaceIndustries]:NEEDS[Karibou]

for checking if "GameData/UmbraSpaceIndustries/Karibou/" do exist.

It works for what I need but not sure it will help you

 

 

Edited by Li0n
Link to comment
Share on other sites

33 minutes ago, sarbian said:

I don't see how that could work.

Unfortunately you're right. The second NEEDS: get ignored, should have tested more... I'll edit my previous post to not give false hope to future readers.

So there is no *easy* way of checking for a subdirectory ? Is it something you consider adding ?

Edited by Li0n
Link to comment
Share on other sites

34 minutes ago, Li0n said:

So there is no *easy* way of checking for a subdirectory ? Is it something you consider adding ?

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.

Edited by nightingale
Link to comment
Share on other sites

For what it's worth, there might be a way to do this.  I would be embarrassed to include such a hacky patch in any released mod though.  I also haven't tested this, so no guarantee that it actually works

Spoiler

@RESOURCE_DEFINITION[FSCoolant]:BEFORE[MyMod]
{
  FSCoolantExists = true
}

%RESOURCE_DEFINITION[FSCoolant]:BEFORE[MyMod]
{
  &FSCoolantExists = false
}

@PART[MyPart]:FOR[MyMod]
{
  FSCoolantExists = #$@RESOURCE_DEFINITION[FSCoolant]/FSCoolantExists$
}

@PART[MyPart]:HAS[#FSCoolantExists[true]]:FOR[MyMod]
{
  @MODULE[ModuleEngines*]
  {
    PROPELLANT
    {
      name = FSCoolant
      // ...
    }
  }
}

@PART[MyPart]:FOR[MyMod]
{
  !FSCoolantExists = DEL
}

!RESOURCE_DEFINITION[FSCoolant]:HAS[#FSCoolantExists[false]]:AFTER[MyMod] { }

@RESOURCE_DEFINITION[FSCoolant]:AFTER[MyMod]
{
  !FSCoolantExists = DEL
}

 

 

Edited by blowfish
Link to comment
Share on other sites

Hey, Ive been trying to make a simple patch to make the atmospheric sensor smaller, but its not working. what have I done wrong?

@PART[sensorAtmosphere]:FINAL
{
	//set this factor bigger to make the part bigger, smaller to shrink it
	@rescaleFactor = 0.3
	//I sugget 0.3, that puts it right around the scale of the thermometer & accelerometer
}

 

Link to comment
Share on other sites

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

IE, I wish to "mod" the 

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?

 

Edited by paul23
Link to comment
Share on other sites

20 minutes ago, fourfa said:

I miss NyanCat. See you in April, my colorful whimsical friend

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

in windows, just create a shortcut to the KSP exe file then right click on the shortcut and select properties

in the first box you will find the address of the file, add at the end (after the  " ) the word     -nyan-nyan

save and run ksp from that shortcut

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