BIOZ Posted October 9, 2021 Share Posted October 9, 2021 43 minutes ago, Lisias said: #/MODULE[ModuleEnginesFX]/atmosphereCurve { } I didn't know # can be used this way. I've tried it on my configs, it works perfectly. Many thanks! Quote Link to comment Share on other sites More sharing options...
WilliamW2010 Posted October 19, 2021 Share Posted October 19, 2021 Could you conside putting the latest download link at either the top or bottom of your post for easy access? Quote Link to comment Share on other sites More sharing options...
tlion Posted October 19, 2021 Share Posted October 19, 2021 (edited) 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 October 19, 2021 by tlion Quote Link to comment Share on other sites More sharing options...
mateusviccari Posted November 8, 2021 Share Posted November 8, 2021 (edited) 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: Spoiler @PART[*]:HAS[@MODULE[ModuleEngines]] { origIspVac = #$/MODULE[ModuleEngines]/atmosphereCurve/key,0[1, ]$ origIspSL = #$/MODULE[ModuleEngines]/atmosphereCurve/key,1[1, ]$ MODULE { name = ModuleB9PartSwitch moduleID = rssSurealismFuelMixture switcherDescription = Fuel mixture switcherDescriptionPlural = Fuel mixtures affectDragCubes = false affectFARVoxels = false switchInFlight = false advancedTweakablesOnly = false uiGroupName = rssSurealismFuelMixtures uiGroupDisplayName = Fuel mixtures SUBTYPE { name = Monopropellant title = Monopropellant addedMass = 0 addedCost = 0 MODULE { IDENTIFIER { name = ModuleEngines } DATA { PROPELLANT{} PROPELLANT{} PROPELLANT { name = Monopropellant ratio = 1 DrawGauge = True } atmosphereCurve { key = 0 #$../../../../../origIspVac$ * 2.56 key = 1 186 } } } } } } Edited November 8, 2021 by mateusviccari Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted November 8, 2021 Share Posted November 8, 2021 (edited) @mateusviccari is origIspVac on the root node? Yes. Then try #$/origIspVac$ Edited November 8, 2021 by Gordon Dry Quote Link to comment Share on other sites More sharing options...
mateusviccari Posted November 8, 2021 Share Posted November 8, 2021 11 hours ago, Gordon Dry said: @mateusviccari is origIspVac on the root node? Yes. Then try #$/origIspVac$ 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. Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted November 8, 2021 Share Posted November 8, 2021 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 ... Quote Link to comment Share on other sites More sharing options...
mateusviccari Posted November 8, 2021 Share Posted November 8, 2021 10 minutes ago, 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 ... Never mind, I did it by applying more patches, here's the solution if it comes in handy for future passersby: Spoiler @PART[*]:HAS[@MODULE[ModuleEngines]] { origIspVac = #$/MODULE[ModuleEngines]/atmosphereCurve/key,0[1, ]$ origIspSL = #$/MODULE[ModuleEngines]/atmosphereCurve/key,1[1, ]$ MODULE { name = ModuleB9PartSwitch moduleID = rssSurealismFuelMixture switcherDescription = Fuel mixture switcherDescriptionPlural = Fuel mixtures affectDragCubes = false affectFARVoxels = false switchInFlight = false advancedTweakablesOnly = false uiGroupName = rssSurealismFuelMixtures uiGroupDisplayName = Fuel mixtures SUBTYPE { name = RP1_LOX title = RP1+LOX addedMass = 0 addedCost = 0 MODULE { IDENTIFIER { name = ModuleEngines } DATA { PROPELLANT{} PROPELLANT{} PROPELLANT { name = Kerosene ratio = 0.4 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6 } atmosphereCurve { key = 0 6662 //Placeholder, will be changed later key = 1 6661 //Placeholder, will be changed later } } } } SUBTYPE { name = Monopropellant title = Monopropellant addedMass = 0 addedCost = 0 MODULE { IDENTIFIER { name = ModuleEngines } DATA { PROPELLANT{} PROPELLANT{} PROPELLANT { name = Monopropellant ratio = 1 DrawGauge = True } atmosphereCurve { key = 0 6662 //Placeholder, will be changed later key = 1 6661 //Placeholder, will be changed later } } } } } } //Applies the original engine ISP @PART[*]:HAS[@MODULE[ModuleEngines]] { @MODULE[ModuleB9PartSwitch] { @SUBTYPE[*],* { @MODULE,0 { @DATA,1 { @atmosphereCurve { @key,0[1, ] = #$/origIspVac$ @key,1[1, ] = #$/origIspSL$ } } } } } } //Multiplies the engine ISP to make them usable in RSS @PART[*]:HAS[@MODULE[ModuleEngines]] { @MODULE[ModuleB9PartSwitch] { @SUBTYPE[Monopropellant] { @MODULE,0 { @DATA,1 { @atmosphereCurve { @key,0[1, ] *= 2.0 @key,1[1, ] *= 2.0 } } } } @SUBTYPE[RP1_LOX] { @MODULE,0 { @DATA,1 { @atmosphereCurve { @key,0[1, ] *= 2.3 @key,1[1, ] *= 2.3 } } } } } } Quote Link to comment Share on other sites More sharing options...
mateusviccari Posted November 17, 2021 Share Posted November 17, 2021 (edited) 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 November 17, 2021 by mateusviccari Quote Link to comment Share on other sites More sharing options...
zer0Kerbal Posted November 30, 2021 Share Posted November 30, 2021 (edited) how does one escape a # character? I want to replace a localization string using a patch; MM finds the string, but when putting it back it leaves the '#' off. Edited November 30, 2021 by zer0Kerbal Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted November 30, 2021 Share Posted November 30, 2021 10 minutes ago, zer0Kerbal said: how does one escape a # character? I want to replace a localization string using a patch; MM finds the sting, but when putting it back it leaves the '#' off. backslash? Quote Link to comment Share on other sites More sharing options...
zer0Kerbal Posted November 30, 2021 Share Posted November 30, 2021 22 minutes ago, linuxgurugamer said: backslash? thanks, but no joy. Quote Link to comment Share on other sites More sharing options...
dragonsfx Posted December 23, 2021 Share Posted December 23, 2021 (edited) Sorry, posted in wrong thread. Edited December 23, 2021 by dragonsfx Quote Link to comment Share on other sites More sharing options...
modus Posted December 23, 2021 Share Posted December 23, 2021 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? Quote Link to comment Share on other sites More sharing options...
dragonsfx Posted December 23, 2021 Share Posted December 23, 2021 3 minutes ago, 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? 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. Quote Link to comment Share on other sites More sharing options...
Kwebib Posted December 23, 2021 Share Posted December 23, 2021 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) : Quote Link to comment Share on other sites More sharing options...
softweir Posted December 23, 2021 Share Posted December 23, 2021 On 11/30/2021 at 5:10 PM, zer0Kerbal said: how does one escape a # character? I want to replace a localization string using a patch; MM finds the string, but when putting it back it leaves the '#' off. If the strings are parsed as HTML then &35; or even # might, possibly work. Quote Link to comment Share on other sites More sharing options...
zer0Kerbal Posted December 24, 2021 Share Posted December 24, 2021 15 hours ago, 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) : multiplies PitchTorque * mass of same part inserts "Unpressurized:" at the start of the part description same as #2, but uses a ReEx (Regular Expression) to place the insertion https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax Quote Link to comment Share on other sites More sharing options...
Kwebib Posted December 24, 2021 Share Posted December 24, 2021 Nice. Thank you. Looks like I need to read up on Regexes. Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted December 25, 2021 Share Posted December 25, 2021 I was looking at the WIKI for this, noticed that either I missed it or it isn't documenting the :LAST Can someone confirm this or point me to the correct page? Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted December 25, 2021 Share Posted December 25, 2021 https://github.com/net-lisias-ksp/ModuleManager/wiki/Patch-Ordering Quote Link to comment Share on other sites More sharing options...
Knight of St John Posted December 30, 2021 Share Posted December 30, 2021 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) Spoiler @PART[nuclearEngine]:NEEDS[B9PartSwitch&Waterfall&StockWaterfallEffects&Upsilon]:FOR[Upsilon]:AFTER[StockWaterfallEffects] { MODULE { name = ModuleB9PartSwitch moduleID = plumeSwitch switcherDescription = Plume switcherDescriptionPlural = Plumes affectDragCubes = false affectFARVoxels = false switchInFlight = true SUBTYPE { name = default title = Nerv plume } SUBTYPE { name = hermes1 title = hermes hydrogen antimatter plume MODULE { IDENTIFIER { name = ModuleWaterfallFX } DATA { TEMPLATE { name = plume templateName = upsilon-hermes-hydrogen-antimatter scale = 1,1,1 rotation = 0,0,0 position = 0,0.0,0 } TEMPLATE { name = core templateName = upsilon-empty scale = 1,1,1 rotation = 0,0,0 position = 0,0.0,0 } } } } SUBTYPE { name = empty title = empty MODULE { IDENTIFIER { name = ModuleWaterfallFX } DATA { TEMPLATE { name = plume templateName = upsilon-empty scale = 1,1,1 rotation = 0,0,0 position = 0,0.0,0 } TEMPLATE { name = core templateName = upsilon-empty scale = 1,1,1 rotation = 0,0,0 position = 0,0.0,0 } } } } } } Quote Link to comment Share on other sites More sharing options...
Jacke Posted December 30, 2021 Share Posted December 30, 2021 (edited) 10 minutes ago, 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? You should provide all your logs to help in troubleshooting this issue. 10 minutes ago, 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] 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 December 30, 2021 by Jacke Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted December 30, 2021 Share Posted December 30, 2021 either FOR or AFTER Quote Link to comment Share on other sites More sharing options...
jack_kang Posted January 2, 2022 Share Posted January 2, 2022 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.