Sigma88 Posted May 20, 2016 Share Posted May 20, 2016 58 minutes ago, cy-one said: Might be a stupid post, but how does one do multiline comments in MM/stock configs? I usually put // at the start of each comment Not sure if /* */ works Quote Link to comment Share on other sites More sharing options...
cy-one Posted May 20, 2016 Share Posted May 20, 2016 But // is only single-line, iirc. Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 20, 2016 Author Share Posted May 20, 2016 The KSP parser only has // for comments. Quote Link to comment Share on other sites More sharing options...
Phineas Freak Posted May 20, 2016 Share Posted May 20, 2016 @cy-onei do not think that MM supports C-style comments. For now the only way is to prefix each line with the double slash. Quote Link to comment Share on other sites More sharing options...
Diazo Posted May 20, 2016 Share Posted May 20, 2016 (edited) This is a question about how MM's caching works. I use a .cfg to store settings and I've recently received several requests to move that .cfg file to a Plugin data sub-folder so that MM doesn't nuke it's cache and redo everything everytime KSP loads. (I store window positions in the .cfg file so it changes every time KSP is run.) This is simple enough on the surface, however I am running into an issue where I have actually deliberately made my .cfg file into a ConfigNode so that other mods could modify the configuration of my mod via a MM patch for their purposes. Now I am being asked to undo that work and turn my .cfg file from a ConfgiNode back into a basic settings file and hide in from MM in the Plugin data subfolder. I'm pretty sure this is mutually exclusive so I'm wondering it there was some quirk to the caching process I could maybe take advantage of? In short, is there a way to keep my .cfg file exposed so that the settings of my mod can be modified by other mods with an MM patch, but not trigger MM's cache rebuilding when the values of the window position variables saved in the file change? (It is a career overhaul mod that interacts with my AGX mod to change how action group unlocking progresses that is causing this.) D. Edited May 20, 2016 by Diazo Quote Link to comment Share on other sites More sharing options...
blowfish Posted May 20, 2016 Share Posted May 20, 2016 @Diazo How can that work? If you're writing to the file, but other mods can change it, then couldn't whatever you save could be clobbered by a patch and never take effect? Maybe there are some settings you want to be controllable by the user and some you want to expose to other mods? Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 20, 2016 Author Share Posted May 20, 2016 1 hour ago, Diazo said: This is a question about how MM's caching works. I use a .cfg to store settings and I've recently received several requests to move that .cfg file to a Plugin data sub-folder so that MM doesn't nuke it's cache and redo everything everytime KSP loads. (I store window positions in the .cfg file so it changes every time KSP is run.) This is simple enough on the surface, however I am running into an issue where I have actually deliberately made my .cfg file into a ConfigNode so that other mods could modify the configuration of my mod via a MM patch for their purposes. Now I am being asked to undo that work and turn my .cfg file from a ConfgiNode back into a basic settings file and hide in from MM in the Plugin data subfolder. I'm pretty sure this is mutually exclusive so I'm wondering it there was some quirk to the caching process I could maybe take advantage of? In short, is there a way to keep my .cfg file exposed so that the settings of my mod can be modified by other mods with an MM patch, but not trigger MM's cache rebuilding when the values of the window position variables saved in the file change? (It is a career overhaul mod that interacts with my AGX mod to change how action group unlocking progresses that is causing this.) D. The cache is cleaned if any cfg/dll (I use a hash to check) changed or if dll/cfg were added/removed. So if the content of your mod config does not change all the time there is no point in putting them in Plugin data. If some part of your file does change all the time then I would have a cfg for the part that change in the plugin data subfolder and the "static" part in the usual folder. Sorry for the work Quote Link to comment Share on other sites More sharing options...
Diazo Posted May 20, 2016 Share Posted May 20, 2016 @blowfish It's currently for changing values that are only changeable in the .cfg file anyway at this point (so they are not accessible from in-game), although you are correct that it would reset the values to whatever the MM patch is every time KSP starts if you offered this on values that could be changed in game. @sarbian So 2 config files seems to be the best solution then? Was trying to avoid that but I can make it work. D. Quote Link to comment Share on other sites More sharing options...
jstnj Posted May 21, 2016 Share Posted May 21, 2016 How the heck do I prevent MM from repatching all the config files on every startup? I thought the cache function was supposed to fix that? Any help is appreciated. I think @NathanKell mentioned something about .cfg files being in /GameData/, but I cant find his post regarding it. I have a config that adds mechjeb and KER to command pods in my GameData folder, and also my config for blizzy's toolbar. Could that be affecting the cache? Quote Link to comment Share on other sites More sharing options...
blowfish Posted May 21, 2016 Share Posted May 21, 2016 20 minutes ago, jstnj said: How the heck do I prevent MM from repatching all the config files on every startup? I thought the cache function was supposed to fix that? Any help is appreciated. I think @NathanKell mentioned something about .cfg files being in /GameData/, but I cant find his post regarding it. I have a config that adds mechjeb and KER to command pods in my GameData folder, and also my config for blizzy's toolbar. Could that be affecting the cache? MM will only use the cache if no configs or plugins have changed. It will also tell you what changed in the log. Quote Link to comment Share on other sites More sharing options...
cy-one Posted May 21, 2016 Share Posted May 21, 2016 Is there a way to filter parts that have a crew capacity > 1? Something like @PART[*]:HAS[@MODULE[ModuleScienceLab], #CrewCapacity[>1]] ? Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted May 21, 2016 Share Posted May 21, 2016 1 hour ago, cy-one said: Is there a way to filter parts that have a crew capacity > 1? Something like @PART[*]:HAS[@MODULE[ModuleScienceLab], #CrewCapacity[>1]] ? @PART:HAS[#CrewCapacity[>1]] Should do Check that the case sensitivity is right because I don't remember right now Quote Link to comment Share on other sites More sharing options...
Tahib Posted May 21, 2016 Share Posted May 21, 2016 On 20.5.2016 at 2:08 AM, blowfish said: It has no effect as in what? As in you looked at the reaction wheel values in the editor part catalog and they aren't different from their original values? Or as in you looked at ModuleManager.ConfigCache and saw that the changed didn't apply? If you want us to help you debug this, please do the following: Post the exact patch you have and the path to the .cfg file that contains it (e.g. GameData/Stuff/MyPatch.cfg) Delete GameData/ModuleManager.ConfigCache Open KSP and let it load to the main menu Post KSP.log (in the KSP root folder) and GameData/ModuleManager.ConfigCache (these are really the steps for debugging any module manager patch) The original person I wrote the tutorial for had no complaints, so it's probably some configuration issue on your end. 2.6.65 somehow fixed this. thank you anyway Quote Link to comment Share on other sites More sharing options...
cy-one Posted May 21, 2016 Share Posted May 21, 2016 On 5/20/2016 at 10:14 AM, cy-one said: Might be a stupid post, but how does one do multiline comments in MM/stock configs? Just in case someone else looks this up. Notepad++ has a short-cut (CTRL+Q) that toggles comments... You can select multiple lines and it will put // in front of each... and also remove it, when pressed again. Super handy! Quote Link to comment Share on other sites More sharing options...
xx_mortekai_xx Posted May 21, 2016 Share Posted May 21, 2016 (edited) Would the following be read as I expect? ratio = #$/MODULE[ModuleEnginesFX],0/PROPELLANT[IntakeAir]/ratio$ im trying to get the ratio value of the PROPELLANT node named IntakeAir from the first instance of ModuleEnginesFX. If this is not correct, how would I do the above? EDIT - NM, it works fine. i misplaced punctuation elsewhere. Edited May 21, 2016 by xx_mortekai_xx Quote Link to comment Share on other sites More sharing options...
Jimbodiah Posted May 21, 2016 Share Posted May 21, 2016 (edited) Question regarding changing multiple propelants... I've looked on the wiki and this thread, but I can't find anything that works for me. I'm trying to make a patch that will handle all engines in a certain mod to change the propellant ratio. Say the engine module uses two propellants but I do not know which ones (could be any of 4 combinations as fuel switch is active and different engines use different fuels). I tried this, but it only works on the first of the two propellants. Simply adding the same @PROPELLANT just changes the first one again, not the second. @PART[*]:HAS[@MODULE[ModuleEngines*]]:NEEDS[X]:AFTER[Y] @PROPELLANT { @ratio /= 2 } Then I tried the ,1 and ,2 options but this only change the second one (guessing this is not he correct approach). @PROPELLANT,1 { @ratio /= 2 } @PROPELLANT,2 { @ratio /= 2 } What am I doing wrong? Edited May 21, 2016 by Jimbodiah Quote Link to comment Share on other sites More sharing options...
xx_mortekai_xx Posted May 21, 2016 Share Posted May 21, 2016 (edited) 8 minutes ago, Jimbodiah said: Question regarding changing multiple propelants... I've looked on the wiki and this thread, but I can't find anything that works for me. I'm trying to make a patch that will handle all engines in a certain mod to change the propellant ratio. Say the engine module uses two propellants but I do not know which ones (could be any of 4 combinations as fuel switch is active and different engines use different fuels). I tried this, but it only works on the first of the two propellant. @PART[*]:HAS[@MODULE[ModuleEngines*]]:NEEDS[X]:AFTER[Y] @PROPELLANT { @ratio /= 2 } Then I tried the ,1 and ,2 options but this only change the second one (guessing this is not he correct approach). @PROPELLANT,1 { @ratio /= 2 } @PROPELLANT,2 { @ratio /= 2 } What am I doing wrong? Try this: @Part[*]:HAS[@MODULE[ModuleEngines*]]:NEEDS[X]:AFTER[Y] { @MODULE[ModuleEngines*] { @PROPELLANT[*],0 { @ratio /= 2 } @PROPELLANT[*],1 { @ratio /= 2 } } } Edited May 21, 2016 by xx_mortekai_xx Quote Link to comment Share on other sites More sharing options...
Jimbodiah Posted May 21, 2016 Share Posted May 21, 2016 Thanks. But it doesn't work. I also tried just the @Propellant[*] without the index, but same result. Quote Link to comment Share on other sites More sharing options...
blowfish Posted May 21, 2016 Share Posted May 21, 2016 38 minutes ago, Jimbodiah said: Thanks. But it doesn't work. I also tried just the @Propellant[*] without the index, but same result. @PROPELLANT,* will get all PROPRLLANT nodes. Quote Link to comment Share on other sites More sharing options...
Jimbodiah Posted May 21, 2016 Share Posted May 21, 2016 (edited) Thanks BlowFish!!!!! Then going one step further... @atmosphereCurve { @key[1, ] *= 1.1 @key,1[1, ] *= 1.1 } Is this the right way to change these values? atmosphereCurve { key = 0 310 key = 1 265 } Trying to wrap my head around the syntaxes. Edited May 21, 2016 by Jimbodiah Quote Link to comment Share on other sites More sharing options...
Jimbodiah Posted May 21, 2016 Share Posted May 21, 2016 ^ Answer is yes, just tried it... Thanks for the help guys!!!! Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted May 22, 2016 Share Posted May 22, 2016 53 minutes ago, Jimbodiah said: ^ Answer is yes, just tried it... Thanks for the help guys!!!! keep in mind that those curves may have 4 elements. (key = 1 2 3 4) if they have, and you are multiplying the second value by 1.1 (or any other number), you should also multiply the third and fourth values by the same number on the contrary, if you multiply the first value by 1.1 (or any other number) you should divide the third and fourth values by that same number Quote Link to comment Share on other sites More sharing options...
Jimbodiah Posted May 22, 2016 Share Posted May 22, 2016 Yep, indeed. In this case there are only two values though, the first relating to atm pressure and the second the ISP value at that pressure. Just wanted to check if I can grasp how the syntax works. Keep up the good work guys!!!!! Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted May 22, 2016 Share Posted May 22, 2016 11 minutes ago, Jimbodiah said: Yep, indeed. In this case there are only two values though, the first relating to atm pressure and the second the ISP value at that pressure. Just wanted to check if I can grasp how the syntax works. Keep up the good work guys!!!!! you could also use: @key,*[1, ] *= 1.1 this will apply to all "key" and multiply the second element of the list by "1.1" Quote Link to comment Share on other sites More sharing options...
toric5 Posted May 23, 2016 Share Posted May 23, 2016 im trying to nerf reaction wheels in my install, and i have this code so far: //nerfing reaction wheels @PART[*]:HAS[ModuleReactionWheel] { @MODULE[ModuleReactionWheel] { @PitchTorque /=2 @YawTorque /=2 @RollTorque /=2 } } why is this not working? 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.