Crzyrndm Posted March 20, 2015 Share Posted March 20, 2015 maxVolume = #$[COLOR=#ff0000]../[/COLOR]mvar$The variable address is from your current node, not the root node Quote Link to comment Share on other sites More sharing options...
Enceos Posted March 20, 2015 Share Posted March 20, 2015 maxVolume = #$[COLOR=#ff0000]../[/COLOR]mvar$The variable address is from your current node, not the root nodeChanged code to this:@PART[*]:HAS[@MODULE[KASModuleContainer],!MODULE[ModuleKISInventory]]:NEEDS[KAS,KIS]{ mvar = #$/MODULE[KASModuleContainer]/maxSize$ svar = #$mvar$ @svar *= 10 @mvar *= 0.01 mvaro = #$mvar$ @mvaro += 0.05 MODULE { name = ModuleKISInventory maxVolume = #$../mvar$ externalAccess = true internalAccess = true slotsX = 3 slotsY = #$../svar$ slotSize = 50 itemIconResolution = 128 selfIconResolution = 128 openSndPath = KIS/Sounds/containerOpen closeSndPath = KIS/Sounds/containerClose defaultMoveSndPath = KIS/Sounds/itemMove } MODULE { name = ModuleKISItem volumeOverride = #$../mvaro$ editorItemsCategory = false } !mvar = null !svar = null !mvaro = null}RESULT, still missing lines where I try to return the calculated variables: MODULE { name = ModuleKISInventory externalAccess = true internalAccess = true slotsX = 3 slotSize = 50 itemIconResolution = 128 selfIconResolution = 128 openSndPath = KIS/Sounds/containerOpen closeSndPath = KIS/Sounds/containerClose defaultMoveSndPath = KIS/Sounds/itemMove } MODULE { name = ModuleKISItem editorItemsCategory = false } Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted March 20, 2015 Share Posted March 20, 2015 What happens if you don't delete the values at the end? MM may processes all values and then all nodes rather than doing it in orderE: nvm, the examples show it being used like that too. I'm out of ideas Quote Link to comment Share on other sites More sharing options...
sarbian Posted March 20, 2015 Author Share Posted March 20, 2015 Actually deleting the var is tricky. Leaving them has no consequences for the game, but you could get var conflict between mods. so I would declare them with %But if you delete them you can't use them in sub nodes (they are deleted before the node is processed) Quote Link to comment Share on other sites More sharing options...
Enceos Posted March 20, 2015 Share Posted March 20, 2015 What happens if you don't delete the values at the end? MM may processes all values and then all nodes rather than doing it in orderE: nvm, the examples show it being used like that too. I'm out of ideasYou were right, deleting the variables at the end of the script was the issue.- - - Updated - - -We can search for items with specific values, like in this string:@PART[*]:HAS[@MODULE[KASModuleContainer]:HAS[#maxSize[60]],!MODULE[ModuleKISInventory]]:NEEDS[KAS,KIS]@sarbian Is there a way to make this query broader, like searching for items with maxSize =>60 or between 60 and 160? Quote Link to comment Share on other sites More sharing options...
sarbian Posted March 20, 2015 Author Share Posted March 20, 2015 not with the current version. Quote Link to comment Share on other sites More sharing options...
Enceos Posted March 20, 2015 Share Posted March 20, 2015 not with the current version.Ok, I'll hope for the future versions Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted March 20, 2015 Share Posted March 20, 2015 Actually deleting the var is tricky. Leaving them has no consequences for the game, but you could get var conflict between mods. so I would declare them with %But if you delete them you can't use them in sub nodes (they are deleted before the node is processed)You may want to correct the example here then. It makes it look like everything is processed in order of appearance, but if values and nodes are processed seperately that won't work Quote Link to comment Share on other sites More sharing options...
sashan Posted March 21, 2015 Share Posted March 21, 2015 Is this correct code to detect all LFO fuel tanks and decrease their mass? I want to make a minimod for FAR and NEAR to decrease fuel density but keep tank mass fraction, as rockets are all extremely small now.@PART[*]:HAS[#category[FuelTank]]:HAS[!RESOURCE[*],@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer]]] { @mass *= 0.75 } Quote Link to comment Share on other sites More sharing options...
NathanKell Posted March 22, 2015 Share Posted March 22, 2015 That...doesn't really make sense.I think you mean:@PART[*]:HAS[#category[FuelTank],@RESOURCE[LiquidFuel]]:FOR[whateverYouWantToCallYourMod]{ @mass *= 0.75}Unless you want to also skip the Mk1/2/3 liquid-fuel-only tanks, in which case add a ,@RESOURCE[Oxidizer] as well to the chain. Quote Link to comment Share on other sites More sharing options...
FreeThinker Posted March 22, 2015 Share Posted March 22, 2015 Question, would it be possible to do the following MM script shorter:@PART[FNInlineRefineryLarge]:NEEDS[NearFutureElectrical|SETI]:FOR[WarpPlugin]{ @MODULE[FNModuleResourceExtraction],0 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],1 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],2 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],3 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],4 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],5 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 }} Quote Link to comment Share on other sites More sharing options...
Gaalidas Posted March 22, 2015 Share Posted March 22, 2015 Question, would it be possible to do the following MM script shorter:@PART[FNInlineRefineryLarge]:NEEDS[NearFutureElectrical|SETI]:FOR[WarpPlugin]{ @MODULE[FNModuleResourceExtraction],0 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],1 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],2 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],3 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],4 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 } @MODULE[FNModuleResourceExtraction],5 { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 }}Couldn't you just do this?@PART[FNInlineRefineryLarge]:NEEDS[NearFutureElectrical|SETI]:FOR[WarpPlugin]{ @MODULE[FNModuleResourceExtraction],* { @powerConsumptionLand *= 0.02 @powerConsumptionOcean *= 0.02 }}Someone correct me if I'm wrong... Quote Link to comment Share on other sites More sharing options...
sarbian Posted March 25, 2015 Author Share Posted March 25, 2015 (edited) And here is ModuleManager 2.5.13 - < and > compare on value check. @PART[*]:HAS[#mass[<1]]:Final { @mass = 0.01 } - # operator to copy-paste whole node from anywhere. The syntax look like the one for the variables. I hope the example make the syntax clear : MY_NODE_LIBRARY { MODULE { name = MechJebCore } } @PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore]] { #@MY_NODE_LIBRARY/MODULE[MechJebCore] { } MODULE { name = tobepasted } OTHER { fun = 9001 } OTHER2 { fun = 9001 } MODULE { #../MODULE[tobepasted] { } #../OTHER { } #/OTHER2 { } } } Edited April 24, 2016 by sarbian Quote Link to comment Share on other sites More sharing options...
John"Ducky"Graves Posted March 26, 2015 Share Posted March 26, 2015 Having an issue with productivity on my modules. I have a base with a Science Lab module and a survey module stocked with intelligent engineers but neither are showing any productivity, can anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted March 26, 2015 Share Posted March 26, 2015 Having an issue with productivity on my modules. I have a base with a Science Lab module and a survey module stocked with intelligent engineers but neither are showing any productivity, can anyone point me in the right direction?I think you got the wrong thread there Productivity is an EPL mechanic AFAIK: http://forum.kerbalspaceprogram.com/threads/59545-0-90-Extraplanetary-Launchpads-v5-1-2 Quote Link to comment Share on other sites More sharing options...
John"Ducky"Graves Posted March 26, 2015 Share Posted March 26, 2015 Woops wrong tab thanks. Quote Link to comment Share on other sites More sharing options...
rabidninjawombat Posted March 26, 2015 Share Posted March 26, 2015 (edited) And here is ModuleManager 2.5.13- < and > compare on value check. @PART[*]:HAS[#mass[<1]]:Final{ @mass = 0.01}- # operator to copy-paste whole node from anywhere. The syntax look like the one for the variables. I hope the example make the syntax clear :MY_NODE_LIBRARY{ MODULE { name = MechJebCore }}@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebCore]]{ #@MY_NODE_LIBRARY/MODULE[MechJebCore] { } MODULE { name = tobepasted } OTHER { fun = 9001 } OTHER2 { fun = 9001 } MODULE { #../MODULE[tobepasted] { } #../OTHER { } #/OTHER2 { } }}Oh my! The < and > checks look incredibly usefull! Finally a way to add the KASattach module to all small lightweight parts without having to create incredibly long config files (if i am understanding its usefulness correctly )Thanks for all the work on this sarbian! Edited March 26, 2015 by rabidninjawombat Quote Link to comment Share on other sites More sharing options...
BudgetHedgehog Posted March 26, 2015 Share Posted March 26, 2015 I want to triple the gimbal range of engines (but only those with gimbal range of 1 or less)And here is ModuleManager 2.5.13- < and > compare on value check. @PART[*]:HAS[#mass[<1]]:Final{ @mass = 0.01}Welp, I guess that answers that! Thanks sarbian! Quote Link to comment Share on other sites More sharing options...
ozraven Posted March 26, 2015 Share Posted March 26, 2015 - # operator to copy-paste whole node from anywhere. The syntax look like the one for the variables.Well now I have to go refactor my entire set of MM patches. Thanks! Quote Link to comment Share on other sites More sharing options...
DaniDE Posted March 29, 2015 Share Posted March 29, 2015 (edited) Hi there, I am trying to multiply a value using a MM patch, but I can´t figure out the correct syntax to target the correct value:I want to set a multiplier to an atmosphere curve with two keys, but I dont want to change the atmosphere pressure part, just the specific impulse.So:@PART[xxx]:Final{ @MODULE[ModuleEngines] { atmosphereCurve { key = 0 200 key = 1 125 }}}does not become when multiplied by 0.5:key = 0 100 key = 0.5 62.5Thanks in advance Edited March 29, 2015 by DaniDE Quote Link to comment Share on other sites More sharing options...
Starwaster Posted March 29, 2015 Share Posted March 29, 2015 Hi there, I am trying to multiply a value using a MM patch, but I can´t figure out the correct syntax to target the correct value:I want to set a multiplier to an atmosphere curve with two keys, but I dont want to change the atmosphere pressure part, just the specific impulse.So:@PART[xxx]:Final{ @MODULE[ModuleEngines] { atmosphereCurve { key = 0 200 key = 1 125 }}}does not become when multiplied by 0.5:key = 0 100 key = 0.5 62.5Thanks in advance You're missing the splice operators. Also, you need to specify for each key which key it is (key,0 and key,1 for first and second)@PART[xxx]:Final{ @MODULE[ModuleEngines] { @atmosphereCurve { @key,0 = 0 100 @key,1 = 1 62.5 } }} Quote Link to comment Share on other sites More sharing options...
Van Disaster Posted March 29, 2015 Share Posted March 29, 2015 Would this work?MYSPECIFICLIB{ MODULE { name = first } MODULE { name = second }}@PART[somepart]{ #@MYSPECIFICLIB/*}If not like that then perhaps@PART[somepart]{ #@MYSPECIFICLIB/MODULE[*] {}} Quote Link to comment Share on other sites More sharing options...
DaniDE Posted March 29, 2015 Share Posted March 29, 2015 Thanks guys. I gonna go google "splice operators" and "MYSPECIFICLIB" and try to make sense of it now Quote Link to comment Share on other sites More sharing options...
Starwaster Posted March 29, 2015 Share Posted March 29, 2015 Thanks guys. I gonna go google "splice operators" and "MYSPECIFICLIB" and try to make sense of it now Warning, 'splice operator' is probably not technically correct since we're not dealing with lists, tables or dictionaries. Nevertheless I tend to think of it that way so I tend to call them that.When dealing with Module Manager, the @ is used either as a conditional to see if a node exists or to edit an existing node, key or field. Quote Link to comment Share on other sites More sharing options...
Van Disaster Posted March 29, 2015 Share Posted March 29, 2015 Thanks guys. I gonna go google "splice operators" and "MYSPECIFICLIB" and try to make sense of it now That was a question of mine with example code, don't google it I wanted to know if you could include ( well, "paste" ) an entire block like that. 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.