Jump to content

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


sarbian

Recommended Posts

1 hour ago, maja said:

Hi, I found in USI Tools two patches, that aren't for some reason applied. I tried to find a solution but to no avail, so I'm here :)

The two patches are following:


@PART[*]:HAS[!MODULE[USI_ModuleFieldRepair],@RESOURCE[Machinery|EnrichedUranium|DepletedFuel|Recyclables]]:FOR[USITools]
{
    MODULE
    {
        name = USI_ModuleFieldRepair
    }
}

@PART[*]:HAS[!MODULE[USI_ModuleRecycleBin],@RESOURCE[MaterialKits]]:FOR[USITools]
{
    MODULE
    {
        name = USI_ModuleRecycleBin
    }
}

If I omit the @RESOURCE part in the HAS block, then the patches are applied as intended. What's wrong there?

You can’t use OR or | in a HAS block. Though it should work but be limited to only the first entry, in this case: Machinery. 

Edited by Jognt
Link to comment
Share on other sites

10 hours ago, Jognt said:

You can’t use OR or | in a HAS block. Though it should work but be limited to only the first entry, in this case: Machinery. 

That may be it. The second one will not be working on the part I tried, because it doesn't have MaterialKits as I recall. I must test it more. Thanks :)

EDIT: When I splitted it, it worked. I can continue in my game :D

Edited by maja
Link to comment
Share on other sites

yelp!

I use MM 4.1.1 which only got one small change about Firespitter warning message.

So besides that it should be the same as MM 4.1.0, right?

Now I got something weird, I guess my game is borked because of this (and other still unrecovered ones):

  1. I got NOT RP-0 (aka. RP-1) installed
  2. I got the part Utility_InfoDrive installed (solo, extracted from B9_Aerospace, worked for long time this way)
  3. I got a patch in my zFinal folder:
    @PART[Utility_InfoDrive]:NEEDS[B9_Aerospace,RP-0]
    {
    	@TechRequired = unlockParts
    	%RSSROConfig = true
    	%RP0conf = true
    }
    
    @PART[Utility_InfoDrive]:NEEDS[B9_InfoDrive,RP-0]
    {
    	@TechRequired = unlockParts
    	%RSSROConfig = true
    	%RP0conf = true
    }
    

    This patch worked until I went on hiatus 3 months ago.

  4. Now without RP-1 in my setup, the MM cache tells me this:

    UrlConfig
    {
    	parentUrl = B9_InfoDrive/Parts/Utility_InfoDrive/Utility_InfoDrive.cfg
    	PART
    	{
    		name = Utility_InfoDrive
    		module = Part
    		author = Snjo + bac9
    		mesh = model.mu
    		scale = 1
    		node_attach = 0, 0.0, 0, 0.0, -1.0, 0.0
    		TechRequired = unlockParts
    
    ...
    
    		RSSROConfig = true
    		RP0conf = true
    
    ...

     

So, what is wrong? Is the MM syntax logic totally changed? Does a comma in a NEEDS is no more an AND but an OR now?

Edited by Gordon Dry
Link to comment
Share on other sites

28 minutes ago, Gordon Dry said:

 

  1. I got NOT RP-0 (aka. RP-1) installed

The installation instructions for RP-1 say:

Quote
  • Download the RC Branch of RP-1 from here: https://github.com/KSP-RO/RP-0/tree/RC
  • Inside the downloaded zip, navigate to the GameData folder and copy the RP-0 folder into your installed GameData folder.

That would mean RP-1 is installed in a directory named "RP-0". The :NEEDS[...,RP-0] would still match because of this (or if there's any directory named "RP-0" anywhere in your GameData folder).

32 minutes ago, Gordon Dry said:

This patch worked until I went on hiatus 3 months ago.

Odd. Did you reinstall RP-1 since then?

Link to comment
Share on other sites

21 minutes ago, Gordon Dry said:

I DID NOT install RP-0 aka RP-1 but the result of the MM patching is if I would have.

I see. I read "I got NOT RP-0 (aka. RP-1) installed" as "(NOT RP-0)" so as to mean "I got RP-1 installed".

Still, if there's any directory named RP-0 anywhere, it would match. It certainly doesn't in my RP-0-less install, even though I copied the InfoDrive parts into B9_InfoDrive:

Quote

Mods by directory (sub directories of GameData):
  B9_InfoDrive

Deleting root node in file test node: @PART[Utility_InfoDrive]:NEEDS[B9_InfoDrive,RP-0] as it can't satisfy its NEEDS

 

Link to comment
Share on other sites

@HansAcker I got the same in my MM log

Deleting root node in file B9_InfoDrive/Parts/RO_RP-1_patch node: @PART[Utility_InfoDrive]:NEEDS[B9_Aerospace,RP-0] as it can't satisfy its NEEDS

and this is the weirdness - that means that patch is ignored - so why then the MM cache looks like the patch was NOT ignored?

btw there is ofc no RP-0 folder, just to make it clear.

@HansAcker but the OTHER patch is not ignored, the 2nd one  I listed above

@PART[Utility_InfoDrive]:NEEDS[B9_InfoDrive,RP-0]
{
	@TechRequired = unlockParts
	%RSSROConfig = true
	%RP0conf = true
}

So, this one is applied. But still - why? There is NO RP-0 existing at all, so this ALSO has to be ignored.

 

@blowfish @sarbian could it be, that when in a NEEDS is an underscore _ that a following , is misinterpreted?

I'm replacing the , with an & and try again.

Edited by Gordon Dry
Link to comment
Share on other sites

^nope, same result

New question, slightly rephrased:
@blowfish @sarbian could it be, that when inside a NEEDS is an underscore _ that a following comma , or ampersand & is misinterpreted?

Now I'm trying again by switching the places inside that patch and using a comma again:

@PART[Utility_InfoDrive]:NEEDS[RP-0,B9_Aerospace]
{
	@TechRequired = unlockParts
	%RSSROConfig = true
	%RP0conf = true
}

@PART[Utility_InfoDrive]:NEEDS[RP-0,B9_InfoDrive]
{
	@TechRequired = unlockParts
	%RSSROConfig = true
	%RP0conf = true
}

 

Link to comment
Share on other sites

Just now, Gordon Dry said:

Oh for sake of it - I found it. A bad malformed MM syntax at another place. I will inform the guy asap.
(It got a FOR where it does not belong - outside of the mentioned mod - you know what I mean)

yes, that's usually what it is (and the first thing I was going to look for in the logs)

Link to comment
Share on other sites

58 minutes ago, Gordon Dry said:

The logs did not point me in the right direction. I needed to stumble upon it after some searching inside all *.cfg

Well the log would tell you that both requirements have their passes fulfilled, which would tell you it got defined somewhere, which would tell you to do a quick search for what patch does its thing in the wrongly defined FOR pass, which would point you right where you'd need to look. :)

 

5 hours ago, maja said:

I tried to find that yesterday. If it is there, then I didn't saw that either.

 

7 hours ago, DoktorKrogg said:

Is this explained on the wiki somewhere and I'm just not seeing it?

It's .. ehhh.. somewhere in this thread I think. I learned this the same way as you did, by asking in this thread why my patch wasn't working.

Edit: I've edited the Wiki to add a line about using OR in HAS blocks and hope to god I did it properly.

Edited by Jognt
Link to comment
Share on other sites

So there I was, minding my own business, trying to figure out how to do animations in blender/unity/ksp/etc and was trying to gain some wisdom from this video:

 

And at 11:18, he's in the KSP and his part is not all that he hopes for, he goes to the Space Center view in KSP,  there's a ModuleManager dialog there and lo, it contains a "Reload Database" button.  He presses it and tada!  The fixes he just applied outside of the game are now in force in his game.  No restarting KSP required!  I've never seen a ModuleManager dialog.

How is this magic worked?  The video is pretty old so maybe it used to be a thing & isn't anymore...

 

Link to comment
Share on other sites

Is there a way to edit all parts from a given mod?

Say I wanted to scale up every part from one mod, how might I write a patch that scales them all by the same factor? Is this possible or would I need to specify each part in the patch?

Sorry if this is in the wiki. I looked and couldn't seem to find it.

Thanks for any help.

Link to comment
Share on other sites

3 hours ago, Sahadara said:

Is there a way to edit all parts from a given mod?

you'll have to look for a common identifier in the part configs. Some mods prefix the name field. There's also the author field. Maybe they are using their own manufacturer name, or a custom tag in the tags property. Maybe also all the MODEL paths are pointing to a specific mod folder you can use to ID the parts

Edited by Drew Kerman
Link to comment
Share on other sites

1 minute ago, HansAcker said:

By writing a suitable filter, probably including :HAS[...]. See the examples in the MM handbook and syntax description.

Which common identifier do you try to target?

Oh that's weird it didn't quote like I meant it to. I haven't found one yet I'll have to look. But thank you for the help! I'm just trying to figure out how to apply a patch to every part from a mod.

Link to comment
Share on other sites

4 hours ago, HansAcker said:

By writing a suitable filter, probably including :HAS[...]. See the examples in the MM handbook and syntax description.

Which common identifier do you try to target?

That technically depends on the thing you’re filtering for, but it’ll most likely involve a HAS block. 

I recommend you check the github wiki for the MM basics. 

It may be educational to check some simple CFGs for how basic MM patches look. Most mods have will have some. 

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