erendrake Posted May 20, 2014 Share Posted May 20, 2014 I have been trying to bring MM into kOS and i have a syntax problem that im sure is simpleI would like to add a kOSProcessor module to all parts that:1. Have ModuleCommand2. Dont already have a kOSProcessorThe tricky part is that i want to give a varying amount of diskspace to parts based on their tech level. The example i have for the first two tiers of control follow.@PART[*]:HAS[TechRequired[start]]:HAS[@MODULE[ModuleCommand],!MODULE[kOSProcessor]]{ MODULE { name = kOSProcessor diskSpace = 1000 }}@PART[*]:HAS[TechRequired[flightControl]]:HAS[@MODULE[ModuleCommand],!MODULE[kOSProcessor]]{ MODULE { name = kOSProcessor diskSpace = 3000 }}pretty sure its something simple i dont understand about the syntax. Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 20, 2014 Author Share Posted May 20, 2014 2.1.4 is now the official version :DLL : ModuleManager.2.1.4.dllZip : ModuleManager-2.1.4.zipThis one lets you use directory name (the one just under GameData) as a NEED requirement, and various bugs fix. Thanks to swamp_ig once again.Documentation update on the github wiki is in progress.Syntax Info on the save editing done by MM ( "The Problem" and "The Fix" ).Dev adding modules at run times should have a look at that whole doc. Quote Link to comment Share on other sites More sharing options...
agises Posted May 20, 2014 Share Posted May 20, 2014 2.1.4 is now the official version :DLL : ModuleManager.2.1.4.dllZip : ModuleManager-2.1.4.zipThis one lets you use directory name (the one just under GameData) as a NEED requirement, and various bugs fix. Thanks to swamp_ig once again.Documentation update on the github wiki is in progress.Syntax Info on the save editing done by MM ( "The Problem" and "The Fix" ).Dev adding modules at run times should have a look at that whole doc.Faced a minor problem with this version, ie: I have @PART[commDish]:FOR[AntennaRange]:NEEDS[!RemoteTech2] but I dont have the RT2 dll only the antennas models for use with AntennaRange 1.2 mod. Prior 2.1.4 the patch apply as normal but now as searching for directories this patch don't apply anymore and I have to remove the conditionals to make it work again. So if someone (As I do often) reuses parts from others mods but not the plugin itself this change can make strange things I guess. Not a real problem perhaps, but just saying.Salud. Quote Link to comment Share on other sites More sharing options...
Woopert Posted May 20, 2014 Share Posted May 20, 2014 Just to verify, 2.1.4 is old save safe? I had a back-up of a save from before 2.1.0 and I restored that and used 2.0.7 for the time being. Quote Link to comment Share on other sites More sharing options...
Starwaster Posted May 21, 2014 Share Posted May 21, 2014 (edited) Just to verify, 2.1.4 is old save safe? I had a back-up of a save from before 2.1.0 and I restored that and used 2.0.7 for the time being.Should be, but of course bugs happen. The whole point of the recent flurry of updates is to make old save games more stable when their modules get munged by new mods. MM is also backing up your saves so if something does go wrong, you should have something to fall back to.@Sarbian: Do we have a changelog of what was fixed in 2.1.4?Edit: Also, do we have regexp on general matching now, or just for mangling strings? For instance, if I wanted to match on a non-zero number, can I do that now? Edited May 21, 2014 by Starwaster Quote Link to comment Share on other sites More sharing options...
swamp_ig Posted May 21, 2014 Share Posted May 21, 2014 Should be, but of course bugs happen. The whole point of the recent flurry of updates is to make old save games more stable when their modules get munged by new mods. MM is also backing up your saves so if something does go wrong, you should have something to fall back to.@Sarbian: Do we have a changelog of what was fixed in 2.1.4?Edit: Also, do we have regexp on general matching now, or just for mangling strings? For instance, if I wanted to match on a non-zero number, can I do that now?I've done a change-log for all the stuff I've done here: https://github.com/sarbian/ModuleManager/releasesRegexp for string munging only. As Sarbian has pointed out - if you want to do complex stuff with configs then write a mod to do it. The more stuff pushed into MM, the more chance there is for it to go wrong. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted May 21, 2014 Share Posted May 21, 2014 Can the next version detect if Persistent File Backup Generator is installed and disable its own backups in that case? Really not necessary to have it done twice, also destroys the PFBG backup files (they all end up the same as the main file) and you have to copy them back in from the backup directory MM created. Quote Link to comment Share on other sites More sharing options...
Castun Posted May 21, 2014 Share Posted May 21, 2014 Just a note, when you have parts that are hidden due to being deprecated, the text that says how many parts are hidden is over top of the number of parts patched so it's just a jumble of non-readable text. Quote Link to comment Share on other sites More sharing options...
Taverius Posted May 22, 2014 Share Posted May 22, 2014 (edited) Anywhere I try to do something like this!mesh = DELETEMODEL{ model = some/model/url}in a +PARTI get an array index error in log and no part.Help?EDIT:It seems you can't delete/replace MODEL nodes, only add/edit. Edited May 22, 2014 by Taverius Quote Link to comment Share on other sites More sharing options...
agises Posted May 22, 2014 Share Posted May 22, 2014 (edited) Anywhere I try to do something like this!mesh = DELETEMODEL{ model = some/model/url}in a +PARTI get an array index error in log and no part.Help?Did you change at least the name?@name = new unique name!mesh = DELETEstuffThis works for me ie:+PART[tele_bay]{ !mesh = DELETE @name = tele_bayS @mass = 0.005 %rescaleFactor = 0.60 @title = Service Bay Compact @description = Our I+D team managed to reduce the size of this component. // --- node definitions --- // definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z @node_stack_bottom = 0.0, -0.45, 0.0, 0.0, -0.6, 0.0, 1 @node_stack_top1 = 0.0, 0.45, 0.0, 0.0, 0.6, 0.0, 1 @node_stack_top2 = 0.0, -0.36, 0.0, 0.0, 0.6, 0.0, 0 MODEL,0 { model = CactEye/Parts/tele_bay/model position = 0.0, 0.0, 0.0 scale = 1, 1, 1 rotation = 0, 0, 0 texture = model000, CactEye/Parts/tele_bay/model000 texture = model001, CactEye/Parts/tele_bay/model001_NRM texture = model002, CactEye/Parts/tele_bay/model002 texture = model003, CactEye/Parts/tele_bay/model003 }} Edited May 22, 2014 by agises Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 22, 2014 Author Share Posted May 22, 2014 No need to change the name. He found a real bug.I just released 2.1.5 that fix it ModuleManager.2.1.5.dllModuleManager-2.1.5.zip Quote Link to comment Share on other sites More sharing options...
Starwaster Posted May 22, 2014 Share Posted May 22, 2014 No need to change the name. He found a real bug.I just released 2.1.5 that fix it ModuleManager.2.1.5.dllModuleManager-2.1.5.zipIf he or anyone is duplicating a part, the name on the duplicate part had better change.Either because it explicitly gets changed by the duplication config or because ModuleManager gets coded to automagically change the name.The consequences of not doing so are having two duplicate parts in the VAB/SPH and then actually taking that part into the world and having it revert to the first part that KSP encounters with that name.i.e. you have two parts with the same name. The first one just a static part, the second has modules and/or resources. In the VAB you will see them as two separate parts and the changes that differentiate them are apparent. However, in the 'real world' only the static part is ever loaded because that was the first one that had that name when KSP went to look up that part. Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 22, 2014 Author Share Posted May 22, 2014 He was adding a MODEL node, they don't have a name. And MM will not duplicate a PART if a new name is not provided : print("[ModuleManager] Error while processing " + mod.config.name + " the copy needs to have a different name than the parent (use @name = xxx)"); Quote Link to comment Share on other sites More sharing options...
Starwaster Posted May 23, 2014 Share Posted May 23, 2014 He was adding a MODEL node, they don't have a name. And MM will not duplicate a PART if a new name is not provided : print("[ModuleManager] Error while processing " + mod.config.name + " the copy needs to have a different name than the parent (use @name = xxx)");Ahhh I only saw agises' example Quote Link to comment Share on other sites More sharing options...
Taki117 Posted May 23, 2014 Share Posted May 23, 2014 I have a question. When Module Manager Loads it's patches It says "ModuleManager: xxxx patches applied, xx hidden items" My question is what are hidden items and should I worry about them? Quote Link to comment Share on other sites More sharing options...
swamp_ig Posted May 23, 2014 Share Posted May 23, 2014 Hidden items are anything that gets removed with NEEDS... and don't worry about it Quote Link to comment Share on other sites More sharing options...
Taris Posted May 24, 2014 Share Posted May 24, 2014 (edited) Hi, I was trying to apply Vanguard Ejection Seats to all the command modules but remote controlled ones. But it's quite troubling to select only manned modules.I tried using @PART[*]:HAS[@MODULE[ModuleCommand]:HAS[#minimumCrew[1]]]but ended up selecting all the command modules.Also, I tried,@PART[*]:HAS[@MODULE[ModuleCommand],@MODULE[ModuleCommand]:HAS[!RESOURCE[ElectricCharge]]]But some mods(example: Computer Core from KSP Interstellar) doesn't define the ElectricCharge resource in the MODULE{name=ModuleCommand} node.Would you kindly show me some hints? Thank you. Edited May 24, 2014 by Taris Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted May 25, 2014 Share Posted May 25, 2014 is there still no way to disable the MM backup? Quote Link to comment Share on other sites More sharing options...
Snoman314 Posted May 25, 2014 Share Posted May 25, 2014 I've been trying to fix this for hours, and I please need someone else to take a look because I just cannot figure it out.I'm using TACLS and FusTek Station Parts. I'm also using a config I found to modify TACLS to use litres, instead of kerbal/day units.I'm trying have two configs, one that sets an amount of water, oxygen etc for the station parts in kerbal/day units, as per default TACLS. Then I want a second config to run and multiply the amounts by whatever amount is required to convert to Litres. I actually did this yesterday and it was working. Today it is not working. I can not figure out why.Anyway, config #1:@PART[FusTekKarmonyHabModule*]:FOR[TacLifeSupport]{ RESOURCE { name = Food amount = 40 maxAmount = 40 } RESOURCE { name = Water amount = 40 maxAmount = 40 } RESOURCE { name = Oxygen amount = 40 maxAmount = 40 } RESOURCE { name = Waste amount = 0 maxAmount = 40 } RESOURCE { name = WasteWater amount = 0 maxAmount = 40 } RESOURCE { name = CarbonDioxide amount = 0 maxAmount = 40 }}...// with further @Part blocks for the other modules.Config #2:@PART[*]:HAS[@MODULE[ModuleCommand]]{ @RESOURCE[Food] { @amount *= 0.317 @maxAmount *= 0.317 } @RESOURCE[Water] { @amount *= 1.798 @maxAmount *= 1.798 } @RESOURCE[Oxygen] { @amount *= 304.27 @maxAmount *= 304.27 } @RESOURCE[CarbonDioxide] { @maxAmount *= 261.78 } @RESOURCE[Waste] { @maxAmount *= 0.56 } @RESOURCE[WasteWater] { @maxAmount *= 1.98 }}@PART[Tac*]{ @RESOURCE[Food] { @amount *= 0.317 @maxAmount *= 0.317 } @RESOURCE[Water] { @amount *= 1.798 @maxAmount *= 1.798 } @RESOURCE[Oxygen] { @amount *= 304.27 @maxAmount *= 304.27 } @RESOURCE[CarbonDioxide] { @maxAmount *= 261.78 } @RESOURCE[Waste] { @maxAmount *= 0.56 } @RESOURCE[WasteWater] { @maxAmount *= 1.98 }}@PART[FusTek*]{ @RESOURCE[Food] { @amount *= 0.317 @maxAmount *= 0.317 } @RESOURCE[Water] { @amount *= 1.798 @maxAmount *= 1.798 } @RESOURCE[Oxygen] { @amount *= 304.27 @maxAmount *= 304.27 } @RESOURCE[CarbonDioxide] { @maxAmount *= 261.78 } @RESOURCE[Waste] { @maxAmount *= 0.56 } @RESOURCE[WasteWater] { @maxAmount *= 1.98 }}//etc etc going down other mods. (Yeah that could be better, I know. I don't think it's the problem though)I've tried adding :FINAL and :AFTER[TacLifeSupport] to the second config, but with no effect other than to cause errors to be logged when I use :FINAL. Like this:[LOG 02:30:19.629] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[Tac*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.631] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.633] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[somnam*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.634] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[HexCan*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.636] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacAirFilter]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.638] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacCarbonExtractor*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.640] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacWaterSplitter]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 [LOG 02:30:19.642] [ModuleManager] Exception while processing node : ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[TacWaterPurifier*]:FINALSystem.ArgumentOutOfRangeException: Cannot be negative.Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 at ModuleManager.ConfigManager.applyPatch (System.Collections.Generic.List`1 excludePaths, Boolean final) [0x00000] in <filename unknown>:0 The end result is always the same, the FusTek Station parts have 40 units of stuff in them, instead of the amount I want.Hopefully someone can see what I'm doing wrong, and why this started acting up all of a sudden. Quote Link to comment Share on other sites More sharing options...
ctbram Posted May 25, 2014 Share Posted May 25, 2014 For the love of god can we please get one damn site for this mod!!!!!! Every time I load a new mod it has a newer version of module manager and when I come to this site it's still a lower version of the module. The last mod I added had modulemanager.2.4.4 yet I cannot find an OFFICIAL version of that ANYPLACE! Not in the curse site, not in the forums, not on spaceport! So where is the damn OFFICIAL site for this mod please? Quote Link to comment Share on other sites More sharing options...
erendrake Posted May 25, 2014 Share Posted May 25, 2014 For the love of god can we please get one damn site for this mod!!!!!! Every time I load a new mod it has a newer version of module manager and when I come to this site it's still a lower version of the module. The last mod I added had modulemanager.2.4.4 yet I cannot find an OFFICIAL version of that ANYPLACE! Not in the curse site, not in the forums, not on spaceport! So where is the damn OFFICIAL site for this mod please?Calm yourself. What mod ships with 2.4.4? Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 25, 2014 Share Posted May 25, 2014 PP does, it's because swamp_ig had a typo (should be 2.1.4). 2.1.5 is in fact the most recent. Quote Link to comment Share on other sites More sharing options...
ctbram Posted May 26, 2014 Share Posted May 26, 2014 Calm yourself. What mod ships with 2.4.4?Okay. I think it was procedural fairing or infernal robotics but I can understand if its a typo. I can see how 2.1.4 got changed to 2.4.4. Will grab and install 2.1.5. Thanks. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 26, 2014 Share Posted May 26, 2014 Procedural Parts is the mod in question (hence PP). Quote Link to comment Share on other sites More sharing options...
Snoman314 Posted May 26, 2014 Share Posted May 26, 2014 Followup to my post above. I've taken all the values from the first MM config file, and put them directly into the part configs, so that only one MM config file is trying to set the values. No change at all.When I don't use :FINAL in the second config I showed above, the log makes it look like it's working:[LOG 11:57:10.616] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyStorModule/FusTekKarmonyStorModule[LOG 11:57:10.617] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyStorModuleAdapter/FusTekKarmonyStorModuleAdapter[LOG 11:57:10.618] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyUtilModule/FusTekKarmonyUtilModule[LOG 11:57:10.620] [ModuleManager] Applying node ThunderAerospace/TacLifeSupport/TAC_changeunits/@PART[FusTek*]:AFTER[TacLifeSupport] to FusTek/Station Parts/Parts/KarmonyUtilModule_Adapter/FusTekKarmonyUtilModuleAdapterNo errors coming up, so I think 'Oh good, it's working'. NOPE. None of the changes in TAC_changeunits are being applied. When I look at the parts in the VAB, it's as if that config file didn't exist.This is completely doing my head in. No one has any ideas as to why this has started happening? 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.