blowfish Posted December 2, 2015 Share Posted December 2, 2015 11 minutes ago, evileye.x said: I'm trying to rebalance AIES engines ISP with MM patch. The idea is If Vacuum ISP >330 , then ISP = ISP *,9 @PART[*]:NEEDS[AIES_Aerospace]:HAS[@MODULE[ModuleEngines*],#manufacturer[AIES?Aerospace]] { @MODULE[ModuleEngines*] { @atmosphereCurve { %selectcur = #$key,0[1, ]$ } } } @PART[*]:NEEDS[AIES_Aerospace]:HAS[@MODULE[ModuleEngines*],#manufacturer[AIES?Aerospace],#selectcur[>330]] { @MODULE[ModuleEngines*] { @atmosphereCurve { key0 = #$key,0[1, ]$ @key0 *= 0.9 @key,0 = #0 $key0$ key1 = #$key,1[1, ]$ @key1 *= 0.9 @key,1 = #1 $key1$ } } } Doesn't work. I don't get how to use conditions based on variables As you have it, selectcur will be inside ModuleEngines*/atmosphereCurve, but your patch is looking for it in the root part node. Best option is probably to put the check on atmosphereCurve: @atmosphereCurve:HAS[#selectcur[>330]] Quote Link to comment Share on other sites More sharing options...
sarbian Posted December 2, 2015 Author Share Posted December 2, 2015 selectcur is inside a ModuleEngines and atmosphereCurve. @PART[*]:NEEDS[AIES_Aerospace]:HAS[@MODULE[ModuleEngines*]:HAS[@atmosphereCurve:HAS[#selectcur[>330]]],#manufacturer[AIES?Aerospace]] Quote Link to comment Share on other sites More sharing options...
FlarpingFlipperFlapper Posted December 3, 2015 Share Posted December 3, 2015 What are the rules on using the // for commenting? Ive noticed this: {code} // stuff about the parts bla bla here but then: //{code} where they did not use a space. What is the correct way? Quote Link to comment Share on other sites More sharing options...
blowfish Posted December 3, 2015 Share Posted December 3, 2015 (edited) 46 minutes ago, FlarpingFlipperFlapper said: What are the rules on using the // for commenting? Ive noticed this: {code} // stuff about the parts bla bla here but then: //{code} where they did not use a space. What is the correct way? Anything after the // will be ignored. So in the second example, the code will not do anything, but in the first it will. Spaces are ignored regardless (at least in this context) Edited December 3, 2015 by blowfish Quote Link to comment Share on other sites More sharing options...
evileye.x Posted December 3, 2015 Share Posted December 3, 2015 10 hours ago, sarbian said: selectcur is inside a ModuleEngines and atmosphereCurve. Thanks, works like it should! Quote Link to comment Share on other sites More sharing options...
Svm420 Posted December 3, 2015 Share Posted December 3, 2015 (edited) Is it possible to copy a string from a node on a part and add it to the end of another string? If so how can I modify this code to work better? Thanks! Example Spoiler @PART[*]:HAS[@MODULE[MissileLauncher]] { @description ^= :$: #$/MODULE[MissileLauncher]/targetingType$.: } Edited December 3, 2015 by Svm420 Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted December 3, 2015 Share Posted December 3, 2015 26 minutes ago, Svm420 said: Is it possible to copy a string from a node on a part and add it to the end of another string? If so how can I modify this code to work better? Thanks! Example Hide contents @PART[*]:HAS[@MODULE[MissileLauncher]] { @description ^= :$: #$/MODULE[MissileLauncher]/targetingType$.: } I would go with @description = #$description$$/MODULE[MissileLauncher]/targetingType$ that line would add the content of targetingType at the end of the content of description Quote Link to comment Share on other sites More sharing options...
Black-Talon Posted December 7, 2015 Share Posted December 7, 2015 On 10/25/2013, 9:01:36, sarbian said: There is a ingame DB reload/dump menu you can open with ALT-F11 I think I found a minor bug with the "Dump DB to file" feature. SCANsat comes with a config to create an Agent with the name, "SCAN: Scientific Committee on Advanced Navigation" - and the "Dump DB to file" feature creates config files named with a path down to the Agent name. And the file can't be created since it contains a colon. At least I think that's what's going on... IsolatedStorageException: Could not find a part of the path "D:\KSP\KSP v1.00.5 (Win) - Mods\_MMCfgOutput\SCANsat.Flags.Agents.SCAN: Scientific Committee on Advanced Navigation.cfg". at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0 at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0 at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0 at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0 at ModuleManager.ModuleManager.OutputAllConfigs () [0x00000] in <filename unknown>:0 at ModuleManager.ModuleManager+<DataBaseReloadWithMM>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 Quote Link to comment Share on other sites More sharing options...
sarbian Posted December 7, 2015 Author Share Posted December 7, 2015 hum, should be an easy fix since I already have the function to clean up filenames. In the next version Quote Link to comment Share on other sites More sharing options...
Snark Posted December 8, 2015 Share Posted December 8, 2015 (edited) I've been trying to accomplish a particular task and have been scratching my head-- from the documentation, it seems like ModuleManager ought to be able to do this, but I can't for the life of me figure out what's wrong with my syntax. What I'm trying to do is to create a filter that will address every part that has an engineer specialty. (For example, consider the ISRU config file; the ModuleResourceConverter in it has "Specialty = Engineer".) The "Specialty" field shows up on modules. So basically, what I need is "every part which has any module that has a Specialty field whose value is Engineer." This is what I've been trying: @PART[*]:HAS[@MODULE[*]:HAS[#Specialty[Engineer]]] { // do stuff } ...except that this doesn't seem to work. It doesn't match any parts. (For example, if I stick a "@description ^= :(.)$:$0 Specialty for engineers.:" inside the body, nothing's description gets decorated.) I've gone round and round on this, but haven't been able to find a variation that works. On the other hand, it appears to work if I replace the MODULE designator so that it uses a specific module name instead of a wildcard, like this: @PART[*]:HAS[@MODULE[ModuleResourceConverter]:HAS[#Specialty[Engineer]]] { // do stuff } Any advice? Is this: a bug? behavior as designed? something I'm doing wrong? Edited December 8, 2015 by Snark Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted December 8, 2015 Share Posted December 8, 2015 (edited) 30 minutes ago, Snark said: I've been trying to accomplish a particular task and have been scratching my head-- from the documentation, it seems like ModuleManager ought to be able to do this, but I can't for the life of me figure out what's wrong with my syntax. What I'm trying to do is to create a filter that will address every part that has an engineer specialty. (For example, consider the ISRU config file; the ModuleResourceConverter in it has "Specialty = Engineer".) The "Specialty" field shows up on modules. So basically, what I need is "every part which has any module that has a Specialty field whose value is Engineer." This is what I've been trying: @PART[*]:HAS[@MODULE[*]:HAS[#Specialty[Engineer]]] { // do stuff } ...except that this doesn't seem to work. It doesn't match any parts. (For example, if I stick a "@description ^= :(.)$:$0 Specialty for engineers.:" inside the body, nothing's description gets decorated.) I've gone round and round on this, but haven't been able to find a variation that works. On the other hand, it appears to work if I replace the MODULE designator so that it uses a specific module name instead of a wildcard, like this: @PART[*]:HAS[@MODULE[ModuleResourceConverter]:HAS[#Specialty[Engineer]]] { // do stuff } Any advice? Is this: a bug? behavior as designed? something I'm doing wrong? I think your problem is that the second "HAS" checks only the first MODULE of any given PART try this: @PART,* { @MODULE:HAS[#Specialty[Engineer]] { // stuff } } I had a similar issue in the past and I'm not sure there's a solution. If you want to edit stuff outside the @MODULE node you can do something like this: @PART:HAS[@MODULE] { @MODULE,* { %editPart = False } @MODULE:HAS[#specialty[Engineer]] { %editPart = True } } @PART:HAS[@MODULE] { %editPart = #$MODULE/editPart$ } @PART:HAS[#editPart[True]] { // changes } @PART:HAS[#editPart[*]] { !editPart = DEL @MODULE,* { !editPart = DEL } } there's probably a more elegant way to do it, but at least this should work Edited December 8, 2015 by Sigma88 Quote Link to comment Share on other sites More sharing options...
Spagoose Posted December 8, 2015 Share Posted December 8, 2015 (edited) Can I use the following config to edit the presenceChance both resource types of XenonGas all in one (it is both atmospheric and oceanic): @GLOBAL_RESOURCE:HAS[#ResourceName[XenonGas]] { @Distribution { @PresenceChance = 100 } } Or do I have to do it for each resource type like so: @GLOBAL_RESOURCE:HAS[#ResourceName[XenonGas],#ResourceType[1]] { @Distribution { @PresenceChance = 100 } } @GLOBAL_RESOURCE:HAS[#ResourceName[XenonGas],#ResourceType[2]] { @Distribution { @PresenceChance = 100 } } For reference this is the config I am trying to alter. GLOBAL_RESOURCE { ResourceName = XenonGas ResourceType = 2 Distribution { PresenceChance = 75 MinAbundance = .001 MaxAbundance = 1 Variance = 5 } } GLOBAL_RESOURCE { ResourceName = XenonGas ResourceType = 1 Distribution { PresenceChance = 75 MinAbundance = .001 MaxAbundance = 1 Variance = 50 } } Edited December 8, 2015 by Spagoose Quote Link to comment Share on other sites More sharing options...
Snark Posted December 8, 2015 Share Posted December 8, 2015 2 hours ago, Sigma88 said: I think your problem is that the second "HAS" checks only the first MODULE of any given PART ... If you want to edit stuff outside the @MODULE node you can do something like this: <code> there's probably a more elegant way to do it, but at least this should work Excellent, that's just what I needed! Thanks. Quote Link to comment Share on other sites More sharing options...
legoclone09 Posted December 9, 2015 Share Posted December 9, 2015 Could someone please tell me how to use a MM config to change the size of a part? Like if I want to change the size+name of a fairing, what would I do? Quote Link to comment Share on other sites More sharing options...
sebi.zzr Posted December 9, 2015 Share Posted December 9, 2015 16 minutes ago, legoclone09 said: Could someone please tell me how to use a MM config to change the size of a part? Like if I want to change the size+name of a fairing, what would I do? You can try to start here:https://github.com/sarbian/ModuleManager/wiki Quote Link to comment Share on other sites More sharing options...
legoclone09 Posted December 9, 2015 Share Posted December 9, 2015 Thanks, I was using some configs from the SovietConversion mod as a guideline, will this change the fairing's size and name? Quote Link to comment Share on other sites More sharing options...
SpacedInvader Posted December 9, 2015 Share Posted December 9, 2015 (edited) Nevermind, my issue was definitely user error. Mods can delete this if they want. Edited December 9, 2015 by SpacedInvader Quote Link to comment Share on other sites More sharing options...
FlexGunship Posted December 10, 2015 Share Posted December 10, 2015 I'm trying to go through configurable tanks and re-volume them. Below is what I have (no errors, but no success). Ironically, it doesn't ruin the part as I thought it would. I expected to fail because entries in "resourceAmounts" are not exclusively comma delimited. So my hunch was that when I replaced resource amounts, var* would be empty and I'd get a bunch of zeros. But that's not what happened... instead, there was no discernible effect at all. I included a sample part in the example. @PART[TPtank1m0mA]:FOR[FuelTanksPlus]:NEEDS[!InterstellarFuelSwitch|InterstellarFuelSwitch&!CryoEngines] { MODULE { name:NEEDS[!InterstellarFuelSwitch|CryoEngines] = FSfuelSwitch name:NEEDS[InterstellarFuelSwitch&!CryoEngines] = InterstellarFuelSwitch resourceGui:NEEDS[InterstellarFuelSwitch] = LiquidFuel+Oxidizer;LiquidFuel;Oxidizer resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer resourceAmounts = 45,55;90;110 basePartMass = 0.0625 } } @PART[TP*]:HAS[MODULE[FSfuelSwitch]] { @MODULE[FSfuelSwitch] { var0 = #$resourceAmounts[0]$ var1 = #$resourceAmounts[1]$ var2 = #$resourceAmounts[2]$ var3 = #$resourceAmounts[3]$ @var0 *= 1.5 @var1 *= 1.5 @var2 *= 1.5 @var3 *= 1.5 @resourceAmounts = #$var0$,$var1$;$var3$;$var4$ } } @PART[TP*]:HAS[MODULE[InterstellarFuelSwitch]] { @MODULE[InterstellarFuelSwitch] { var0 = #$resourceAmounts[0]$ var1 = #$resourceAmounts[1]$ var2 = #$resourceAmounts[2]$ var3 = #$resourceAmounts[3]$ @var0 *= 1.5 @var1 *= 1.5 @var2 *= 1.5 @var3 *= 1.5 @resourceAmounts = #$var0$,$var1$;$var3$;$var4$ } } Any suggestions? Or is this not supported in MM? Quote Link to comment Share on other sites More sharing options...
NathanKell Posted December 10, 2015 Share Posted December 10, 2015 I don't believe you can :NEEDS values, only nodes. Although maybe that's changed. Quote Link to comment Share on other sites More sharing options...
FlarpingFlipperFlapper Posted December 10, 2015 Share Posted December 10, 2015 what does this mean? name = TankPriorityModule Quote Link to comment Share on other sites More sharing options...
blowfish Posted December 10, 2015 Share Posted December 10, 2015 5 hours ago, FlarpingFlipperFlapper said: what does this mean? name = TankPriorityModule Going to need some context on that. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted December 11, 2015 Share Posted December 11, 2015 IIRC that's from asmi's ECLSS ? Quote Link to comment Share on other sites More sharing options...
FlarpingFlipperFlapper Posted December 11, 2015 Share Posted December 11, 2015 8 hours ago, blowfish said: Going to need some context on that. Its in some of RaiderNIcks parts. Its a MODULE with brackets and a name = TankPriorityModule. Its believed to cause a bug where a fuel tank that has a built engine will fire on the launch pad for no reason even though it is way up in the staging order. 38 minutes ago, NathanKell said: IIRC that's from asmi's ECLSS ? I have no clue what that is :/ Quote Link to comment Share on other sites More sharing options...
sarbian Posted December 11, 2015 Author Share Posted December 11, 2015 I fail to see how this is related to MM. Quote Link to comment Share on other sites More sharing options...
Galileo Posted December 12, 2015 Share Posted December 12, 2015 OK so I today I noticed quite a few of my command pods do not have aero/thermal re-entry effects. In my physics tab in the alt+f12 menu show that the ModuleManager physics is loaded an not physics.cfg. I can't seem to figure out how to set physics.cfg as the default. Is there a way to do it? I'm running the 64bit work around and have a ton of mods. I hope it's an easy fix and I won't have to go mod by mod to find the culprit. I'm not home currently so I can't post a log at the moment. any suggestions? 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.