Jump to content

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


sarbian

Recommended Posts

Is there a way to get an output of every change made by MM?

I am running into a very frustrating issue with certain contract types not spawning, specifically part test contracts. At this point I believe it is due to a MM patch changing the contracts config to make them either not show up or show EXTREMELY infrequently. The thing is I have no idea where exactly said MM patch would be :( and at game load it is loading around 9302 patches :confused:

Trying to figure out why I am not getting my part test contracts has been driving me nuts for this last week, any help I can get would be greatly appreciated.

Link to comment
Share on other sites

I am running into a very frustrating issue with certain contract types not spawning, specifically part test contracts. At this point I believe it is due to a MM patch changing the contracts config to make them either not show up or show EXTREMELY infrequently. The thing is I have no idea where exactly said MM patch would be :( and at game load it is loading around 9302 patches :confused:

Let me guess : You have TextureReplacer but do not have ATM installed ? If yes you get the bug I noticed where TR corrupt the game DB. I posted in the thread but had no replies. I guess I'll have to write the part for TR myself.

Link to comment
Share on other sites

The output log lists the location of patches applied and what to and the ConfigCache (I believe) contains every cfg in full including their patches. Between the two of them, you should be able to find where the patch is and what it's doing.
Let me guess : You have TextureReplacer but do not have ATM installed ? If yes you get the bug I noticed where TR corrupt the game DB. I posted in the thread but had no replies. I guess I'll have to write the part for TR myself.

Else, open the config cache as suggested above (using any text editor) and search for "MaximumExistent" (better yet, if you have Notepad++, search for "Test\r\n\t\t{" which will take you straight to the part test contracts)

This is what my config looks like for that section

Test
{
MaximumExistent = 9999
Expiration
{
MinimumExpireDays = 1
MaximumExpireDays = 3
DeadlineDays = 426
}
Funds
{
MaximumBaseFunds = 500
}
Science
{
RewardMultiplier = 0.3
}
Reputation
{
RewardMultiplier = 40
FailureMultiplier = 30
}
}

Link to comment
Share on other sites

Regarding the cost balancing I was talking about earlier, I still don't understand the correct syntax it seems.

This is an example part, LV-909:


PART
{
cost = 750
mass = 0.5


MODULE
{
name = ModuleEngines
minThrust = 0
maxThrust = 50
PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}
atmosphereCurve
{
[COLOR="#FF0000"][B]key = 0 390[/B] // How do I make MM find this?
[/COLOR]key = 1 300 // and this while we're at it?
}
}
}

Say I want cost = 10 * mass * atmosphereCurve, key,0. How do I make MM fetch the value for key, 0 (390)?

This is what I've got.


@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer]],!MODULE[MultiModeEngine]]:FOR[CostBalanceProjectLOL]
{
@cost = 10
@cost * = #$mass$
[COLOR="#FF0000"]@cost * = #$../../atmosphereCurve/key,0$[/COLOR] // well this is not working
}

Now cost equals 10*mass, but my attempt at getting the key, 0 is not correctly written.

I appreciate all help I can get.

Link to comment
Share on other sites

This is the complex case :)

Doc reminder :

Now the value itself :

ratio // gets you the value called ratio

ratio,1 // gets you the second value called ratio

ratio[2] gets you the third comma separated field ( so if the value is "1,2,4,8,16" you get 4 )

ratio[2, ] gets you the third space separated field

ratio[2,/] gets you the third / separated field (you get it now I hope)

so it should be:

@cost * = #$../../atmosphereCurve/key,0[1, ]$

Key first occurrence, second space separated field. (I guess you want the 390 ?)

Link to comment
Share on other sites

Though I now understand what "space separated, comma separated etc" means, the syntax (that is how you use that word right?) you provided still doesn't make vacuum ISP a factor for cost. Cost is still just 10*mass.

Ps. Yes I wanted the 390, although now I can use any key I want as long as this works at all in the first place :)

Edit: MM gives me 53 errors in that patch still btw.

Link to comment
Share on other sites

Well removing spaces still gives the same result.

KSP.log says this about every engine:

[LOG 17:32:54.970] [ModuleManager] Applying node /CostBalance/@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer]],!MODULE[MultiModeEngine]]:FINAL to SXT/Parts/Engine/NERVA/part/SXTNERVA

[LOG 17:32:54.972] [ModuleManager] Cannot parse variable search when editing key cost = #$../../atmosphereCurve/key,0[1, ]$

Link to comment
Share on other sites

@cost *= #$/MODULE[ModuleEngines[COLOR="#FF0000"]*[/COLOR]]/atmosphereCurve/key,0[1, ]$

Thank you very much Sarbian. That finally did it! :) I'll probably be back in this thread again, if not this time, definately when I try to balance RF engines taking ullage, ignition times, throttle capabilities and ModuleEngineConfigs stuff etc into consideration.

Link to comment
Share on other sites

Is it possible to use OR in the HAS[] portion? I've tried HAS[module[1]|module[2]] and HAS[module[1|2]] and some others that I was sure wouldn't work. I can get AND working just fine so it seems like it should be possible. At the moment I'm just making multiple copies for each module but it would be nice to clean it up a bit.

Link to comment
Share on other sites

Question, is it posible to execute a MM script when a certain part is not found?

There's no set of conditionals that would match such a state.

Also, MM by its very nature exists to modify ConfigNodes such as PART, MODULE, INTERNAL, etc. Those are the only places a MM patch executes. It doesn't arbitrarily execute anything outside of such a node.

Link to comment
Share on other sites

There's no set of conditionals that would match such a state.

Also, MM by its very nature exists to modify ConfigNodes such as PART, MODULE, INTERNAL, etc. Those are the only places a MM patch executes. It doesn't arbitrarily execute anything outside of such a node.

What about detecting the exisitng of a subfolder inside a Mod folder. For example "UmbraSpaceIndustries\WarpDrive". Could this somehow work?

what about the Dll inside a mod. Could I filter on the existance of a "WarpEngine.dll" or "WarpEngine"

If your mod includes a DLL put all your MM patch nodes in the :FOR[yourMod] pass.

Assuming WarpEngine.dll does not exist, does that mean the following MM code should work?


@PART[MyPart]:NEEDS[!WarpEngine]
{
..
}

Edited by FreeThinker
Link to comment
Share on other sites

What about detecting the exisitng of a subfolder inside a Mod folder. For example "UmbraSpaceIndustries\WarpDrive". Could this somehow work?

No. It does not work with subfolders and I will not make it work with subfolders. I hate the ModderOrCompany/ModName convention.

Assuming WarpEngine.dll does not exist, does that mean the following MM code should work?


@PART[MyPart]:NEEDS[!WarpEngine]
{
..
}

Yes, it should.

Link to comment
Share on other sites

Need help lol can someone tell me what's wrong with my cfg trying to replace the sound with the launch clamp but it's not working here is what, I have tryed

@PART[launchClamp1]:AFTER[squad]

{

!sound_decoupler_fire {} Have tryed DELETE here also

sound_dcp_clamp_bullettarp_v0100 = activate

}

@PART[launchClamp1]:AFTER[squad]

{

!sound_decoupler_fire {} Have tryed DELETE here also

A.R.P/Sounds/sound_dcp_clamp_bullettarp_v0100 = activate

}

@PART[launchClamp1]:AFTER[squad]

{

@fx_gasBurst_white = 0.0, 1.354437, 0.8369194, 0.0, 0.0, 1.0, activate

!sound_decoupler_fire {} Have tryed DELETE here also

%A.R.P/Sounds/sound_dcp_clamp_bullettarp_v0100 = activate

}

From looking at the debug menu the sounds are loaded.

Edited by Mecripp2
Link to comment
Share on other sites

When I edit a part, is

@part[]:FOR[Mymod]:AFTER[mod1] checking if mod1 exists? Or is the part patched even, if it doesn't exist? So i'll have to write @part[]:FOR[mymod]:AFTER[mod1]:NEEDS[mod1]?

Link to comment
Share on other sites

When I edit a part, is

@part[]:FOR[Mymod]:AFTER[mod1] checking if mod1 exists? Or is the part patched even, if it doesn't exist? So i'll have to write @part[]:FOR[mymod]:AFTER[mod1]:NEEDS[mod1]?

I don't believe FOR and AFTER can be used together. FOR tells it to do the patch during Mymod's time while the AFTER is telling it to do it right after mod1's time.

But AFTER still runs even if mod1 is not detected. So it needs NEEDS.

Link to comment
Share on other sites

I don't believe FOR and AFTER can be used together.
Ah, ok if that is correct, that means no one can tell to @PART:wink: after mymod. It would be just :FINAL?

So what would be the correct expression, if for example mod1 tells his parts to use technodes of Community Tech Tree, but mymod tells, that's unresearchable. Now there comes SETI and want to change the technode too and I've my personal cfg with FINAL.

Edited by funk
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...