Starwaster Posted May 2, 2014 Share Posted May 2, 2014 Actually Sarbian, what MeCripp suggested works for some reason. I tried both with @ and without it, and it didn't. But what he suggested works, no idea why.What he suggested contains a conditional check for the absence of techRequired and applies a 'techRequired = (whatever)' if it was absent. If that works for you but doing techRequired without the @ didn't work for you before, then you were doing something wrong before. Quote Link to comment Share on other sites More sharing options...
cantab Posted May 2, 2014 Share Posted May 2, 2014 And here is 2.0.8.You can now clone and delete root node (parts) like this : <snip>Excellent addition I'd already been thinking I might need to add tweaked copies of parts to handle the command pods for my SurfaceNodes mod, so this'll be just the ticket for that. Quote Link to comment Share on other sites More sharing options...
regex Posted May 2, 2014 Share Posted May 2, 2014 And here is 2.0.8.You can now clone and delete root node (parts) like this : Oh hell yes. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 2, 2014 Share Posted May 2, 2014 Bliss. Sheer bliss. Quote Link to comment Share on other sites More sharing options...
tecknobabble Posted May 2, 2014 Share Posted May 2, 2014 (edited) Actually Sarbian, what MeCripp suggested works for some reason. I tried both with @ and without it, and it didn't. But what he suggested works, no idea why.What was suggested was very subtle. The problem is the different type of brackets... you had:( @TechRequired = advElectrics}That is, opening bracket is a plain parenthesis while the closing one is a curly bracket. Depending on your font the difference could be very subtle in the forum posting.MeCripp's second suggestion corrected it to:{ @TechRequired = advElectrics}I would suspect the different brackets would cause a problem. Edited May 2, 2014 by tecknobabble Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 2, 2014 Author Share Posted May 2, 2014 A hard one to see Quote Link to comment Share on other sites More sharing options...
Starwaster Posted May 2, 2014 Share Posted May 2, 2014 What was suggested was very subtle. The problem is the different type of brackets... you had:( @TechRequired = advElectrics}That is, opening bracket is a plain parenthesis while the closing one is a curly bracket. Depending on your font the difference could be very subtle in the forum posting.MeCripp's second suggestion corrected it to:{ @TechRequired = advElectrics}I would suspect the different brackets would cause a problem.Good catch. I'm sitting here right now staring at them and I still see a bracket Now I know I am getting old. I need reading glasses Quote Link to comment Share on other sites More sharing options...
ialdabaoth Posted May 3, 2014 Share Posted May 3, 2014 Suggestion: if + isn't an invalid character, make the "duplicate node" op a + instead of a $ - it's MUCH more intuitive.like this:+PART[fueltank] { @name = newFuelTank } Quote Link to comment Share on other sites More sharing options...
swamp_ig Posted May 3, 2014 Share Posted May 3, 2014 So I've done my own enhancements to module manager.Download HereThey seem to work pretty nice! I'd really appreciate ppl testing it out on their various MM files prior to me pushing it back to the MM repo.Features:Order Preserving@ now preserves the original order, both for nodes and for values.Use of NEEDSPART:NEEDS[RealFuels] { name = dummyPartIgnore module = Part DOG { name = First key1:NEEDS[ProceduralParts|StretchySRB] = Original Value key2:NEEDS[!RealFuels] = Some other value }}In the above, the part will only be defined if you have RealFuels loaded. You can do this on keys, values, patches, anywhere.key1 will be defined if (ProceduralParts OR StretchySRB are loaded) and RealFuels is NOT loaded. You can still use , and it is treated like &. Not has highest precedence, then or, then and.Define an insertion point for any nodes or values@PART[dummyPartIgnore]{ DOG { name = AddLast string = Will insert at the end } DOG,0 { name = AddFirst string = Will insert at the beginning } @DOG,0 { // Edits node zero as before, but ends up editing the above node string,0 = Insert before the string already at the beginning } }The index after the comma is where it will be inserted, this is relative to other nodes or values with the same name.Regexp replaces@PART[dummyPartIgnore]{ @DOG[First] { @string ^= :^.*$:First dog edit $& in place }}Breaking this down, the first character defines the separator, the section between the first : and the second : is the match string, and the section following the second : is the replacement.For details on how to use regexp see the documentation here Quote Link to comment Share on other sites More sharing options...
Superfluous J Posted May 3, 2014 Share Posted May 3, 2014 Regexp replacesSweet! Finally a way to modify Squad's descriptions slightly without redistributing them! Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 3, 2014 Author Share Posted May 3, 2014 Nice addition The NEEDS can be used on subnode too ? Quote Link to comment Share on other sites More sharing options...
swamp_ig Posted May 3, 2014 Share Posted May 3, 2014 Nice addition The NEEDS can be used on subnode too ?Can be used anywhere - subnodes, values, deep in your tree... AnywhereWhat I've done is to move the needs processing out to a separate pass, and anything that doesn't have needs satisfied gets deleted.Need to do a bit of debug logging however, just figuring out the best way to do it. Quote Link to comment Share on other sites More sharing options...
NavyFish Posted May 3, 2014 Share Posted May 3, 2014 I think the answer is no, but can Module Manager add modules to parts on existing vessels (those saved in the persistence file)? I'm adding a new module to docking ports and would love to make it 'backwards compatible' with existing vessels. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 4, 2014 Share Posted May 4, 2014 Yes. However, be careful, since (as things currently are) changing the module order of a part (so the order of modules in the prefab object that KSP creates at startup doesn't match the order of MODULE nodes in the .craft or .sfs file) will break data-loading from *all* that part's modules. Quote Link to comment Share on other sites More sharing options...
Starwaster Posted May 4, 2014 Share Posted May 4, 2014 I think the answer is no, but can Module Manager add modules to parts on existing vessels (those saved in the persistence file)? I'm adding a new module to docking ports and would love to make it 'backwards compatible' with existing vessels.It will, because if an active vessel has a part that is missing a module that the part's cfg says it has, then the active part will get that module.Sometimes that's good. the module will work just fine out of the box.sometimes it's bad because the module wont initialize properly. the vessel works ok and the part works ok except functionality of the module in question is impaired.And in some cases it's VERY bad because some of the modules depended on loading in a certain order and the vessel wont load properly. Bad things might happen to it when it comes off rails.I dont think it's really a MM issue either because it doesnt matter how the module got on the part. and the third possibility can happen if the PartModule code was modified such that existing vessels might do bad things. IonCross life support had a really bad save breaking update once and there was just no mitigating it. Quote Link to comment Share on other sites More sharing options...
NavyFish Posted May 4, 2014 Share Posted May 4, 2014 That would explain quite a lot. Thanks for the rapid replies.So, what causes the re-order? It's clearly not happening every time, else all saves would be broken..Would adding the new module to the end of the modules list avoid this issue? Quote Link to comment Share on other sites More sharing options...
BudgetHedgehog Posted May 4, 2014 Share Posted May 4, 2014 <snip>It could be the 'Module-that-Must-Not-Be-Named' problem as outlined by Mihara here, but then again, I'm pretty drunk so I've no idea what anyone's talking about. Quote Link to comment Share on other sites More sharing options...
swamp_ig Posted May 4, 2014 Share Posted May 4, 2014 Yes you can add the module at the end of the list and that will be OKHowever, if you then go and change that patch so that module is no longer added, and there's some modules added at the end of the list, then loading will break.It's not very good design on behalf of squad.Don't worry however - I am thinking of how to fix this problem, and my plan is to make some work around so all can use it. Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 4, 2014 Author Share Posted May 4, 2014 (edited) Here is the official release of Swamp_ig patch DLL : ModuleManager.2.0.10.dllZip : ModuleManager-2.0.10.zipDetails of the changes MM will now complain if you use a version older than this one. It's to avoid a bug with the election process with version 2.0.x that made it possible for two or more MM to run at the same time. Edited May 4, 2014 by sarbian Quote Link to comment Share on other sites More sharing options...
Mipe Posted May 4, 2014 Share Posted May 4, 2014 Downloads broken? Quote Link to comment Share on other sites More sharing options...
mikebell Posted May 4, 2014 Share Posted May 4, 2014 Hi Sarbian, those links seem broken. Jenkins isn't reporting any build artifacts in https://ksp.sarbian.com/jenkins/job/ModuleManager/9/artifact/jenkins-ModuleManager-9/ for some reason. Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 4, 2014 Author Share Posted May 4, 2014 Yes, I deleted the file while I was curing the code from my own stupidity ...So here is 2.1.0. This one actually works properly...DLL : ModuleManager.2.1.0.dllZip : ModuleManager-2.1.0.zip Quote Link to comment Share on other sites More sharing options...
mikebell Posted May 4, 2014 Share Posted May 4, 2014 Yes, I deleted the file while I was curing the code from my own stupidity ...So here is 2.1.0. This one actually works properly...DLL : ModuleManager.2.1.0.dllZip : ModuleManager-2.1.0.zipLooks good from a very quick test - thank you! Quote Link to comment Share on other sites More sharing options...
benc85 Posted May 4, 2014 Share Posted May 4, 2014 Yay, more options to no use!Keep up the development Sarbian Quote Link to comment Share on other sites More sharing options...
jinks Posted May 5, 2014 Share Posted May 5, 2014 With 2.1.0 I get a NRE right after MM has identified all loaded DLLs:[LOG 02:51:28.825] [ModuleManager] compiling list of loaded mods...Mod DLLs found: Assembly-CSharp v1.0.0.0 ModuleManager v2.1.0.0 aaa_Toolbar v1.0.0.0 ActionGroupManager v0.0.0.0 <...snip...>Non-DLL mods added:[LOG 02:51:28.973] [ModuleManager] Exception while checking needs : LLL-Extra/Parts/fuelLowerstage/part/fuelLowerstageSystem.NullReferenceException: Object reference not set to an instance of an object at ConfigNode.CopyToRecursive (.ConfigNode node) [0x00000] in <filename unknown>:0 at ConfigNode.CopyToRecursive (.ConfigNode node) [0x00000] in <filename unknown>:0 at ConfigNode.CopyTo (.ConfigNode node) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.CheckNeeds (.ConfigNode subMod) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.CheckNeeds (System.Collections.Generic.List`1 excludePaths) [0x00000] in <filename unknown>:0 [LOG 02:51:29.075] [ModuleManager] :FIRST (default) passThe part is the "Cellular fuel tank" from LLL_Full's extra pack.The cause seems to be in this section:PART{ name = fuelLowerstage module = Part author = Lack //MODEL { model = Squad/Parts/Structural/structuralIBeam3/model position = 0,0.00,-0 scale = 1,0.8,1 rotation = 0,0,0 } MODEL <...snip...>As you can see, Lack has "disabled" one MODEL section by commenting out the header, so I assume MM can't handle a body without a header any more.Is this considered a bug or "WONTFIX, tell Lack to fix his damn parts"? 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.