Jump to content

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


sarbian

Recommended Posts

Greetings,

Are other logical operators, besides simple boolean equivalence, currently implemented inside of the :HAS function when searching for parts to patch? Let me clarify, I am looking to search for parts with specific ranges of vacuum ISP. I would prefer not to have to create a 450+ section configuration file for this task, but i understand is this is simply what will have to be done. I am working on a sort of "Real Fuels Lite", for lack of a better term, simply matching only a couple types of imaginary fuels (and oxidizers) with specific ranges of ISP, just to make things more interesting than stock, but still have the ability to do relatively simple orbital refueling. Obviously, because I am only looking to break this up into three or four ranges of ISP performance, it would be convenient to only have to write a couple segments of code, instead of 450+, which would make the tweaking process much faster.

Thanks!

Edited by saabstory88
Link to comment
Share on other sites

Having a bit of a snag searching for components to patch. I have tried the following configuration, with no matches, and no patches applied. Searching for all liquid fuel engines with an vac isp (key=0 390) of 390, of which I know at least one exists in the stock game. I am assuming I have made a syntax error, can someone give me direction on this?

I am using the latest release: 2.3.1

My code:

@PART
[*]:HAS[@MODULE[ModuleEngines]:HAS[@atmosphereCurve[0?390]]]:HAS[@MODULE[ModuleEngines]:HAS[@PROPELLANT[LiquidFuel]]]:FOR[MoreRealisticFuels]

Log snippet:




[LOG 20:57:55.080] [ModuleManager] Checking NEEDS.
[LOG 20:57:55.103] [ModuleManager] :FIRST (default) pass
[LOG 20:57:55.105] [ModuleManager] :BEFORE[ASSEMBLY-CSHARP] pass
[LOG 20:57:55.106] [ModuleManager] :FOR[ASSEMBLY-CSHARP] pass
[LOG 20:57:55.107] [ModuleManager] :AFTER[ASSEMBLY-CSHARP] pass
[LOG 20:57:55.108] [ModuleManager] :BEFORE[MODULEMANAGER.2.3.1] pass
[LOG 20:57:55.109] [ModuleManager] :FOR[MODULEMANAGER.2.3.1] pass
[LOG 20:57:55.110] [ModuleManager] :AFTER[MODULEMANAGER.2.3.1] pass
[LOG 20:57:55.111] [ModuleManager] :BEFORE[MOREREALISTICFUELS] pass
[LOG 20:57:55.112] [ModuleManager] :FOR[MOREREALISTICFUELS] pass
[LOG 20:57:55.242] [ModuleManager] :AFTER[MOREREALISTICFUELS] pass
[LOG 20:57:55.243] [ModuleManager] :BEFORE[NASAMISSION] pass
[LOG 20:57:55.244] [ModuleManager] :FOR[NASAMISSION] pass
[LOG 20:57:55.244] [ModuleManager] :AFTER[NASAMISSION] pass
[LOG 20:57:55.245] [ModuleManager] :BEFORE[SQUAD] pass
[LOG 20:57:55.245] [ModuleManager] :FOR[SQUAD] pass
[LOG 20:57:55.246] [ModuleManager] :AFTER[SQUAD] pass
[LOG 20:57:55.247] [ModuleManager] :FINAL pass
[LOG 20:57:55.249] [ModuleManager] ModuleManager: 0 patches applied, 0 hidden items

Edited by saabstory88
Clarity
Link to comment
Share on other sites

Think you need something like this

@PART[*]:HAS[ @MODULE[ModuleEngines] , @atmosphereCurve[0?390] ] ]:HAS[@MODULE[ ModuleEngines] , @PROPELLANT[LiquidFuel]]]:FOR[MoreRealisticFuels]

Or
@PART[*]:HAS[ @MODULE[ModuleEngines]:HAS[ @atmosphereCurve[0?390] ] ]:HAS[@MODULE[ ModuleEngines]:HAS[ @PROPELLANT[LiquidFuel] ] ]:FOR[MoreRealisticFuels]

EDIT- by look at the examples

Search for module with a specific configuration

All PART who have a ModuleEngines using XenonGas as a propelant (space for clarity)

Code:

@PART[*]:HAS[ @MODULE[ModuleEngines]:HAS[ @PROPELLANT[XenonGas] ] ]

{

...(stuff)

}

Combine search

All PART who have a ModuleEngines and have a SolidFuel ressource (space added for clarity)

Code:

@PART[*]:HAS[ @MODULE[ModuleEngines] , @RESOURCE[solidFuel] ]

{

...(stuff)

}

Edited by Mecripp2
Link to comment
Share on other sites

I must be misunderstanding something even more basic. I created the following, to do a basic swap of resource types in the stock tanks (obviously this is not the final version of this file). This is the file in its entirety. It does not function as I would expect.

Edit: I went ahead and checked, I can successfully make changes using the @PART

[*] command with no arguments. However, this is not ultimately what I would like to do.

KSP.log and Player.log do not show anything which helps me debug this.

Permutations:


@PART
[*]:HAS[RESOURCE[LiquidFuel]]:AFTER[Squad]:FOR[MoreRealisticFuels]
{
@RESOURCE[LiquidFuel]
{
@name = LiquidH2
}
@RESOURCE[Oxidizer]
{
@name = LiquidO2
}
}


@PART
[*]:HAS[RESOURCE[LiquidFuel]]:AFTER[Squad]
{
@RESOURCE[LiquidFuel]
{
@name = LiquidH2
}
@RESOURCE[Oxidizer]
{
@name = LiquidO2
}
}


@PART
[*]:HAS[RESOURCE[LiquidFuel]]:FOR[MoreRealisticFuels]
{
@RESOURCE[LiquidFuel]
{
@name = LiquidH2
}
@RESOURCE[Oxidizer]
{
@name = LiquidO2
}
}

This is still a no go.

Edited by saabstory88
Clarity
Link to comment
Share on other sites

With fixed brackets, no error, no success:


@PART
[*]:HAS[@MODULE[ModuleEngines]:HAS[@atmosphereCurve[0?390]]]:HAS[@MODULE[ModuleEngines],@PROPELLANT[LiquidFuel]]:FOR[MoreRealisticFuels]

These variations were also not successful:


@PART
[*]:HAS[@MODULE[ModuleEngines]:HAS[@atmosphereCurve
[*]:HAS[#key[0?390]]]]


@PART
[*]:HAS[@MODULE[ModuleEngines]:HAS[@atmosphereCurve
[*]#key[0?390]]]

Original post:

No, MM reports an error, but it did not log it in either the KSP.log or the Player.log

Full code:


@PART
[*]:HAS[@MODULE[ModuleEngines],@atmosphereCurve[0?390]]]:HAS[@MODULE[ModuleEngines],@PROPELLANT[LiquidFuel]]]:FOR[MoreRealisticFuels]
{
@MODULE[ModuleEngines]
{
@PROPELLANT[LiquidFuel]
{
@name = LiquidH2
@ratio = 1
}
@PROPELLANT[Oxidizer]
{
@name = LiquidO2
@ratio = 4
}
}
}

And this one didn't work ?
Edited by saabstory88
Update
Link to comment
Share on other sites

So, taking this from another tack, would it be possible to grab the value from "key", and write it as a new value, of say ISP, in the header of the PART config instead of below atmosphereCurve, and then run a second .cfg to filter by that number instead, which would be available with a simple "@PART

[*]:HAS[iSP[0?390]]"?

Link to comment
Share on other sites

Have you try'ed

@PART[*]:HAS[@MODULE[ModuleEngines],@atmosphereCurve[0?390]:FOR[MoreRealisticFuels]]

{

@MODULE[ModuleEngines]

{

@PROPELLANT[LiquidFuel]

{

%name = LiquidH2

%ratio = 1

}

@PROPELLANT[Oxidizer]

{

%name = LiquidO2

%ratio = 4

}

}

}

Link to comment
Share on other sites

Well I certainly appreciate the help. This sort of selection may not even be supported by the current version of MM. That's ok. I've migrated to a tech level dependent version of fuel selection, which also sets the peak isp based on the fuel source. It might be ok for the first version. Anyway, much appreciated, as this is my first day playing with MM. I will move further development to a dedicated post.

Thanks!

Link to comment
Share on other sites

@atmosphereCurve[0?390] will not work since it try to find an atmosphereCurve whose "name" is "0 390".

@atmosphereCurve[]:HAS[#key[0?390]] would get what you want but would not work since the ? does not work here. I might have to fix that ...

Link to comment
Share on other sites

Official release of Version 2.3.3

Module Manager is now integrated with the loading screen. You'll see the info message a bit later in the loading process.

Fix the /= and -= operator (the argument where inverted)

Link to comment
Share on other sites

Official release of Version 2.3.3

Module Manager is now integrated with the loading screen. You'll see the info message a bit later in the loading process.

Fix the /= and -= operator (the argument where inverted)

FYI, this loading later is breaking things like RealFuels which modifies some resources like SolidFuel or XenonGas to a different density.

I never tried 2.3.2, but 2.3.1 working fine, 2.3.3 has broke the way in which RealFuels does it's thing.

Edited by RedAV8R
Link to comment
Share on other sites

I believe I've also found a bug in 2.3.3 vs. 2.3.1. The :HAS[~setting[]] seems to be misapplied:

// Add tech tree support to parts that don't have it.
@PART[*]:HAS[~TechRequired[]]
{
TechRequired = advMetalworks
}

It seems to match nearly every part in 2.3.3, regardless of the TechRequired setting. I can provide a log if needed, but in my haste to fix the problem I reset my logs.

I also stumbled across another problem that I just wanted to share: The stock ModuleScienceLab module requires a containerModuleIndex setting that refers to the zero-based index of the module collection where it must find ModuleScienceContainer. This should be nice and safe for parts that define these modules in their original .cfg, but should someone want to add ModuleScienceLab capabilities to other modules via MM, then care must be taken to keep this reference valid. (Maybe MM can check/fix this up on the Final pass?) The problem manifests in-game in the VAB/SPH by the right-click/tweakables menus no longer working for any part and in the log by something like:

[ModuleScienceLab]: No Container Module found at index 0
NullReferenceException: Object reference not set to an instance of an object
at ModuleScienceLab.updateModuleUI () [0x00000] in <filename unknown>:0
at ModuleScienceLab.onPartActionUI (.Part p) [0x00000] in <filename unknown>:0
at EventData`1[Part].Fire (.Part data) [0x00000] in <filename unknown>:0
at UIPartActionWindow.CreatePartList () [0x00000] in <filename unknown>:0
at UIPartActionWindow.Setup (.Part part, DisplayType type, UI_Scene scene) [0x00000] in <filename unknown>:0
at UIPartActionController.CreatePartUI (.Part part, DisplayType type, UI_Scene scene) [0x00000] in <filename unknown>:0
at UIPartActionController.SelectPart (.Part part, Boolean allowMultiple) [0x00000] in <filename unknown>:0
at UIPartActionController.HandleMouseClick (UnityEngine.Camera cam, Boolean allowMultiple) [0x00000] in <filename unknown>:0
at UIPartActionController+.MoveNext () [0x00000] in <filename unknown>:0
(Filename: Line: -1)

Edited by ozraven
Clarification and ModuleScienceLab information.
Link to comment
Share on other sites

Hi Sarbian, not sure if this is better posted here or in the RSS thread (so I x-posted in both :P): I've experienced a small bug with Real Solar System and the newer versions of Module Manager. With version 2.2.2 the various launch sites on Earth show up fine. [spoiler=]lDZrsdT.png

However with 2.3.x they disappear - in fact the buttons to toggle them don't show up either [spoiler=]OcWMwHy.png

In the output logs 0 launch sites are being loaded with 2.3.x, while the normal 22 are loaded with 2.2.2. Link to logs: using version 2.2.2 and version 2.3.3

My GameData folder: [spoiler=]bqFSH9E.png

. All mods are latest versions AFAIK, RSS is version 7.2.

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