Certain MM patch not applying #24
-
This mm patch does not seem to work: Details@part:HAS[@module[ModuleB9PartSwitch],#&/ModuleB9PartSwitch/baseVolume&>0]:FINAL
} All other MM patches seem to function |
Beta Was this translation helpful? Give feedback.
Replies: 49 comments 87 replies
-
[scratch that] |
Beta Was this translation helpful? Give feedback.
-
Ok. Let's try again.
You want to add 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 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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
As well the location of the file. Tell me the full patchname of the patchfile too. |
Beta Was this translation helpful? Give feedback.
-
Full patch: |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I will try your updated patch soon |
Beta Was this translation helpful? Give feedback.
-
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 I think there's a small syntax error somewhere on this file. MM is absolutely tragic on handling errors. It's really shameful. |
Beta Was this translation helpful? Give feedback.
-
Uhh... WAIT... Why are you using
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Your edited patch, using $ instead of &, is also ignored. B9PS still works. Any idea what the issue is? |
Beta Was this translation helpful? Give feedback.
-
well, the MM unit tests tells us differently:
See? When the value is on the current context, not even The correct syntax would be:
Not even $ is used on And yes, it's confusing and MM doesn't makes thing easier by just ignoring errors like this one. It's the reason I gave up trying to be "smart" and gone brute force, patching part by name, one by one, exactly like I want them to be. Don't fool yourself, if something goes wrong on the user's machine later, you will be as lost as you were now. :/ Attached the fixed file: Fixed_Patches.cfg.txt |
Beta Was this translation helpful? Give feedback.
-
Well, I simulated again (for speeding the tests) the target environment using the following synthetic patch:
This will add a ModuleB9PartSwitch to every PART in the game, and then will add another one only for I managed to reproduce the user's error reported above. Now I have something to work with. |
Beta Was this translation helpful? Give feedback.
-
New Synthetic Test Environment. I'm using this to check the patches while I (fail to) build them:
|
Beta Was this translation helpful? Give feedback.
-
Oukey, finally some results. The following patch will look for all B9PS modules and will use the last one's This IS NOT what you want yet. The next step is to convince this piece of crap to only assign the I think we can simplify a bit this thing, but this is also another fight to yet another day!! 😜
|
Beta Was this translation helpful? Give feedback.
-
Revisited solution. Tried to get rid of renaming the module's name, but got stuck on something that may be a bug on MM, or perhaps another idiosyncrasy due reading values from the original buffer, and writing on the new. I will need to check the MM code to be sure. In a way or another, follows the thing for historical purposes. This version of the patch have exactly the same results of the previous one (i.e., the last B9PS module's
|
Beta Was this translation helpful? Give feedback.
-
@ProgrammerFailure , I released a new Module Manager /L with a shitload of new log messages to screw your filesystem's I/O. In order to activate them, you will need to edit
I hope this will help us a bit on the problem at hands. |
Beta Was this translation helpful? Give feedback.
-
You said that the problem is that: The attribution on the inner patch tries to get the baseVolume from the first ModuleB9PartSwitch module - and then borks because exactly this one doesn't have the damned value. So if I set the :HAS clause to search only the first ModuleB9PartSwitch for baseVolume, then the error would be gone correct? Just not sure if it would still apply to everything it applies to right now. |
Beta Was this translation helpful? Give feedback.
-
Oukey, back to basics. The following patch:
Is not working on this step:
Because the Now I need to figure out if I'm using this Evidences:
MM Patch Log: MMPatch.log noteThis log was made using the current dev branch, the code is not released yet. |
Beta Was this translation helpful? Give feedback.
-
@ProgrammerFailure , I managed to simplify the patch (now only one However... I think that this patch should be applying the last >0
Evidence: excerpt from ConfigCache (terribly verbose, that
Excerpts from the MM Patch Log:
|
Beta Was this translation helpful? Give feedback.
-
Creating another "thread" for a proposal of a MM patch to find the biggest value of a list of values. Now that we established that looking for the biggest of two values is feasible, I want to extend the solution to many ones. The initial setup is
The idea is to iterate on Caveats:
Working on this now. |
Beta Was this translation helpful? Give feedback.
-
Oukey... My initial attempt of sorting 2 numbers was plenty of syntax errors. The correct one follows:
And it works, as the ConfigCache tells me:
Now proceeding to the multiple (3 or more) values stunt. |
Beta Was this translation helpful? Give feedback.
-
This is my initial proof of concept for getting the biggest of an arbitrary quantity of numbers:
it just decrements every first index 10 times. It works:
|
Beta Was this translation helpful? Give feedback.
-
Oukey, found a way! And it ended up being simpler than @ProgrammerFailure attempt.
and it gives me:
|
Beta Was this translation helpful? Give feedback.
-
I found a way of selecting the biggest of a series of numbers, what satisfies the initial problem. From where the numbers came, what to do with the biggest one and how to do the needed house cleaning after is left as an exercise to the reader. In a final thought, this doesn't worth it. We spent weeks bashing our sorry arses on a problem that could be solved quickly using an external script building "dumb" patches for an specific add'on. I don't want to even think on how many man/hours were spent on this stunt, neither what I could do with them instead. Complexity piles up quickly, you are going to get an unmaintainable zeitgeist way sooner than you expect. Been there, done that. I gone hard coded way with https://github.com/TweakScale/Companion/ for a reason! |
Beta Was this translation helpful? Give feedback.
-
@ProgrammerFailure , I think this release will interest you: https://github.com/KSP-ModularManagement/ModuleManager/releases/tag/RELEASE%2F4.2.3.4 |
Beta Was this translation helpful? Give feedback.
-
I completely forgot about this. Sorry. I have some unrelated issues to carry on this WeekEnd, but I will do my best to come back to this ASAP. |
Beta Was this translation helpful? Give feedback.
Oukey, found a way! And it ended up being simpler than @ProgrammerFailure attempt.
and it gives me: