Jump to content

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


sarbian

Recommended Posts

I have been trying to bring MM into kOS and i have a syntax problem that im sure is simple

I would like to add a kOSProcessor module to all parts that:

1. Have ModuleCommand

2. Dont already have a kOSProcessor

The tricky part is that i want to give a varying amount of diskspace to parts based on their tech level. The example i have for the first two tiers of control follow.


@PART[*]:HAS[TechRequired[start]]:HAS[@MODULE[ModuleCommand],!MODULE[kOSProcessor]]
{
MODULE
{
name = kOSProcessor
diskSpace = 1000
}
}

@PART[*]:HAS[TechRequired[flightControl]]:HAS[@MODULE[ModuleCommand],!MODULE[kOSProcessor]]
{
MODULE
{
name = kOSProcessor
diskSpace = 3000
}
}

pretty sure its something simple i dont understand about the syntax.

Link to comment
Share on other sites

2.1.4 is now the official version :

DLL : ModuleManager.2.1.4.dll

Zip : ModuleManager-2.1.4.zip

This one lets you use directory name (the one just under GameData) as a NEED requirement, and various bugs fix. Thanks to swamp_ig once again.

Documentation update on the github wiki is in progress.

Syntax

Info on the save editing done by MM ( "The Problem" and "The Fix" ).

Dev adding modules at run times should have a look at that whole doc.

Link to comment
Share on other sites

2.1.4 is now the official version :

DLL : ModuleManager.2.1.4.dll

Zip : ModuleManager-2.1.4.zip

This one lets you use directory name (the one just under GameData) as a NEED requirement, and various bugs fix. Thanks to swamp_ig once again.

Documentation update on the github wiki is in progress.

Syntax

Info on the save editing done by MM ( "The Problem" and "The Fix" ).

Dev adding modules at run times should have a look at that whole doc.

Faced a minor problem with this version, ie: I have @PART[commDish]:FOR[AntennaRange]:NEEDS[!RemoteTech2] but I dont have the RT2 dll only the antennas models for use with AntennaRange 1.2 mod. Prior 2.1.4 the patch apply as normal but now as searching for directories this patch don't apply anymore and I have to remove the conditionals to make it work again. So if someone (As I do often) reuses parts from others mods but not the plugin itself this change can make strange things I guess. Not a real problem perhaps, but just saying.

Salud.

Link to comment
Share on other sites

Just to verify, 2.1.4 is old save safe? I had a back-up of a save from before 2.1.0 and I restored that and used 2.0.7 for the time being.

Should be, but of course bugs happen. The whole point of the recent flurry of updates is to make old save games more stable when their modules get munged by new mods. MM is also backing up your saves so if something does go wrong, you should have something to fall back to.

@Sarbian: Do we have a changelog of what was fixed in 2.1.4?

Edit: Also, do we have regexp on general matching now, or just for mangling strings? For instance, if I wanted to match on a non-zero number, can I do that now?

Edited by Starwaster
Link to comment
Share on other sites

Should be, but of course bugs happen. The whole point of the recent flurry of updates is to make old save games more stable when their modules get munged by new mods. MM is also backing up your saves so if something does go wrong, you should have something to fall back to.

@Sarbian: Do we have a changelog of what was fixed in 2.1.4?

Edit: Also, do we have regexp on general matching now, or just for mangling strings? For instance, if I wanted to match on a non-zero number, can I do that now?

I've done a change-log for all the stuff I've done here: https://github.com/sarbian/ModuleManager/releases

Regexp for string munging only. As Sarbian has pointed out - if you want to do complex stuff with configs then write a mod to do it. The more stuff pushed into MM, the more chance there is for it to go wrong.

Link to comment
Share on other sites

Can the next version detect if Persistent File Backup Generator is installed and disable its own backups in that case? Really not necessary to have it done twice, also destroys the PFBG backup files (they all end up the same as the main file) and you have to copy them back in from the backup directory MM created.

Link to comment
Share on other sites

Just a note, when you have parts that are hidden due to being deprecated, the text that says how many parts are hidden is over top of the number of parts patched so it's just a jumble of non-readable text.

Link to comment
Share on other sites

Anywhere I try to do something like this

!mesh = DELETE
MODEL
{
model = some/model/url
}

in a +PART

I get an array index error in log and no part.

Help?

EDIT:

It seems you can't delete/replace MODEL nodes, only add/edit.

Edited by Taverius
Link to comment
Share on other sites

Anywhere I try to do something like this

!mesh = DELETE
MODEL
{
model = some/model/url
}

in a +PART

I get an array index error in log and no part.

Help?

Did you change at least the name?

@name = new unique name

!mesh = DELETE

stuff

This works for me ie:


+PART[tele_bay]
{
!mesh = DELETE
@name = tele_bayS
@mass = 0.005
%rescaleFactor = 0.60
@title = Service Bay Compact
@description = Our I+D team managed to reduce the size of this component.
// --- node definitions ---
// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z
@node_stack_bottom = 0.0, -0.45, 0.0, 0.0, -0.6, 0.0, 1
@node_stack_top1 = 0.0, 0.45, 0.0, 0.0, 0.6, 0.0, 1
@node_stack_top2 = 0.0, -0.36, 0.0, 0.0, 0.6, 0.0, 0
MODEL,0
{
model = CactEye/Parts/tele_bay/model
position = 0.0, 0.0, 0.0
scale = 1, 1, 1
rotation = 0, 0, 0
texture = model000, CactEye/Parts/tele_bay/model000
texture = model001, CactEye/Parts/tele_bay/model001_NRM
texture = model002, CactEye/Parts/tele_bay/model002
texture = model003, CactEye/Parts/tele_bay/model003
}
}

Edited by agises
Link to comment
Share on other sites

No need to change the name. He found a real bug.

I just released 2.1.5 that fix it

ModuleManager.2.1.5.dll

ModuleManager-2.1.5.zip

If he or anyone is duplicating a part, the name on the duplicate part had better change.

Either because it explicitly gets changed by the duplication config or because ModuleManager gets coded to automagically change the name.

The consequences of not doing so are having two duplicate parts in the VAB/SPH and then actually taking that part into the world and having it revert to the first part that KSP encounters with that name.

i.e. you have two parts with the same name. The first one just a static part, the second has modules and/or resources. In the VAB you will see them as two separate parts and the changes that differentiate them are apparent. However, in the 'real world' only the static part is ever loaded because that was the first one that had that name when KSP went to look up that part.

Link to comment
Share on other sites

He was adding a MODEL node, they don't have a name. And MM will not duplicate a PART if a new name is not provided :


print("[ModuleManager] Error while processing " + mod.config.name + " the copy needs to have a different name than the parent (use @name = xxx)");

Link to comment
Share on other sites

He was adding a MODEL node, they don't have a name. And MM will not duplicate a PART if a new name is not provided :


print("[ModuleManager] Error while processing " + mod.config.name + " the copy needs to have a different name than the parent (use @name = xxx)");

Ahhh I only saw agises' example

Link to comment
Share on other sites

Hi, I was trying to apply Vanguard Ejection Seats to all the command modules but remote controlled ones. But it's quite troubling to select only manned modules.

I tried using

@PART[*]:HAS[@MODULE[ModuleCommand]:HAS[#minimumCrew[1]]]

but ended up selecting all the command modules.

Also, I tried,

@PART[*]:HAS[@MODULE[ModuleCommand],@MODULE[ModuleCommand]:HAS[!RESOURCE[ElectricCharge]]]

But some mods(example: Computer Core from KSP Interstellar) doesn't define the ElectricCharge resource in the MODULE{name=ModuleCommand} node.

Would you kindly show me some hints?

Thank you.

Edited by Taris
Link to comment
Share on other sites

I've been trying to fix this for hours, and I please need someone else to take a look because I just cannot figure it out.

I'm using TACLS and FusTek Station Parts. I'm also using a config I found to modify TACLS to use litres, instead of kerbal/day units.

I'm trying have two configs, one that sets an amount of water, oxygen etc for the station parts in kerbal/day units, as per default TACLS. Then I want a second config to run and multiply the amounts by whatever amount is required to convert to Litres. I actually did this yesterday and it was working. Today it is not working. I can not figure out why.

Anyway, config #1:


@PART[FusTekKarmonyHabModule*]:FOR[TacLifeSupport]
{
RESOURCE
{
name = Food
amount = 40
maxAmount = 40
}
RESOURCE
{
name = Water
amount = 40
maxAmount = 40
}
RESOURCE
{
name = Oxygen
amount = 40
maxAmount = 40
}
RESOURCE
{
name = Waste
amount = 0
maxAmount = 40
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 40
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 40
}
}
...
// with further @Part blocks for the other modules.

Config #2:


@PART[*]:HAS[@MODULE[ModuleCommand]]
{
@RESOURCE[Food]
{
@amount *= 0.317
@maxAmount *= 0.317
}
@RESOURCE[Water]
{
@amount *= 1.798
@maxAmount *= 1.798
}
@RESOURCE[Oxygen]
{
@amount *= 304.27
@maxAmount *= 304.27
}
@RESOURCE[CarbonDioxide]
{
@maxAmount *= 261.78
}
@RESOURCE[Waste]
{
@maxAmount *= 0.56
}
@RESOURCE[WasteWater]
{
@maxAmount *= 1.98
}
}

@PART[Tac*]
{
@RESOURCE[Food]
{
@amount *= 0.317
@maxAmount *= 0.317
}
@RESOURCE[Water]
{
@amount *= 1.798
@maxAmount *= 1.798
}
@RESOURCE[Oxygen]
{
@amount *= 304.27
@maxAmount *= 304.27
}
@RESOURCE[CarbonDioxide]
{
@maxAmount *= 261.78
}
@RESOURCE[Waste]
{
@maxAmount *= 0.56
}
@RESOURCE[WasteWater]
{
@maxAmount *= 1.98
}
}
@PART[FusTek*]
{
@RESOURCE[Food]
{
@amount *= 0.317
@maxAmount *= 0.317
}
@RESOURCE[Water]
{
@amount *= 1.798
@maxAmount *= 1.798
}
@RESOURCE[Oxygen]
{
@amount *= 304.27
@maxAmount *= 304.27
}
@RESOURCE[CarbonDioxide]
{
@maxAmount *= 261.78
}
@RESOURCE[Waste]
{
@maxAmount *= 0.56
}
@RESOURCE[WasteWater]
{
@maxAmount *= 1.98
}
}
//etc etc going down other mods. (Yeah that could be better, I know. I don't think it's the problem though)

I've tried adding :FINAL and :AFTER[TacLifeSupport] to the second config, but with no effect other than to cause errors to be logged when I use :FINAL. Like this:


[LOG 02:30:19.629] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[Tac*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.631] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.633] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[somnam*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.634] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[HexCan*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.636] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacAirFilter]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.638] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacCarbonExtractor*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.640] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacWaterSplitter]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0
[LOG 02:30:19.642] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacWaterPurifier*]:FINAL
System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0

The end result is always the same, the FusTek Station parts have 40 units of stuff in them, instead of the amount I want.

Hopefully someone can see what I'm doing wrong, and why this started acting up all of a sudden.

Link to comment
Share on other sites

For the love of god can we please get one damn site for this mod!!!!!! Every time I load a new mod it has a newer version of module manager and when I come to this site it's still a lower version of the module. The last mod I added had modulemanager.2.4.4 yet I cannot find an OFFICIAL version of that ANYPLACE! Not in the curse site, not in the forums, not on spaceport! So where is the damn OFFICIAL site for this mod please?

Link to comment
Share on other sites

For the love of god can we please get one damn site for this mod!!!!!! Every time I load a new mod it has a newer version of module manager and when I come to this site it's still a lower version of the module. The last mod I added had modulemanager.2.4.4 yet I cannot find an OFFICIAL version of that ANYPLACE! Not in the curse site, not in the forums, not on spaceport! So where is the damn OFFICIAL site for this mod please?

Calm yourself. What mod ships with 2.4.4?

Link to comment
Share on other sites

Calm yourself. What mod ships with 2.4.4?

Okay. I think it was procedural fairing or infernal robotics but I can understand if its a typo. I can see how 2.1.4 got changed to 2.4.4. Will grab and install 2.1.5. Thanks.

Link to comment
Share on other sites

Followup to my post above. I've taken all the values from the first MM config file, and put them directly into the part configs, so that only one MM config file is trying to set the values. No change at all.

When I don't use :FINAL in the second config I showed above, the log makes it look like it's working:


[LOG 11:57:10.616] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyStorModule/FusTekKarmonyStorModule
[LOG 11:57:10.617] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyStorModuleAdapter/FusTekKarmonyStorModuleAdapter
[LOG 11:57:10.618] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyUtilModule/FusTekKarmonyUtilModule
[LOG 11:57:10.620] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyUtilModule_Adapter/FusTekKarmonyUtilModuleAdapter

No errors coming up, so I think 'Oh good, it's working'. NOPE. None of the changes in TAC_changeunits are being applied. When I look at the parts in the VAB, it's as if that config file didn't exist.

This is completely doing my head in. No one has any ideas as to why this has started happening?

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