Jump to content

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


sarbian

Recommended Posts

  • 2 weeks later...

 I am trying to write a simple patch that adjusts engine thrusts based on a formula taking into account their mass, vac isp, and atm isp. I started off with something simple, just trying to replace the thrust with the vacuum ISP then multiply it by a number, but I can't get it to work. Ultimately I would to have [thrust] =[constant] x [isp atm] + [constant] x [isp vac] + [constant ] * mass] or something like this. Below is what I have so far but it does not really seem to do anything. Any help would be super appreciated!

@PART[*]:HAS[@MODULE[ModuleEngines*]]:FINAL
{
    @MODULE[ModuleEngines*]
    {
 
        @maxThrust = #$/atmosphereCurve/key,0[1,]$
        @maxThrust *= 2
    }
}

    Edit: I was able to solve my own problem. I fit a trend line to a list of real rockets and found a thrust (N) ~ (-3 * ISP (seconds) + 1850) * mass (kg). I had to scale it down to be balance for KSP so I added a final multiplier to balance.

 

@PART[*]:HAS[@MODULE[ModuleEngines*]]:FINAL
{
    @MODULE[ModuleEngines*]
    {
		@maxThrust = #$/MODULE[ModuleEngines*]/atmosphereCurve/key,0[1, ]$
		@maxThrust *= -3
		@maxThrust += 1850
		@maxThrust *= #$../mass$
		@maxThrust *= 0.24
    }
} 	

 

Edited by tlion
Link to comment
Share on other sites

  • 3 weeks later...

How can I use a variable inside a curve key?

I tried the following:

atmosphereCurve
{
    key = 0 #$../../../../../origIspVac$ * 2.56
    key = 1 186
}

But the value does not get computed. Checking on MuduleManager.ConfigCache it looks exactly so, when it should have the value attributed to that variable (the relative path seems to be correct)

This is the complete patch:

  Reveal hidden contents

 

Edited by mateusviccari
Link to comment
Share on other sites

  On 11/8/2021 at 10:28 AM, Gordon Dry said:

@mateusviccari is origIspVac on the root node? Yes.

Then try #$/origIspVac$

Expand  

Well that's a million times better, but still not the culprit. I just found out that I can't type a variable after the "0 ". If I put the variable by itself, after the "=" it works. Guess I'll just have to find how to concatenate the fixed number with the variable.

Link to comment
Share on other sites

  On 11/8/2021 at 10:10 PM, Gordon Dry said:

Oh well, it's kinda text string, so you need RegEx voodoo. But don't ask me, I was just coming back from hiatus a week ago ...

Expand  

Never mind, I did it by applying more patches, here's the solution if it comes in handy for future passersby:

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 2 weeks later...

How do I target a part with a module X and without a module Y?

I'm trying to target all engines except the RAPIER engine. I tried:

@PART[*]:HAS[@MODULE[ModuleEngines*]]:HAS[!MODULE[MultiModeEngine]]

But no matter where I put the exclamation mark, it never works, since it always targets the rapier engine regardless. What am I doing wrong?

EDIT: Forget I asked, turns out we can only have one HAS in the filter, and this is how it should be done:

@PART[*]:HAS[@MODULE[ModuleEngines*],!MODULE[MultiModeEngine]]

Edited by mateusviccari
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  On 12/23/2021 at 1:12 PM, modus said:

Maybe you should ask this in the FTT thread? But:

I don't think those containers are from FTT, they're from MKS. Do you have that installed?

What version of FTT/MKS (or any other usi mod) do you use? What ksp version?

 

Expand  

Yeah, i had both tabs open and posted in the wrong one... Using the entire latest constellation with everything. UmbraSpaceIndustries_112.0.1-bleeding-edge.2 / ksp 1.12.3
i went and posted in the Umbra thread already. Thanks.

Link to comment
Share on other sites

I'm having trouble understanding the syntax in a few module manager patches I've seen. Can anyone explain what these three (unrelated) examples do? Number 3, in particular, is a complete enigma to me.

1	@PitchTorque *= #$/mass$
2	@description ^= :Unpressurized::
3	@title ^= :(.)$:$0 (UNPRESSURIZED) :

 

Link to comment
Share on other sites

  On 12/23/2021 at 1:28 PM, Kwebib said:

I'm having trouble understanding the syntax in a few module manager patches I've seen. Can anyone explain what these three (unrelated) examples do? Number 3, in particular, is a complete enigma to me.

1	@PitchTorque *= #$/mass$
2	@description ^= :Unpressurized::
3	@title ^= :(.)$:$0 (UNPRESSURIZED) :

 

Expand  
  1. multiplies PitchTorque * mass of same part
  2. inserts "Unpressurized:" at the start of the part description
  3. same as #2, but uses a ReEx (Regular Expression) to place the insertion

https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax

Link to comment
Share on other sites

I'm getting a warning from modulemanager (during the loading screen), caused by one of my configs. I'm pretty new to MM patching, and after some looking around, I still can't seem to find where that warning is logged. (perhaps it isn't?) Is there a file somewhere where it says what that warning was about exactly?

If it helps, this is the MM patch that caused it, but I don't know why this code would be problematic:
(although I do know it is likely caused by the first line)

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 12/30/2021 at 9:37 PM, Knight of St John said:

I'm getting a warning from modulemanager (during the loading screen), caused by one of my configs. I'm pretty new to MM patching, and after some looking around, I still can't seem to find where that warning is logged. (perhaps it isn't?) Is there a file somewhere where it says what that warning was about exactly?

Expand  

You should provide all your logs to help in troubleshooting this issue.

 

  On 12/30/2021 at 9:37 PM, Knight of St John said:

If it helps, this is the MM patch that caused it, but I don't know why this code would be problematic:
(although I do know it is likely caused by the first line)

  Quote

@PART[nuclearEngine]:NEEDS[B9PartSwitch&Waterfall&StockWaterfallEffects&Upsilon]:FOR[Upsilon]:AFTER[StockWaterfallEffects]

Expand  
Expand  

I'm a bit rusty on MM configs, but one problem I'm sure of--though I don't think it's the cause of your issue--is that "Upsilon" should not be in both NEEDS and FOR.

FOR means this MM config is part of mod "Upsilon".  NEEDS means that this MM config isn't part of any of the mods listed, but needs those mods to work properly.  Only one of these is true.

Edited by Jacke
Link to comment
Share on other sites

How can I edit the wasteheat storage amount? For example, I want to increase the maximum storage of wasteheat of heatfin to 1000000. I tried to create a MyPatches.cfg under GameData. Here is what I did:

@PART[heatfin2]
{
    @RESOURCE[WasteHeat]
    {
        @amount *= 400
        @maxAmount *= 400
    }
}

 

In VAB and SPH it appears that this editing is effective because the statistic displayed is changed. But once I hit launch and right click the heatfin, the maximum wasteheat is still not changed. This is very puzzling to me. Can someone help?

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