Jump to content

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


sarbian

Recommended Posts

Yep, that did work, thanks! I'll relay that back to FC.

But um, just as a note, the above config works just fine in ModuleManager 2.1.0 and earlier.. was there a syntax change or something?

Not really, just tweaked a few things and looks like there's some collateral damage. Putting spaces in that spot for nodes will cause issues (and we can't get around them) so for consistency probably best keep it as it is.

Link to comment
Share on other sites

Hi,

I just wrote a file for MM that had some bum bracket arrrangements in (I used a bunch of } instead of {) which SHOIULD have thrown and error for mismatched brackets or something? It didn't, I wondered if that was an issue.


+PART[US_m_Wedge_Oxygen]
{
@name = US_TAC_Wedge_Oxygen
@title = TAC enabled Universal Storage Life Support Oxygen Block

@RESOURCE[Oxygen]
}
@amount = 70
@maxAmount = 70
}

RESOURCE
}
name = CarbonDioxide
amount = 0
maxAmount = 70
}
}

+PART[US_Radial_Oxygen]
{
@name = US_TAC_Radial_Oxygen
@title = TAC enabled Universal Storage Radial Oxygen Tank

@RESOURCE[Oxygen]
}
@amount = 20
@maxAmount = 20
}

RESOURCE
}
name = CarbonDioxide
amount = 0
maxAmount = 20
}
}

+PART[US_q_Wedge_Water]
{
@name = US_TAC_Wedge_Water
@title = TAC enabled Universal Storage Water Block

@RESOURCE[Water]
}
@amount = 45
@maxAmount = 45
}

RESOURCE
}
name = WasteWater
amount = 0
maxAmount = 45
}
}

+PART[US_Wedge_KASContainer]
{
@name = US_TAC_Wedge_FoodContainer
@title = TAC Universal Storage Food Container

-MODULE[KASModuleContainer]

RESOURCE
}
name = Food
amount = 50
maxAmount = 50
}

RESOURCE
}
name = Waste
amount = 0
maxAmount = 50
}
}

Link to comment
Share on other sites

Hi,

I just wrote a file for MM that had some bum bracket arrrangements in (I used a bunch of } instead of {) which SHOIULD have thrown and error for mismatched brackets or something? It didn't, I wondered if that was an issue.


+PART[US_m_Wedge_Oxygen]
{
@name = US_TAC_Wedge_Oxygen
@title = TAC enabled Universal Storage Life Support Oxygen Block

@RESOURCE[Oxygen]
}
@amount = 70
@maxAmount = 70
}

RESOURCE
}
name = CarbonDioxide
amount = 0
maxAmount = 70
}
}

+PART[US_Radial_Oxygen]
{
@name = US_TAC_Radial_Oxygen
@title = TAC enabled Universal Storage Radial Oxygen Tank

@RESOURCE[Oxygen]
}
@amount = 20
@maxAmount = 20
}

RESOURCE
}
name = CarbonDioxide
amount = 0
maxAmount = 20
}
}

+PART[US_q_Wedge_Water]
{
@name = US_TAC_Wedge_Water
@title = TAC enabled Universal Storage Water Block

@RESOURCE[Water]
}
@amount = 45
@maxAmount = 45
}

RESOURCE
}
name = WasteWater
amount = 0
maxAmount = 45
}
}

+PART[US_Wedge_KASContainer]
{
@name = US_TAC_Wedge_FoodContainer
@title = TAC Universal Storage Food Container

-MODULE[KASModuleContainer]

RESOURCE
}
name = Food
amount = 50
maxAmount = 50
}

RESOURCE
}
name = Waste
amount = 0
maxAmount = 50
}
}

It should have told you there was an error in one of your scripts but it doesn't log any exceptions. It just fails that script and moves to the next.

Link to comment
Share on other sites

I thought it would be really helpful. Others have brought up the idea also. And I noticed that no-one had done it yet, so here it is: a Part CFG Logger.

It exports the configs for every part (and resource and more) to files in your {KSP}/_CfgOutput directory. That's it. Nothing more. But I think it will be extremely useful when trying to get Module Manager files right. That's right, it exports the configs after MM patches are applied. It turned out to be really, really simple.

Code: https://github.com/taraniselsu/TacPartCfgLogger

Download: https://github.com/taraniselsu/TacPartCfgLogger/releases

Did not work as well as I wanted. See this post for another solution.

I will make a thread for it if there is enough interest.

Edited by TaranisElsu
Didn't work as well as I wanted
Link to comment
Share on other sites

It should have told you there was an error in one of your scripts but it doesn't log any exceptions. It just fails that script and moves to the next.

That's my point, it didn't tell me (no error on the loading screen or in output_log.txt that I could find) hence I was really confused for a while until I rechecked the file for errors...

Link to comment
Share on other sites

I thought it would be really helpful. Others have brought up the idea also. And I noticed that no-one had done it yet, so here it is: a Part CFG Logger.

It exports the configs for every part (and resource and more) to files in your {KSP}/_CfgOutput directory. That's it. Nothing more. But I think it will be extremely useful when trying to get Module Manager files right. That's right, it exports the configs after MM patches are applied. It turned out to be really, really simple.

Code: https://github.com/taraniselsu/TacPartCfgLogger

Download: https://github.com/taraniselsu/TacPartCfgLogger/releases

I will make a thread for it if there is enough interest.

Wow I had posted at one point that this would super helpful diagnosing bugs... I will get do much use of this!

Thanks a ton!

Link to comment
Share on other sites

I thought it would be really helpful. Others have brought up the idea also. And I noticed that no-one had done it yet, so here it is: a Part CFG Logger.

It exports the configs for every part (and resource and more) to files in your {KSP}/_CfgOutput directory. That's it. Nothing more. But I think it will be extremely useful when trying to get Module Manager files right. That's right, it exports the configs after MM patches are applied. It turned out to be really, really simple.

Code: https://github.com/taraniselsu/TacPartCfgLogger

Download: https://github.com/taraniselsu/TacPartCfgLogger/releases

I will make a thread for it if there is enough interest.

KSP seems to be modifying the configs, possibly in the part loader, and it deletes a whole bunch of fields so they are no longer accessible. I have now hacked my export method into Module Manager as an alternative solution. I may have to ask that you incorporate my changes into the main MM build unless Squad fixes the part loader. I do not see another way to get it to work :(.

New version:

Code: https://github.com/taraniselsu/ModuleManager

Download: https://github.com/taraniselsu/ModuleManager/releases/tag/AddedCFGExport

Warning: do not use this version unless you know what you are doing. The maintainers of ModuleManager will not support this build in any way.

Edited by TaranisElsu
Link to comment
Share on other sites

Is there a way to append to a string value?

I want to do something like this:

+PART[*]:HAS[@MODULE[ModuleRCS]]

{

@name = *whatever name is* LFO (so KWrcsPod becomes KWrcsPodLFO)

...

}

Link to comment
Share on other sites

KSP seems to be modifying the configs, possibly in the part loader, and it deletes a whole bunch of fields so they are no longer accessible. I have now hacked my export method into Module Manager as an alternative solution. I may have to ask that you incorporate my changes into the main MM build unless Squad fixes the part loader. I do not see another way to get it to work :(.

:( Yup. I ran into this when I first started making ModularFuelSystem. It's... frustrating.

Link to comment
Share on other sites

I really want to create a config that re-sorts parts among the categories so Control isn't so empty and Structural is a little shorter, etc. I've had success in the past using the following code, but, when running it with Realism Overhaul, this code does not change the categories, but it does seem to get a lot of parts that RO deprecates out of category -1 and into visibility. I'm also trying to use this in conjunction with my own list of parts to hide (using @PART[partname]:Final {@category = -1}) which seems to work fine.

Any ideas on what's going wrong?



@PART[*]:HAS[@MODULE[ModuleEngine]],!HAS[CrewCapacity]:Final
{
@category = Propulsion
}

@PART[*]:HAS[@RESOURCE[Xenon]],!HAS[CrewCapacity]:Final
{
@category = Propulsion
}

@PART[*]:HAS[@MODULE[ModuleDecouple],!MODULE[ProceduralFairing*]]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleAnchoredDecoupler]]:Final
{
@category = Control
}

@PART[*]:HAS[@RESOURCE[MonoPropellant]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleParachute]],!HAS[CrewCapacity]:Final
{
@category = Aero
}

@PART[*]:HAS[@MODULE[ModuleWheel]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleLandingGear]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleScienceExperiment]],!HAS[CrewCapacity]:Final
{
@category = Science
}

@PART[*Fairing*]:Final
{
@category = Aero
}

@PART[*Heatshield*]:!HAS[CrewCapacity]:Final
{
@category = Aero
}

Edited by curiousepic
Link to comment
Share on other sites

I really want to create a config that re-sorts parts among the categories so Control isn't so empty and Structural is a little shorter, etc. I've had success in the past using the following code, but, when running it with Realism Overhaul, this code does not change the categories, but it does seem to get a lot of parts that RO deprecates out of category -1 and into visibility. I'm also trying to use this in conjunction with my own list of parts to hide (using @PART[partname]:Final {@category = -1}) which seems to work fine.

Any ideas on what's going wrong?



@PART
[*]:HAS[@MODULE[ModuleEngine]],!HAS[CrewCapacity]:Final
{
@category = Propulsion
}

@PART
[*]:HAS[@RESOURCE[Xenon]],!HAS[CrewCapacity]:Final
{
@category = Propulsion
}

@PART
[*]:HAS[@MODULE[ModuleDecouple],!MODULE[ProceduralFairing*]]:Final
{
@category = Control
}

@PART
[*]:HAS[@MODULE[ModuleAnchoredDecoupler]]:Final
{
@category = Control
}

@PART
[*]:HAS[@RESOURCE[MonoPropellant]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART
[*]:HAS[@MODULE[ModuleParachute]],!HAS[CrewCapacity]:Final
{
@category = Aero
}

@PART
[*]:HAS[@MODULE[ModuleWheel]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART
[*]:HAS[@MODULE[ModuleLandingGear]],!HAS[CrewCapacity]:Final
{
@category = Control
}

@PART
[*]:HAS[@MODULE[ModuleScienceExperiment]],!HAS[CrewCapacity]:Final
{
@category = Science
}

@PART[*Fairing*]:Final
{
@category = Aero
}

@PART[*Heatshield*]:!HAS[CrewCapacity]:Final
{
@category = Aero
}

Lots wrong here.

!HAS is not valid.

You're also joining your conditionals wrong.

Try :HAS[@CONDITION1[Value1],!CONDITION2[Value2]]

Also you can't / should not use CrewCapacity that way

It would have to be something like CrewCapacity[1]] which means very literally 'if CrewCapacity == 1'

So that means that you have to check for CrewCapacity to be equal to a very specific value.

I'm getting 1 error on a pretty long (several thousands lines) .cfg file.

Is there any way to know what exactly caused it?

Look for output_log.txt file (or player.log if on Mac or Linux)

Not ksp.log as that is useless. Search that log file for the name of the text file containing your config, minus the extension. So if your config file is named 'my_very_long_config.cfg' then search for my_very_long_config and it will say stuff like: Applying node ConnectedLivingSpace/Plugins/CLSPorkworks/@PART[orbitalorb]:HAS[!MODULE[ModuleConnectedLivingSpace]] to HabitatPack/Parts/orbitalorb/part/orbitalorb

(except it would be my_very_long_config/@PART instead of CLSPorkworks/@PART)

To find your log file:

  • Windows: KSP_win\KSP_Data\output_log.txt
  • Mac OSX: Open Console, on the left side of the window there is a menu that says 'files'. Scroll down the list and find the Unity drop down, under Unity there will be Player.log Aka Files>~/Library/Logs>Unity>Player.log
  • Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log
  • NOT ksp.log file. Especially not ever.

Link to comment
Share on other sites

Is there a way to edit another mod's settings config file through a MM config? I'm currently working on a TACLS MM config that will give it units that make sense, but part of the requirement to make it work is that the consumption and production rates for it's units will also have to be edited. I am planning on offering the config for public use, so that means I've either got to find a way to change those settings through the MM config or deliver the MM config with a set of instructions on what values to set where. Any help would be appreciated.

Thanks.

Link to comment
Share on other sites

Is there a way to edit another mod's settings config file through a MM config? I'm currently working on a TACLS MM config that will give it units that make sense, but part of the requirement to make it work is that the consumption and production rates for it's units will also have to be edited. I am planning on offering the config for public use, so that means I've either got to find a way to change those settings through the MM config or deliver the MM config with a set of instructions on what values to set where. Any help would be appreciated.

Thanks.

You don't want to and should not edit another mod's files, even if you could.

You can edit its config nodes which is what MM is for in the first place. You would likely want to use the AFTER or FINAL directives to ensure that your changes happen last. AFTER assumes the other mod is making use of MM 2.1.5 ordering

Link to comment
Share on other sites

You don't want to and should not edit another mod's files, even if you could.

You can edit its config nodes which is what MM is for in the first place. You would likely want to use the AFTER or FINAL directives to ensure that your changes happen last. AFTER assumes the other mod is making use of MM 2.1.5 ordering

I don't mean I want to actually edit the files, but rather configure them after the fact through module manager, basically creating a temporary configuration through the MM config while leaving the mod's actual files untouched.

Link to comment
Share on other sites

I'm currently working on a TACLS MM config that will give it units that make sense, but part of the requirement to make it work is that the consumption and production rates for it's units will also have to be edited.

I have my own TACLS MM config file that uses realistic masses and volumes, but still keeps the amounts in "days of resources per kerbal". It might be a good starting point for you if you're going for a units-in-mass or units-in-volume approach.

Link to comment
Share on other sites

Lots wrong here.

Thanks for the debugging, I think I've got it working now! For anyone interested in resorting parts a little more evenly,



@PART[*]:HAS[@MODULE[ModuleEngine],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Propulsion
}

@PART[*]:HAS[@RESOURCE[Xenon],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Propulsion
}

@PART[*]:HAS[@MODULE[ModuleDecouple],!MODULE[ProceduralFairing*],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleAnchoredDecoupler],!MODULE[ProceduralFairing*],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleParachute],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Aero
}

@PART[*]:HAS[@MODULE[RealChuteModule],,!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Aero
}

@PART[*]:HAS[@MODULE[ModuleWheel],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleLandingGear],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Control
}

@PART[*]:HAS[@MODULE[ModuleScienceExperiment],!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Science
}

@PART[*Fairing*]:HAS[!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Aero
}

@PART[*Heatshield*]:HAS[!MODULE[ModuleCommand],!Category[-1]]:Final
{
@category = Aero
}

Link to comment
Share on other sites

Hey all, having a little trouble with the HAS syntax.

Essentially I have added a property to lots of parts like so:

@PART[B9_Cockpit_MK5]:Final
{
[B]RSSROEnabled = True[/B]
<snip>
}

And now I want to find ALL parts that do NOT have that property and hide them. However I can't seem to get it to work.

Some of the things i've tried:


@PART[*]:HAS[!RSSROEnabled[True]]:Final
{
@category = -1
}


@PART[*]:HAS[!RSSROEnabled[]]:Final
{
@category = -1
}


@PART[*]:HAS[!RSSROEnabled]:Final
{
@category = -1
}

But all my attempts just end up hiding EVERY single item. What am I doing wrong? What is the proper syntax here?

EDIT: To add, I have put my config in a folder named "zzzzzzzzz_final" so it should be processed absolutely last if I understand how it scans.

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