Jump to content

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


sarbian

Recommended Posts

KIS needs all all crewed vessel to have Iva for the inventory to work properly.

Why not try

@PART[*]:HAS[#CrewCapacity[>0],!INTERNAL[*]]:Final
{
INTERNAL
{
name = Placeholder
}
}

This translates to "for any part that has a crew capacity of over 0 and no currently existing INTERNAL, add the Placeholder INTERNAL".

Just an aside, but what were you aiming to achieve with this?

@PART[*]:HAS[@INTERNAL[Placeholder],@INTERNAL[*]]:FINAL
{
!INTERNAL:HAS[#name[Placeholder]] {}
}

"for any parts that have Placeholder INTERNAL, or any INTERNAL, remove the INTERNAL named Placeholder"? Because that's what I think it says...

Just.. yeah, if you want to add Placeholder IVA to parts that don't have it but need it, check if the part has any crew capacity and no currently existing internal then add it..

EDIT:

I tried to make a patch to ... just remove the placeholder from parts with placeholder INTERNAL

I could be wrong, but as of KSP 1.0.4, no parts have the Placeholder INTERNAL so checking for this is unnecessary. (EDIT 2, a quick Notepad ++ search for 'Placeholder' in the Squad folder confirms this - no parts have this INTERNAL). EDIT 3, if KIS needs an INTERNAL to work correctly, why would you want to remove Placeholder INTERNAL anyway? That's guaranteed to break KIS which is almost entirely the opposite outcome desired.

Edited by ObsessedWithKSP
Link to comment
Share on other sites

What would the functional difference in these two? I guess that might help me understand my problem. Also I have never heard of < or > working is that not the case?


@PART
[*]:HAS[!INTERNAL[]]
{
foo
}
@PART
[*]:HAS[!INTERNAL
[*]]
{
foo
}

Link to comment
Share on other sites

I don't know the answer to the first question, but < and > operators have been around since MM 2.5.13.

That's what I get for using these 2 I guess... No mention of either and have never seen anyone use them. I always wanted them would make some patches much cleaner to code for. So thank you for enlightening me on that because knowing is half the battle.

Link to comment
Share on other sites

I have another question for you sarbian:

If there is a module that can have a lot of keys inside:


MODULE
{
keyone = 1
keytwo = 2
keythree = 3
keyfour = 4
keyfive = 5
keysix = 6
keyseven = 7
}

is there a way to add a key to that module only if it's missing?

let's say I have


MODULE
{
keytwo = 2
keyfour = 4
keysix = 6
}

and I want to add the missing keys (1, 3, 5, 7) BUT without knowing which key will be missing

I guess I could do:


@MODULE:HAS[~keyone[]]
{
keyone = 1
}
@MODULE:HAS[~keytwo[]]
{
keytwo = 2
}
@MODULE:HAS[~keythree[]]
{
keythree = 3
}
@MODULE:HAS[~keyfour[]]
{
keyfour = 4
}
@MODULE:HAS[~keyfive[]]
{
keyfive = 5
}
@MODULE:HAS[~keysix[]]
{
keysix = 6
}
@MODULE:HAS[~keyseven[]]
{
keyseven = 7
}

but that looks like crap. no offense :D

what if I do this:


@MODULE
{
keyone = 1
keytwo = 2
keythree = 3
keyfour = 4
keyfive = 5
keysix = 6
keyseven = 7
}

will I find myself with a MODULE that has more than one key with the same name?

or when this code "sees" that a key is already taken it just lets it alone and goes on?

thanks for the help

Sigma

edit:

maybe I could do this...


@MODULE
{
keyone = 1
!keyone,1 = DEL
keytwo = 2
!keytwo,1 = DEL
keythree = 3
!keythree,1 = DEL
keyfour = 4
!keyfour,1 = DEL
keyfive = 5
!keyfive,1 = DEL
keysix = 6
!keysix,1 = DEL
keyseven = 7
!keyseven,1 = DEL

}

Edited by Sigma88
Link to comment
Share on other sites

I'm trying to find all parts with a certain module that has a certain value, then add my own module. It works fine when the part has only one of the module, but when it has more than one I can only get results for the first module.


@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Minerals],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 32768
ResourceName = Minerals
}
}

This will find all parts with the Minerals scanner and add my own module just fine. But when a part has multiple ModuleResourceScanner modules (like the MKS_Antenna) it only catches the first instance.

So when I try to check for all of the following:


@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[MetallicOre],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 128
ResourceName = MetallicOre
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Minerals],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 32768
ResourceName = Minerals
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Substrate],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 65536
ResourceName = Substrate
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Uraninite],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 1024
ResourceName = Uraninite
}
}

@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ResourceName[Water],#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
MODULE
{
name = SCANresourceDisplay
sensorType = 8192
ResourceName = Water
}
}

It only find the Minerals scanner, the first in the MKS_Antenna config.

Is there some way of searching all modules of the same name in a config? Preferably without specifying the index, if I have to do that then it makes more sense to just target specific parts. I've tried using * as an index wild card in several different ways, but I'm not even sure if that works for HAS blocks, or at all.

Alternatively, is there some way to search through each instance of the ModuleResourceScanner module in a part, copy the ResourceName field, and apply that to my own module, adding multiple copies of my module if needed? I can specify the sensorType value in code, so all I really need to do is find all modules with ScannerType = 0 (these are surface resource scanners) and add my own module with the same resource name to that part.


@PART[*]:HAS[@MODULE[ModuleResourceScanner]:HAS[#ScannerType[0]]]:FOR[SCANsat]:NEEDS[CommunityResourcePack]
{
@MODULE[ModuleResourceScanner],*
{
ResourceName = <copy this>
}

MODULE
{
name = SCANresourceDisplay
ResourceName = <paste here>
}

.... Repeat As Needed
}

Link to comment
Share on other sites

Is it possible to tell Module Manager to activate a patch when a certain technology is unlocked? I'm trying to set it up so that the RasterPropMonitor internal patches only activate when a certain tech node is unlocked, but I don't know how to do this. Thanks in advance.

Link to comment
Share on other sites

Is placing 2.6.6.dll in GameData by itself supposed to hang the load screen? It stops loading files and just displays 'modmanager' above the loading bar. I don't know anything about adding mods other than placing their folders in the GD directory. I currently have nothing else added and it hangs the loading screen.


[LOG 06:26:50.289] [ModuleManager] Loading Physics.cfg
[WRN 06:26:50.291] File 'C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\Physics.cfg' does not exist
[WRN 06:26:50.292] Cannot create config from file 'C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\Physics.cfg'.
[WRN 06:26:50.293] File 'C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program/KSP_Data/../\Physics.cfg' does not exist
[EXC 06:26:50.299] NullReferenceException: Object reference not set to an instance of an object
ModuleManager.MMPatchLoader.LoadPhysicsConfig ()
ModuleManager.MMPatchLoader+<ProcessPatch>c__Iterator0.MoveNext ()

Edited by Mikemc
Link to comment
Share on other sites

You appear to be missing Physics.cfg. You can get it back by going into your Steam library, right-clicking on KSP, selecting Properties, going to the Local Files tab and clicking on "Verify Integrity of Game Cache...". Steam will detect that you have missing files and re-download them.

While you're at it, I would recommend moving Steam out of Program Files - KSP has been known to not like being there.

Link to comment
Share on other sites

@Mikemc

According to the log, the issue is the protections on the C:\Program Files directory. It is unfortunate that KSP is incompatible with the default security configuration of most new systems. The recommendation to move KSP out of the C:\Program Files directory should resolve your problem.

skips

Link to comment
Share on other sites

Hello.

I'm testing this piece of code:


@PART
[*]:HAS[#category[Engine]]
{
@MODULE[ModuleEnginesFX]
{
@maxThrust *= 1.2
}
}

Any idea why no engine thrust has been modified?

Did you check all the engines ? and not all stock engines are ModuleEnginesFX some are still ModuleEngines and the name of the patch file it might be running first.

Link to comment
Share on other sites

What would the functional difference in these two? I guess that might help me understand my problem. Also I have never heard of < or > working is that not the case?


@PART
[*]:HAS[!INTERNAL[]]
{
title = foo
}
@PART
[*]:HAS[!INTERNAL
[*]]
{
title = foo
}

Still unanswered.

Link to comment
Share on other sites

Can anyone tell me why this isn't working? I'm trying to use MM to condense certain repetitive bits of my code, plus make it so I don't accidentally forget to change a section.


TahvMFDConfig
{
topKey1 = value1
topKey2 = value2

CONTEXTREDIRECT
{
name = ID1
nodeKey1 = value1
nodeKey2 = value2
}
CONTEXTREDIRECT
{
name = ID2
nodeKey1 = value1
nodeKey2 = value2
}
}

%PROP:AFTER[TAHVOHCKMFD]
{
MODULE
{
PAGE
{
#@TahvMFDConfig/CONTEXTREDIRECT[ID1] {}
}
}
}

Basically for each PAGE in this config for RPM I want them to have the same redirects and I don't want to accidentally miss a page if I change something. I'm ending up with nothing listed in any of the TAHVOHCKMFD passes, though:


[LOG 21:10:55.024] [ModuleManager] :BEFORE[TAHVOHCKMFD] pass
[LOG 21:10:55.048] [ModuleManager] :FOR[TAHVOHCKMFD] pass
[LOG 21:10:55.053] [ModuleManager] :AFTER[TAHVOHCKMFD] pass
[LOG 21:10:55.060] [ModuleManager] :BEFORE[TRIGGERTECH] pass

Link to comment
Share on other sites

Hey, I wanted to thank you for all the effort you put into this and the CustomBarnKit (very much looking forward to the ability to extend building levels)!

I have quite a lot of support requests in the SETI thread of which many seem to be related to having multiple module manager versions installed.

I put an example screenshot and so on in my OP advising to delete all older MMs, but I m wondering if it is possible to

implement a fratricide function into the modulemanager.dll?

Where the youngest MM version kills all the older brothers in GameData, or at least "quarantines" them somehow?

Link to comment
Share on other sites

I might be misinterpreting some of the latest instances, eg when people changed more than removing old module managers.

But I m pretty sure I had a case where someone had a pre 2.6.2 module manager installed in addition to later ones and it messed up the techtree mod.

Will have to search for it tomorrow or so.

Link to comment
Share on other sites

Answering my own question, in case anyone has the same one later and googles this, it seems the node-copy operator only works when editing an already-existing node? If that's wrong someone please let me know, but the end result is that to do something like that make sure the node exists, then patch in the sub-node.

Moving on from that, two new questions:

1) Is there a syntax to copy a value from a different node, similar to how the node-copy can browse the whole ConfigNode tree looking for the node to copy, and if there is,

2) is it possible to copy all values with the same name by using the ,* index?

Link to comment
Share on other sites

Ok seem to be bashing my head against a wall here with module manager :P

I have a config with 4 ModuleResourceConverters. trying to delete two of the nodes with a new config.

Orginal part config


MODULE
{
name = ModuleResourceConverter
ConverterName = FoodGrow
StartActionName = Grow Food
StopActionName = Stop Growing
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = Water
Ratio = 0.2
}
INPUT_RESOURCE
{
ResourceName = Substrate
Ratio = 0.05
}
OUTPUT_RESOURCE
{
ResourceName = Food
Ratio = 3.55
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
}


MODULE
{
name = ModuleResourceConverter
ConverterName = Scrubber
StartActionName = Start Air Circulator
StopActionName = Stop Air Circulator
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = CarbonDioxide
Ratio = 51.25576627
}
OUTPUT_RESOURCE
{
ResourceName = Oxygen
Ratio = 70.92198582
}
}


MODULE
{
name = ModuleResourceConverter
ConverterName = WaterRecycler
StartActionName = Activate Water Recycler
StopActionName = Deactivate Water Recycler
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = WasteWater
Ratio = 1
}
OUTPUT_RESOURCE
{
ResourceName = Water
Ratio = 1
DumpExcess = false
}
}

MODULE
{
name = ModuleResourceConverter
ConverterName = Composter
StartActionName = Start Composter
StopActionName = Stop Composter
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 40
}
INPUT_RESOURCE
{
ResourceName = Waste
Ratio = 1.3
}
OUTPUT_RESOURCE
{
ResourceName = Substrate
Ratio = 0.08
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
}

Now trying to delete the 2nd and 3rd config, using this code (im assuming the indexing of the modules starts at 0) and these are the only 4 modules on the part.


@PART[stbiodomeFarmMk2]:NEEDS[USILifeSupport]
{
!MODULE[ModuleResourceConverter],1 {}
!MODULE[ModuleResourceConverter],2 {}

}

With that config for some reason it deletes the second and fourth config. Not understanding what im doing wrong with the syntax.

Ive also tried addressing them using the tag usage (these are my parts so added the tags to the config) no luck there either, Any help would be apprecited.

Link to comment
Share on other sites

Ok seem to be bashing my head against a wall here with module manager :P

I have a config with 4 ModuleResourceConverters. trying to delete two of the nodes with a new config.

Orginal part config


MODULE
{
name = ModuleResourceConverter
ConverterName = FoodGrow
StartActionName = Grow Food
StopActionName = Stop Growing
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = Water
Ratio = 0.2
}
INPUT_RESOURCE
{
ResourceName = Substrate
Ratio = 0.05
}
OUTPUT_RESOURCE
{
ResourceName = Food
Ratio = 3.55
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
}


MODULE
{
name = ModuleResourceConverter
ConverterName = Scrubber
StartActionName = Start Air Circulator
StopActionName = Stop Air Circulator
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = CarbonDioxide
Ratio = 51.25576627
}
OUTPUT_RESOURCE
{
ResourceName = Oxygen
Ratio = 70.92198582
}
}


MODULE
{
name = ModuleResourceConverter
ConverterName = WaterRecycler
StartActionName = Activate Water Recycler
StopActionName = Deactivate Water Recycler
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
INPUT_RESOURCE
{
ResourceName = WasteWater
Ratio = 1
}
OUTPUT_RESOURCE
{
ResourceName = Water
Ratio = 1
DumpExcess = false
}
}

MODULE
{
name = ModuleResourceConverter
ConverterName = Composter
StartActionName = Start Composter
StopActionName = Stop Composter
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = false
EfficiencyBonus = 0.00376344086021505376344086021505 // 81.3/6 hours
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 40
}
INPUT_RESOURCE
{
ResourceName = Waste
Ratio = 1.3
}
OUTPUT_RESOURCE
{
ResourceName = Substrate
Ratio = 0.08
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
}

Now trying to delete the 2nd and 3rd config, using this code (im assuming the indexing of the modules starts at 0) and these are the only 4 modules on the part.


@PART[stbiodomeFarmMk2]:NEEDS[USILifeSupport]
{
!MODULE[ModuleResourceConverter],1 {}
!MODULE[ModuleResourceConverter],2 {}

}

With that config for some reason it deletes the second and fourth config. Not understanding what im doing wrong with the syntax.

Ive also tried addressing them using the tag usage (these are my parts so added the tags to the config) no luck there either, Any help would be apprecited.

when you delete the second, the third becomes the new second and the fourth the new third

you should use:


@PART[stbiodomeFarmMk2]:NEEDS[USILifeSupport]
{
!MODULE[ModuleResourceConverter],1 {}
!MODULE[ModuleResourceConverter],1 {}
}

Link to comment
Share on other sites

when you delete the second, the third becomes the new second and the fourth the new third

you should use:


@PART[stbiodomeFarmMk2]:NEEDS[USILifeSupport]
{
!MODULE[ModuleResourceConverter],1 {}
!MODULE[ModuleResourceConverter],1 {}
}

You darn genius you.. not sure why i couldn't think of that.. Too early id imagine. :P

Cheers! All is well and good now

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