Whovian Posted June 11, 2015 Share Posted June 11, 2015 I'm definitely not an expert, but have you tried this?Worked like a charm; thanks! Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted June 12, 2015 Share Posted June 12, 2015 Is there a way to make a module change its behaviour in career/science sandbox depending on which tech nodes the user unlocks?or would that require a .dll?I've tried to look around but the only mods that I know do that seem to use dlls Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted June 12, 2015 Share Posted June 12, 2015 You can add entries in a cfg that a dll can look at(eg. MJ), but not have save dependant things happen purely because of MM Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted June 12, 2015 Share Posted June 12, 2015 You can add entries in a cfg that a dll can look at(eg. MJ), but not have save dependant things happen purely because of MMthat's what I thought, darn it Quote Link to comment Share on other sites More sharing options...
ev0 Posted June 12, 2015 Share Posted June 12, 2015 Request: would it be possible to get Module Manager to let us use logic with HAS in sub-nodes or variables? Currently it seems like it's not possible, as from my tests and this quote:Looking at the code, it looks like | for OR is allowed in HAS blocks at the top level (i.e. @PART:HAS[]) but not in sub-nodes or variable lookups. Quote Link to comment Share on other sites More sharing options...
DBowman Posted June 12, 2015 Share Posted June 12, 2015 Query / Request:I'm retexturing a part:... -mesh = model.mu MODEL { model = Squad/Parts/Utility/largeAdapterShort/model scale = 1.5, 1.0, 1.5 // << x,y,z rotation = 0,0,180// texture = model000,./model000 // shame this syntax does not work texture = model000,UberDyneAstronautics/testing/Shield/model000 }...is there a way to do a reference to the replacement texture file that is relative to the .cfg specifying it? It's a shame to have to create a dependency on the path of the .cfg in the .cfg. Quote Link to comment Share on other sites More sharing options...
tjsnh Posted June 12, 2015 Share Posted June 12, 2015 So I'm having some issues and for the life of me I can't figure out whats wrong. I'm trying to change the fuel in a tank to 540/660, and this is what I've come up with after reading the documentation:@PART[FUELTANKNAME]{ @TechRequired = heavyRocketry @title = FT-450@description = We've got the gas!@RESOURCE{ @name = LiquidFuel @amount = 540 @maxAmount = 540}@RESOURCE{ @name = Oxidizer @amount = 660 @maxAmount = 660}}It has the effect of only recognizing the oxidizer total, and removes the liquidfuel completely. It's got to be something obvious, what am I missing? Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted June 12, 2015 Share Posted June 12, 2015 You're not actually indexing into the resources, just repeatedly editing the first one@PART[FUELTANKNAME]{ @TechRequired = heavyRocketry @title = FT-450@description = We've got the gas!@RESOURCE[LiquidFuel]{ @amount = 540 @maxAmount = 540}@RESOURCE[Oxidizer]{ @amount = 660 @maxAmount = 660}} Quote Link to comment Share on other sites More sharing options...
tjsnh Posted June 12, 2015 Share Posted June 12, 2015 You're not actually indexing into the resources, just repeatedly editing the first oneI didn't think that would work - thanks!!So similarly, if I wanted to remove something from the part (say, oxidizer) would the correct syntax be:@PART[FUELTANKNAME]{ @TechRequired = heavyRocketry @title = FT-450@description = We've got the gas!-RESOURCE[Oxidizer] {}} Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted June 12, 2015 Share Posted June 12, 2015 That would be it Quote Link to comment Share on other sites More sharing options...
skips Posted June 12, 2015 Share Posted June 12, 2015 @PART[FUELTANKNAME]{ @TechRequired = heavyRocketry @title = FT-450@description = We've got the gas!-RESOURCE[Oxidizer] {}}From first page, second message@PART[FUELTANKNAME]{ @TechRequired = heavyRocketry @title = FT-450 @description = We've got the gas! !RESOURCE[Oxidizer] {}} Quote Link to comment Share on other sites More sharing options...
NathanKell Posted June 13, 2015 Share Posted June 13, 2015 - and ! are synonymous. Quote Link to comment Share on other sites More sharing options...
Sokar408 Posted June 13, 2015 Share Posted June 13, 2015 Is it possible to look up a value, and use that value else? I'm trying to make an MM.cfg file for adding the science multiplier to the science generated by the science lab. I can see in the science lab part, that what I need is to change this:PART[Large_Crewed_Lab]{MODULE { name = ModuleScienceConverter scienceMultiplier = 5 }}With a cfg file with this code:@PART[Large_Crewed_Lab]{@MODULE[ModuleScienceConverter] { @scienceMultiplier *=0.3 }}However I'd like for it to look up the multiplier in the save file I'm using, thus allowing me to make one cfg file for all save files.GAME{ { preset = Custom CAREER { ScienceGainMultiplier = 0.3 } }}So is it possible to look up that value, and have that applied? My assumption is that isn't, because cfg's are loaded during the game load up, but it can't hurt to ask Also if I can't, is my changed code gonna work the way I intend it? Quote Link to comment Share on other sites More sharing options...
undercoveryankee Posted June 13, 2015 Share Posted June 13, 2015 Is it possible to look up a value, and use that value else? I'm trying to make an MM.cfg file for adding the science multiplier to the science generated by the science lab. I can see in the science lab part, that what I need is to change this:PART[Large_Crewed_Lab]{MODULE { name = ModuleScienceConverter scienceMultiplier = 5 }}With a cfg file with this code:@PART[Large_Crewed_Lab]{@MODULE[ModuleScienceConverter] { @scienceMultiplier *=0.3 }}However I'd like for it to look up the multiplier in the save file I'm using, thus allowing me to make one cfg file for all save files.GAME{ { preset = Custom CAREER { ScienceGainMultiplier = 0.3 } }}So is it possible to look up that value, and have that applied? My assumption is that isn't, because cfg's are loaded during the game load up, but it can't hurt to ask Also if I can't, is my changed code gonna work the way I intend it? There's nothing in ModuleManager to access a per-save config file because MM runs and parts are compiled before you decide which save to load.I don't see any syntax errors in your patch. It should work to make the science multiplier 3/10 of the stock value. Quote Link to comment Share on other sites More sharing options...
skips Posted June 13, 2015 Share Posted June 13, 2015 - and ! are synonymous.Your statement might well be true, however, it is not documented in the second message of the first page. The syntax that I suggested is documented in that message. I believe that it is in the best interest of all of the users to point people to the documentation and suggest that they help themselves. Note that this statement is merely my opinion and you are free to disagree.skips Quote Link to comment Share on other sites More sharing options...
KerbMav Posted June 14, 2015 Share Posted June 14, 2015 Will this correctly create a copy of a part?Making some changes, taking it out of tech tree and VAB, removing its functionality to just have a part to use in contracts?+PART[sensorGravimeter]{ @name = SatsWithParts001 -TechRequired = @entryCost = 0 @cost = 10000 //category = Science //subcategory = 0 @title = Equipment for Satellite 001 @manufacturer = Contractor @description = Make sure to attach this to the satellite! //mass = 0.005 //maxTemp = 1200 // = 3200 //PhysicsSignificance = 1 //bulkheadProfiles = srf -MODULE[ModuleEnviroSensor] {} -MODULE[ModuleScienceExperiment] {}} Quote Link to comment Share on other sites More sharing options...
Mecripp Posted June 14, 2015 Share Posted June 14, 2015 Will this correctly create a copy of a part?Making some changes, taking it out of tech tree and VAB, removing its functionality to just have a part to use in contracts?+PART[sensorGravimeter]{ @name = SatsWithParts001 -TechRequired = @entryCost = 0 @cost = 10000 //category = Science //subcategory = 0 @title = Equipment for Satellite 001 @manufacturer = Contractor @description = Make sure to attach this to the satellite! //mass = 0.005 //maxTemp = 1200 // = 3200 //PhysicsSignificance = 1 //bulkheadProfiles = srf -MODULE[ModuleEnviroSensor] {} -MODULE[ModuleScienceExperiment] {}}Yes but with your -TechRequired = It might not load with out a TechRequired = Quote Link to comment Share on other sites More sharing options...
KerbMav Posted June 14, 2015 Share Posted June 14, 2015 It might not load with out a TechRequired =It is not supposed to appear in the tech tree, I just need a part that I can be made available by ContractConfigurator. Quote Link to comment Share on other sites More sharing options...
undercoveryankee Posted June 14, 2015 Share Posted June 14, 2015 It is not supposed to appear in the tech tree, I just need a part that I can be made available by ContractConfigurator.I usually set "TechRequired = none" instead of deleting the entire line. Does the same thing, and less likely to break if stock code or another mod starts assuming that there will always be a value. Quote Link to comment Share on other sites More sharing options...
KerbMav Posted June 14, 2015 Share Posted June 14, 2015 I usually set "TechRequired = none" instead of deleting the entire line. Does the same thing, and less likely to break if stock code or another mod starts assuming that there will always be a value.Worked! Thanks! Quote Link to comment Share on other sites More sharing options...
NathanKell Posted June 15, 2015 Share Posted June 15, 2015 Plus KSP won't parse a key-value pair without a value, as of (.25? some time). So if you want to delete a value, you need to do -val = SOMETHING (or DEL or foo or asdfasd or...) Quote Link to comment Share on other sites More sharing options...
ev0 Posted June 15, 2015 Share Posted June 15, 2015 (edited) I want to replace the middle value y in an x,y,z coordinate (or whatever Squad uses). The replacement is based off of another value y in an x,y,z coordinate. For both coordinates, x and z are known but y is unknown. Is it possible to do this? I was thinking of using a variable lookup with a regexp as follows, but it doesn't seem to work.Example:MODULE{ posA = -1000, 400, -1 // want to lookup middle coordinate (x,z known, y unknown) posB = -1000, 200, -1 // want to replace middle coordinate (x,z known, y unknown) tempA = #$posA$ // OUTPUT: -1000, 400, -1 @tempA ^= :-1000, (.*), -1:$1: // OUTPUT: 400 @tempA += 200 // OUTPUT: 600 tempB = #$posB$ // OUTPUT: -1000, 200, -1 @tempB ^= :-1000, (.*), -1:$1: // OUTPUT: 200 // the following defaults to original posB posB ^= ^.*) #$tempB# (.*$):$1 #$tempA$ $2: // OUTPUT (FAIL): -1000, 200, -1 // even if posB's y is known, still fails posB ^= ^.*)200(.*$):$1 #$tempA$ $2: // OUTPUT (FAIL): -1000, #$tempA$, -1} Edited June 15, 2015 by ev0 Quote Link to comment Share on other sites More sharing options...
Styles2304 Posted June 15, 2015 Share Posted June 15, 2015 This is a simple question that's probably been answered but I don't know enough to know what to search for.I'm trying to change the model of the turboFanEngine to the JetEngine. This is what I have initially:@PART[turboFanEngine]{ @MODEL { @model = Squad/Parts/Engine/jetEngineBasic/model.mu }}Can someone steer me in the right direction? Quote Link to comment Share on other sites More sharing options...
sarbian Posted June 15, 2015 Author Share Posted June 15, 2015 ev0 : The current regex implementation does not supports vars. The system do what you need is described here with examplesStyles2304 : the default turboFanEngine engine config does not have a MODEL node and your current code tries to edit a MODEL node => MM does nothing. What you need is more in the line of :@PART[turboFanEngine]{ MODEL { model = Squad/Parts/Engine/jetEngineBasic/model.mu } -mesh = delete} Quote Link to comment Share on other sites More sharing options...
ev0 Posted June 15, 2015 Share Posted June 15, 2015 This is a simple question that's probably been answered but I don't know enough to know what to search for.I'm trying to change the model of the turboFanEngine to the JetEngine. This is what I have initially:@PART[turboFanEngine]{ @MODEL { @model = Squad/Parts/Engine/jetEngineBasic/model.mu }}Can someone steer me in the right direction?Looks like you just need to replace the second and third @ with either nothing or a %. @ is used to edit existing modules and things, no prefix would just create them, and a % would edit if they exist or create if they don't. PART[turboFanEngine] doesn't seem to have a MODEL, so there's nothing to edit with @.Does this work? Not sure if you have to do anything with a scale value or the mesh though...@PART[turboFanEngine]{ %MODEL { %model = Squad/Parts/Engine/jetEngineBasic/model.mu }}- - - Updated - - -ev0 : The current regex implementation does not supports vars. The system do what you need is described here with examplesThanks!! It works now. I missed the explanation at the bottom of your link with the ratio example. I went with this:MODULE{ posA = -1000, 400, -1 // lookup middle coordinate (x,z known, y unknown) posB = -1000, 200, -1 // replace middle coordinate (x,z known, y unknown) tempA = #$posA[1]$ // OUTPUT: 400 @tempA += 200 // OUTPUT: 600 // this works posB = #$posB[0]$, $tempA$, $posB[2]$ // OUTPUT: -1000, 600, -1} 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.