Sigma88 Posted July 9, 2015 Share Posted July 9, 2015 (edited) If I want to remove a key from all the modules in a part, can I do it with this?@PART[partname]{ @MODULE[*] { !key = DEL }}I don't know why, but I had to do this in order to make it work@PART[partname]{ @MODULE:HAS[#key[*]] { !key = DEL }} Edited July 9, 2015 by Sigma88 Quote Link to comment Share on other sites More sharing options...
NathanKell Posted July 9, 2015 Share Posted July 9, 2015 @MODULE[foo] will run only on the first module that matches.You want @MODULE,* Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted July 9, 2015 Share Posted July 9, 2015 @MODULE[foo] will run only on the first module that matches.You want @MODULE,*OH, I thought @MODULE[*] would have targettet any module.fair enough, thanks for the tip Quote Link to comment Share on other sites More sharing options...
Felbourn Posted July 10, 2015 Share Posted July 10, 2015 Are changes not immediate?I did this test:tempFX1 = #$/MODULE[ModuleEnginesFX]/maxThrust$@MODULE[ModuleEnginesFX]{ @maxThrust = 250}tempFX2 = #$/MODULE[ModuleEnginesFX]/maxThrust$maxThrust is 90 in the orginal CFG file.The MM cache file shows these values after loading:tempFX1 = 90tempFX2 = 90MODULE{ ... maxThrust = 250So the change is taking place but the before and after vars are the original. Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted July 10, 2015 Share Posted July 10, 2015 is there more than one MODULE[ModuleEnginesFX] in the part you are editing? Quote Link to comment Share on other sites More sharing options...
sarbian Posted July 10, 2015 Author Share Posted July 10, 2015 The directive are not processed in the order you write them in the script. loaded config node are composed of a list of values and a list of sub node. MM process the value first and then the subnodes.So the actual processing order of your test would be : tempFX1 = #$/MODULE[ModuleEnginesFX]/maxThrust$tempFX2 = #$/MODULE[ModuleEnginesFX]/maxThrust$@MODULE[ModuleEnginesFX]{ @maxThrust = 250} Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted July 10, 2015 Share Posted July 10, 2015 The directive are not processed in the order you write them in the script. loaded config node are composed of a list of values and a list of sub node. MM process the value first and then the subnodes.So the actual processing order of your test would be : tempFX1 = #$/MODULE[ModuleEnginesFX]/maxThrust$tempFX2 = #$/MODULE[ModuleEnginesFX]/maxThrust$@MODULE[ModuleEnginesFX]{ @maxThrust = 250}really??? oh $....I need to go back and re-check everything then...does it work the same for sub-subnodes?@Part{ @MODULE { @key @SUBMODULE { @key } @key }} Quote Link to comment Share on other sites More sharing options...
Felbourn Posted July 10, 2015 Share Posted July 10, 2015 Thanks. I'll just work around it by having a second @PART which I assume those are processed in the order they are seen in the same file. Yea? Quote Link to comment Share on other sites More sharing options...
sarbian Posted July 10, 2015 Author Share Posted July 10, 2015 Yep, they do Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted July 11, 2015 Share Posted July 11, 2015 (edited) is module manager case sensitive?If I do something like this:@MODULE:HAS[#key[true]]{}but the module has "key = True", would that change?should I use:HAS[#key[?rue]]?edityeah fixed it.Edit2is there any way to make a patch not case sensitive?I'm having an issue making a mod to patch other mods, and each modder use different upcase and LOWERCASE ( ) WoRdsit's a NIghTMaRe Edited July 11, 2015 by Sigma88 Quote Link to comment Share on other sites More sharing options...
cipherpunks Posted July 12, 2015 Share Posted July 12, 2015 So let's say I want to fix all the old part/mod bottom nodes that have +1 in their 5th position.What do I do to match, and then change, @node_stack_bottom's 5th item? Just :HAS[#node_stack_bottom,5[1]] and @node_stack_bottom,5 = -1? Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted July 12, 2015 Share Posted July 12, 2015 So let's say I want to fix all the old part/mod bottom nodes that have +1 in their 5th position.What do I do to match, and then change, @node_stack_bottom's 5th item? Just :HAS[#node_stack_bottom,5[1]] and @node_stack_bottom,5 = -1?the fifth would be node_stack_bottom,4 (the first being node_stack_bottom,0)other than that, idk if it will work in the :HAS[] Quote Link to comment Share on other sites More sharing options...
cipherpunks Posted July 12, 2015 Share Posted July 12, 2015 (edited) One more question. I'm trying to fix old Goodspeed parts, and I do this:@PART[goodspeedRocketPartsTank,goodspeedGoldFuelBall,goodspeedGoldXenonBall] { @MODEL,* { @texture,* ^= :crewCabin:hitchhikerStorageContainer: } } // Goodspeed Rocket Parts Container, FB-G Fuel Tank, XB-G Xenon Tank@PART[goodspeedPartsWarehouse] { @MODEL,* { @texture,* ^= :Utility/roverBody:Command/probeRoverBody: } } // Goodspeed Rocket Parts Warehouse@PART[goodspeedHexFrame*,goodspeedHexSideMount1] { @MODEL,* { @texture,* ^= :strutCube:strutCubicOcto: } } // Goodspeed TR6.1 Structural Frame, TR6.3 Structural Frame, TR-S Side Mount@PART[goodspeedStashBox] { @MODEL,* { @texture,* ^= :mk2LanderCabin:mk2LanderCan: } } // Goodspeed Experiment Storage Device@PART[goodspeedOrangeFuelBall] { @MODEL,* { @texture,* ^= :fuelTank3-2:fuelTankJumbo-64: } } // Goodspeed FB-O Fuel Tank, FP-O Fuel Tank@PART[goodspeedRoundFuelCap] { @MODEL,* { @texture,* ^= :fuelTank_long:fuelTankT800: } } // Goodspeed Rounded Fuel Cap@PART[goodspeedNuclearReactor*] { @MODEL,* { @texture,* ^= :nuclearEngine:liquidEngineLV-N: } } // Goodspeed UNSFE-100 Nuclear Reactor, UNSFE-200 Nuclear Reactor, UNSFE-400 Nuclear Reactor@PART[goodspeed_zap01] { @MODEL,* { @texture,* ^= :ksp_r_largeBatteryPack:z-400Battery: } } // Goodspeed ZAP-01 Radioisotope Thermoelectric Generator@PART[goodspeedSideNose1250] { @MODEL,* { @texture,* ^= :solidBooster1-1:solidBoosterBACC: } } // Goodspeed SM-1250 Rocket Cap@PART[goodspeedSideMount1250] { @MODEL,* { @texture,* ^= :StackDecoupler:decouplerStackTR-18A: } } // Goodspeed SMD-250 Side Mount & Decouplerand it doesn't work; in ModuleManager.ConfigCache I see: MODEL {[B] texture = :StackDecoupler:decouplerStackTR-18A:[/B] texture = model001, Squad/Parts/Utility/StackDecoupler/model001I also do this:@PART[goodspeedMonoStack3750] { @MODEL,* { @model ^= :RCSTank1-2:RCSFuelTankR1: } } // Goodspeed FL-R5 RCS Fuel Tank@PART[goodspeedSweptPylon400] { // Goodspeed SW-400 Pylon & Decoupler @MODEL,0 { @texture,0 ^= :Aero/advancedCanard:Structural/strutCubicOcto: @texture,1 ^= :Aero/advancedCanard:Structural/strutCubicOcto: } // MODEL} // PARTand this works fine (both ways).What gives?..- - - Updated - - -the fifth would be node_stack_bottom,4 (the first being node_stack_bottom,0)Yeah, forgot that, 10x. But... Using @node_stack_bottom,4 = -1just breaks the nodes, givingnode_stack_bottom = -1 :-( So there must be some other method of accessing that. Edited July 12, 2015 by cipherpunks Quote Link to comment Share on other sites More sharing options...
cipherpunks Posted July 12, 2015 Share Posted July 12, 2015 (edited) So, here's what I came with:@PART[goodspeed*]:HAS[#node_stack_bottom[*]]:NEEDS[Goodspeed]:FIRST { // Goodspeed parts have old-style, "wrong" bottom nodes; some are overrided later, hence :FIRST @node_stack_bottom = #$node_stack_bottom[0]$, $node_stack_bottom[1]$, $node_stack_bottom[2]$, $node_stack_bottom[3]$, -1, $node_stack_bottom[5]$, $node_stack_bottom[6]$} // PARTStill need to solve @MODEL,* { @texture,* ^= problem. Sarbian?...And can You please add ; as statement separator, so I could neatly @oneline { @var1 = val1; @var2 = somethingelse } ? Screen real estate is precious. Edited July 12, 2015 by cipherpunks Quote Link to comment Share on other sites More sharing options...
sarbian Posted July 13, 2015 Author Share Posted July 13, 2015 I ll have a look at the regex but I m pretty sure someone already wrote a similar patch that worked.The file are parsed by KSP, so no ";". And even if it was not I would not. One line code is the root of all evil. Quote Link to comment Share on other sites More sharing options...
cipherpunks Posted July 13, 2015 Share Posted July 13, 2015 Why it is? Can You elaborate? cause I've been using one-liners for so many years with great success, in various OS's and lang's.... Quote Link to comment Share on other sites More sharing options...
sarbian Posted July 13, 2015 Author Share Posted July 13, 2015 That does not make them a good idea. Quote Link to comment Share on other sites More sharing options...
pack_rtr Posted July 13, 2015 Share Posted July 13, 2015 I am making a custom 0.90 install and i need an older version of Module Manager. Can you provide me with a link? Quote Link to comment Share on other sites More sharing options...
Nori Posted July 13, 2015 Share Posted July 13, 2015 All of the releases are here: https://github.com/sarbian/ModuleManager/releasesIt's linked right on the first page.Can you have a HAS[@MODULE[!XYZ] applied right after a module?Basically I'm trying to apply a module, but only if it isn't on there. If the module is on, or added, delete another module..@PART[*]:NEEDS[CrossFeedEnabler]:HAS[@MODULE[InterstellarFuelSwitch]]:FOR[zCustom]:Final{ MODULE[ModuleCrossFeed]:HAS[!MODULE[ModuleCrossFeed]] { name = ModuleCrossFeed crossFeedOverride = False } !MODULE[ModuleFuelCrossfeedActions]:HAS[MODULE[ModuleCrossFeed]]{}} Quote Link to comment Share on other sites More sharing options...
pack_rtr Posted July 13, 2015 Share Posted July 13, 2015 Thanks a lot!!! Quote Link to comment Share on other sites More sharing options...
Murdabenne Posted July 14, 2015 Share Posted July 14, 2015 Why it is? Can You elaborate? cause I've been using one-liners for so many years with great success, in various OS's and lang's....Readability enhances maintainability. Cryptiuc and dense one liners are part of the things that made perl known as a "write only" language. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted July 14, 2015 Share Posted July 14, 2015 (edited) Nori, those are just tags. They only have the source.pack_rtr, you want the build server. On the left, Build History. https://ksp.sarbian.com/jenkins/job/ModuleManager/Nori: HAS means "does this node have this thing" so no.Consider two things:@MODULE[foo] is just shorthand for @MODULE:HAS[#name[foo]]@MODULE[foo]:HAS[@MODULE[bar] means to find the MODULE with name == 'foo' that has a node inside it named MODULE which has a value inside that called 'name = bar'.I don't think that's what you want to be doing.Also, you can't have multiple pass specifiers (well, you can, but only the first one will be used). That is to say, :FOR[foo]:FINAL is exactly the same as just :FOR[foo] because the FOR pass for mod 'foo' comes before the FINAL pass.Just like FOR[foo]:AFTER[bar] will run on the AFTER pass for mod bar, not on the FOR pass for mod foo. Edited July 14, 2015 by NathanKell Quote Link to comment Share on other sites More sharing options...
cipherpunks Posted July 14, 2015 Share Posted July 14, 2015 (edited) That does not make them a good idea.This argument seems purely subjective to me. Don't get me wrong, but please elaborate or retract. Cause if one-liners are bad, then bigger half of I.T. world is doing bad thing many times per day (for example using shell, chaining commands with pipes in shell etc), and it is our duty to warn them, right?- - - Updated - - -Readability enhances maintainability. Cryptiuc and dense one liners are part of the things that made perl known as a "write only" language.Excuse me, but (increasing line count) != (readability will increase linearly). Quite often it's quite the contrary (as screen space is limited and you need to scroll when the code is really sparse, so you can't read entire section in one glimpse, and risk distraction.Besides, AFAIK Perl haters hate Perl because of regexps, which are dense; but You do not advocate removing regex support from MM, do You? Edited July 14, 2015 by cipherpunks Quote Link to comment Share on other sites More sharing options...
pack_rtr Posted July 14, 2015 Share Posted July 14, 2015 Nori, those are just tags. They only have the source.pack_rtr, you want the build server. On the left, Build History. https://ksp.sarbian.com/jenkins/job/ModuleManager/Nori: HAS means "does this node have this thing" so no.Consider two things:@MODULE[foo] is just shorthand for @MODULE:HAS[#name[foo]]@MODULE[foo]:HAS[@MODULE[bar] means to find the MODULE with name == 'foo' that has a node inside it named MODULE which has a value inside that called 'name = bar'.I don't think that's what you want to be doing.Also, you can't have multiple pass specifiers (well, you can, but only the first one will be used). That is to say, :FOR[foo]:FINAL is exactly the same as just :FOR[foo] because the FOR pass for mod 'foo' comes before the FINAL pass.Just like FOR[foo]:AFTER[bar] will run on the AFTER pass for mod bar, not on the FOR pass for mod foo.Which is the newest build for 0.90? Quote Link to comment Share on other sites More sharing options...
Nori Posted July 14, 2015 Share Posted July 14, 2015 Whoops. Sorry about that. I'm so used to downloading mods from github that I just assumed it included the DLL.@pack_rtr - I think this is what you want: https://ksp.sarbian.com/jenkins/job/ModuleManager/83/artifact/ModuleManager.2.6.0.dllThat is the last build before KSP 1.0 was released.Thanks NathanKell. I was wondering about FOR and Final as the Final didn't seem to be final.. Hm, I thought that I have seen AFTER + FOR in some mods but maybe I'm wrong? Probably was a NEEDS + FOR.Considering this is for my own tweaks, is it best to use a FOR[zCustom] like I am, or should I just put :Final on my changes? I am sometimes overwriting MM changes made by other mods, was hoping FOR[zCustom] would apply after most mods as I figured FOR was done alphabetically, but maybe I'm wrong.Ok, so basically I'm just going to have to do this:@PART[*]:NEEDS[CrossFeedEnabler]:HAS[@MODULE[InterstellarFuelSwitch],@MODULE[ModuleCrossFeed]]:FOR[zCustom]{ !MODULE[ModuleFuelCrossfeedActions]{}}@PART[*]:NEEDS[CrossFeedEnabler]:HAS[@MODULE[InterstellarFuelSwitch],!MODULE[ModuleCrossFeed]]:FOR[zCustom]{ MODULE[ModuleCrossFeed] { name = ModuleCrossFeed crossFeedOverride = False } !MODULE[ModuleFuelCrossfeedActions]{}} 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.