You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You want to add WBIConvertibleStorage to every PART that have B9PS and those baseVolume attribute is bigger than 0.
Well, I can't tell if the thing is working as intended only with the MM log. I need the ConfigCache too, so I can inspect whatever is there to see why this patch didn't worked as intended.
Obviously, this patch will not be applied on parts without the :HAS satisfied - are you absolutely sure the patch applying B9PS was applied first? You see, :FINAL loses it's meaning if everybody uses it: patches are applied in alfabetical order when having the same priority.
For example, the following patches WILL NOT work are intended:
Forgot to mention, the patch is in the My_Patches file, but I have also tried it in a separate file, and when I did that, the file did not show up in "MMPatch.log". When I checked the ConfigSHA file, it was recorded by MM.
Regarding order of patches, I have the near future mods which use B9PS. Those have part definitions, so it should apply before the :FINAL right? Those parts have functional B9PS switchers.
Forgot to mention, the patch is in the My_Patches file, but I have also tried it in a separate file, and when I did that, the file did not show up in "MMPatch.log". When I checked the ConfigSHA file, it was recorded by MM.
Attach the whole patch file too. I think things are slightly simpler than it looks.
Well, the best way to see what happens is running it on my rig. If course no patches will be applied, as I don't have anything installed on it, but I will be able to at least see them being deleted, what I didn't found on your log.
I will be back to you in half an hour give or take.
Weird... I installed B9PS on my rig just to see the patching happening and... you appears to be right. MM is silently ignoring the patches mentioning baseVolume, but it's applying the others.
I think there's a small syntax error somewhere on this file. MM is absolutely tragic on handling errors. It's really shameful.
I wrote the patch after checking the Sarbian MM wiki, where it said to use &. Must have misinterpreted something. So I should replace & with $? I'll test that when I get home.
Edit: I have checked some part configs, and it seems like the problematic parts have no baseVolume; they just have resource values and a B9PartSwitch module. I probably just need to change the :HAS condition.
[ModuleManager] INFO: Applying update My patches/Edited_WBI_Convertible_Storage/@part:HAS[@module[ModuleB9PartSwitch]:HAS[#baseVolume[>0]]]:FINAL to CryoTanks/Parts/HydrogenTanks/hydrogen-inline/hydrogen-10-1.cfg/PART[hydrogen-10-1]
[ModuleManager] ERROR: Error - Cannot parse variable search when inserting new key capacityFactor = #$/ModuleB9PartSwitch/baseVolume$ at Log:0
My bad. The code I wrote was trying to fetch the baseVolume from a node labeled ModuleB9PartSwitchinside the current section (a "son"), not outside it (a "brother"). I also failed on specifying the node's label (MODULE).
Additionally, I forgot the @ on the division statement. You can't apply math statements on values that doesn't previously exists, so the need for @.
I tried this changes before publishing it to you, it worked as intended here.
And yeah, I find all these little deviations from the common sense absolutely annoying. Doing it when sleepy is, additionally, not exactly the best of ideas.
This patch has a weird effect; previously it was throwing ~100 something errors, now it throws just 38. Still seems like capacityFactor defaulting to 1, because all parts had the same capacity in-game.
This is the error it throws now:
Details
[ModuleManager] INFO: Applying update My patches/Edited_WBI_Convertible_Storage/@part:HAS[@module[ModuleB9PartSwitch]:HAS[#baseVolume[>0]]]:FINAL to CryoTanks/Parts/HydrogenTanks/hydrogen-inline/hydrogen-10-1.cfg/PART[hydrogen-10-1]
[ModuleManager] WARNING: Cannot find key baseVolume in MODULE
[ModuleManager] ERROR: Error - Cannot parse variable search when inserting new key capacityFactor = #$../MODULE[ModuleB9PartSwitch]/baseVolume$ at Log:0
On a personal note, this is yet another MM idiosyncrasy that I don't understand why wasn't fixed by the mainstream. If the value doesn't exists, it should return false, damnit!!. This is a :HAS clause after all, the absense of the value means the :HAS should return false and life goes on!
Note to my future self
I'm using Forum MM for these testings to rule out any hypothetical side effect induced by my fork.
Activity
Lisias commentedon Mar 8, 2024
[scratch that]
Lisias commentedon Mar 8, 2024
Ok. Let's try again.
You want to add
WBIConvertibleStorageto every PART that have B9PS and thosebaseVolumeattribute is bigger than 0.Well, I can't tell if the thing is working as intended only with the MM log. I need the ConfigCache too, so I can inspect whatever is there to see why this patch didn't worked as intended.
Obviously, this patch will not be applied on parts without the
:HASsatisfied - are you absolutely sure the patch applying B9PS was applied first? You see,:FINALloses it's meaning if everybody uses it: patches are applied in alfabetical order when having the same priority.For example, the following patches WILL NOT work are intended:
Because the first patch will be ran first for sure, when the B9PS patch below wasn't executed yet.
ProgrammerFailure commentedon Mar 8, 2024
Forgot to mention, the patch is in the My_Patches file, but I have also tried it in a separate file, and when I did that, the file did not show up in "MMPatch.log". When I checked the ConfigSHA file, it was recorded by MM.
Here is ConfigCache and ConfigSHA
ConfigCache.txt
ConfigSHA.txt
ProgrammerFailure commentedon Mar 8, 2024
Regarding order of patches, I have the near future mods which use B9PS. Those have part definitions, so it should apply before the :FINAL right? Those parts have functional B9PS switchers.
Lisias commentedon Mar 8, 2024
Attach the whole patch file too. I think things are slightly simpler than it looks.
If I would write that pach, I would write it as:
Case matters.
Lisias commentedon Mar 8, 2024
As well the location of the file. Tell me the full patchname of the patchfile too.
ProgrammerFailure commentedon Mar 8, 2024
Full patch:
My_Patches.txt
The location of the file is "D:\Games\KSP instances\Kerbal Space Program\GameData\My patches\My_Patches.cfg"
Lisias commentedon Mar 8, 2024
Well, the best way to see what happens is running it on my rig. If course no patches will be applied, as I don't have anything installed on it, but I will be able to at least see them being deleted, what I didn't found on your log.
I will be back to you in half an hour give or take.
ProgrammerFailure commentedon Mar 8, 2024
I will try your updated patch soon
Lisias commentedon Mar 8, 2024
Weird... I installed B9PS on my rig just to see the patching happening and... you appears to be right. MM is silently ignoring the patches mentioning
baseVolume, but it's applying the others.I think there's a small syntax error somewhere on this file. MM is absolutely tragic on handling errors. It's really shameful.
Lisias commentedon Mar 8, 2024
Uhh... WAIT... Why are you using
&? If you want the value of something you use#$....$(dollar sign)!&is used for boolean operations on conditional clausues (:HAS, etc) and for creating nodes...Lisias commentedon Mar 8, 2024
The patch looks right (once you use $ instead of &). I had toyed a bit with this on Forum once.
However, it is being ignored on my rig too.
ProgrammerFailure commentedon Mar 8, 2024
I wrote the patch after checking the Sarbian MM wiki, where it said to use &. Must have misinterpreted something. So I should replace & with $? I'll test that when I get home.
8 remaining items
Lisias commentedon Mar 8, 2024
Completely overlook it. Change to:
MM doesn't do math without some effort.
ProgrammerFailure commentedon Mar 9, 2024
This throws the following error:
Details
[ModuleManager] INFO: Applying update My patches/Edited_WBI_Convertible_Storage/@part:HAS[@module[ModuleB9PartSwitch]:HAS[#baseVolume[>0]]]:FINAL to CryoTanks/Parts/HydrogenTanks/hydrogen-inline/hydrogen-10-1.cfg/PART[hydrogen-10-1]
[ModuleManager] ERROR: Error - Cannot parse variable search when inserting new key capacityFactor = #$/ModuleB9PartSwitch/baseVolume$ at Log:0
full MMPatch.log:
MMPatch.log
The patch in question:
Edited_WBI_Convertible_Storage.cfg.txt
Lisias commentedon Mar 9, 2024
My bad. The code I wrote was trying to fetch the
baseVolumefrom a node labeledModuleB9PartSwitchinside the current section (a "son"), not outside it (a "brother"). I also failed on specifying the node's label (MODULE).Additionally, I forgot the
@on the division statement. You can't apply math statements on values that doesn't previously exists, so the need for@.I tried this changes before publishing it to you, it worked as intended here.
And yeah, I find all these little deviations from the common sense absolutely annoying. Doing it when sleepy is, additionally, not exactly the best of ideas.
ProgrammerFailure commentedon Mar 9, 2024
This patch has a weird effect; previously it was throwing ~100 something errors, now it throws just 38. Still seems like capacityFactor defaulting to 1, because all parts had the same capacity in-game.
This is the error it throws now:
Details
[ModuleManager] INFO: Applying update My patches/Edited_WBI_Convertible_Storage/@part:HAS[@module[ModuleB9PartSwitch]:HAS[#baseVolume[>0]]]:FINAL to CryoTanks/Parts/HydrogenTanks/hydrogen-inline/hydrogen-10-1.cfg/PART[hydrogen-10-1]
[ModuleManager] WARNING: Cannot find key baseVolume in MODULE
[ModuleManager] ERROR: Error - Cannot parse variable search when inserting new key capacityFactor = #$../MODULE[ModuleB9PartSwitch]/baseVolume$ at Log:0
MMPatch.log
Edited_WBI_Convertible_Storage.cfg.txt
The patch looks correct to me, so I don't understand the problem.
Edit: Found the error; the patch applies to parts without a baseVolume as well as parts with baseVolume > 0. The :HAS condition is definitely broken.
Lisias commentedon Mar 9, 2024
On a side note, you will find some nice patches here:
https://forum.kerbalspaceprogram.com/topic/139980-130-community-database-of-module-manager-patches-for-stock-ksp/
I'm investigating this new issue now - I didn't saw this one coming, I don't know B9PS and I had assumed that every part had a
baseVolume.Lisias commentedon Mar 9, 2024
On a personal note, this is yet another MM idiosyncrasy that I don't understand why wasn't fixed by the mainstream. If the value doesn't exists, it should return false, damnit!!. This is a :HAS clause after all, the absense of the value means the :HAS should return false and life goes on!
Note to my future self
I'm using Forum MM for these testings to rule out any hypothetical side effect induced by my fork.
Lisias commentedon Mar 9, 2024
Yep. Try this:
It appears to work on my synthetic test bed.
Note to my future self
Synthetic test bed follows (not to be used by the user!!):
Lisias commentedon Mar 9, 2024
@ProgrammerFailure can I close this "ticket" as concluded?
ProgrammerFailure commentedon Mar 10, 2024
This change seems to have made MM ignore the patch again. At this point, I am just closing the ticket and giving up on converting the tanks.
Lisias commentedon Mar 10, 2024
@ProgrammerFailure , my bad (again). Typo.
The correct patch would be:
(note the extra
#on the:HASbefore the firstbaseVolume).Note to my future self:
Synthetic test (not to be used by the user):
MM Config Cache: ConfigCache.cfg.zip
Evidence:
Only
trussAdapterhave theWBIConvertibleStoragenow, and with the correctcapacityFactor:Lisias commentedon Mar 10, 2024
Reopening it to move it into a discussion.