Gordon Dry Posted August 4, 2017 Share Posted August 4, 2017 (edited) Well, to test out if the patch works as a generic patch is has to work with more than just a handful of parts. But thanks to the hint about AND and OR in the same statement. @KerbMav I tried it with FINAL because some (old) patch files like in RealFuels-Stockalike already got FINAL, but I pruned the most obscure one for now (GameData\RealFuels-Stockalike\Fuel_Conversions.cfg) @Sigma88 mm configcache is inside the linked .zip, as always when I post logs KSP.log ModuleManager.ConfigCache ModuleManager.Physics ModuleManager.TechTree output_log.txt PartDatabase.cfg Edited August 4, 2017 by Gordon Dry Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted August 4, 2017 Share Posted August 4, 2017 @Gordon Dry you're right I managed to miss the link I'll take a look as soon as I have some time Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted August 4, 2017 Share Posted August 4, 2017 It really seems that the stock resources have NOT to be deleted ... will report back soon. Quote Link to comment Share on other sites More sharing options...
KerbMav Posted August 4, 2017 Share Posted August 4, 2017 During launch it says this one has 3 errors - everything looks OK in the game, just as I want it to be. And MM does not create a cache file for me anymore? // Rate of consumption is 1.8 Supplies per Kerbal per hour at 0.0005/s // app. 40 (43.2) per 24hrs , so either one (Earth) or four (Kerbal) days worth of Supplies // Adds about x days worth of Supplies (per kerbal seat) to parts with crew capacity // Ignores parts that already have Supplies RESOURCE declared as well as cryo pods @PART[*]:HAS[!RESOURCE[Supplies],#CrewCapacity[>0],!MODULE[DeepFreezer]] { // temporary key for calculations, is removed later tempCostSupp = 40 @tempCostSupp *= 1 @tempCostSupp *= #$CrewCapacity$ RESOURCE { name = Supplies maxAmount = #$/tempCostSupp$ amount = #$maxAmount$ } RESOURCE { name= Mulch maxAmount = #$/tempCostSupp$ amount = 0 } } // Multiplies Supplies added above by 10 for pure cabins/quarters @PART[*]:HAS[!MODULE[ModuleCommand],!MODULE[ModuleResourceConverter],!MODULE[ModuleScienceConverter],@RESOURCE[Supplies],#CrewCapacity[>0]] { @tempCostSupp *= 10 @RESOURCE[Supplies] { @maxAmount = #$/tempCostSupp$ @amount = #$maxAmount$ } @RESOURCE[Mulch] { @maxAmount = #$/tempCostSupp$ } } // Finally calculates costs of Supplies and adds to Costs, removes temporary key @PART[*]:HAS[@RESOURCE[Supplies],#CrewCapacity[>0]]:FINAL { @tempCostSupp *= 2.5 @cost += #$tempCostSupp$ -tempCostSupp = DELETE } Quote Link to comment Share on other sites More sharing options...
TheRagingIrishman Posted August 4, 2017 Share Posted August 4, 2017 32 minutes ago, KerbMav said: During launch it says this one has 3 errors - everything looks OK in the game, just as I want it to be. And MM does not create a cache file for me anymore? IIRC when you have errors MM doesn't create a cache Quote Link to comment Share on other sites More sharing options...
blowfish Posted August 4, 2017 Share Posted August 4, 2017 22 minutes ago, TheRagingIrishman said: IIRC when you have errors MM doesn't create a cache That is correct. Quote Link to comment Share on other sites More sharing options...
KerbMav Posted August 4, 2017 Share Posted August 4, 2017 But - if it works - what did I do wrong?! Quote Link to comment Share on other sites More sharing options...
sarbian Posted August 4, 2017 Author Share Posted August 4, 2017 1 minute ago, KerbMav said: But - if it works - what did I do wrong?! You can find a hint on the first line of the OP. Quote Link to comment Share on other sites More sharing options...
KerbMav Posted August 4, 2017 Share Posted August 4, 2017 7 minutes ago, sarbian said: You can find a hint on the first line of the OP. I did not expect it to be of use, as I posted the nasty config that has stolen hours of my playtime. If my insurance covers modding addiction? https://www.dropbox.com/sh/9eqiby2ixec1olr/AACtK0hRZm8ikU1MGvGu44X1a?dl=0 Quote Link to comment Share on other sites More sharing options...
KerbMav Posted August 4, 2017 Share Posted August 4, 2017 (edited) Lords of Kerbol, hear my prayers! Found it ... in the oh so unimportant log ... @PART[*]:HAS[@RESOURCE[Supplies],#CrewCapacity[>0]]:FINAL This also finds parts that I did not touch, so there is no temporary key to remove. @PART[*]:HAS[#tempCostSupp[>0]]:FINAL And one more instance like that also changed and all is well ... @sarbian Nothing to see ... just an old fool ... Although - I am puzzled that this should throw an error, other things will not if they do not find what they are told to do? Edited August 5, 2017 by KerbMav Quote Link to comment Share on other sites More sharing options...
Gordon Dry Posted August 5, 2017 Share Posted August 5, 2017 (edited) Do not laugh! I'm actually trying to straighten some RealFuels flaws using that™ patch ... Well, okay, you may laugh @ -78dB Edit: I have to take a break, until RealFuels is fixed and TANK shows resources in VAB which are present in MM cache file ... Edited August 5, 2017 by Gordon Dry Quote Link to comment Share on other sites More sharing options...
DoctorDavinci Posted August 7, 2017 Share Posted August 7, 2017 Hi all Got a question regarding manipulation of a mesh texture using MM ... I'm having an issue changing textures on some parts when the mesh name has a space in it Is there a work around for this use case ... as in is there a way to get MM to recognize the space in the name or am I pooched on parts with mesh names of this nature? Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted August 7, 2017 Share Posted August 7, 2017 40 minutes ago, DoctorDavinci said: Hi all Got a question regarding manipulation of a mesh texture using MM ... I'm having an issue changing textures on some parts when the mesh name has a space in it Is there a work around for this use case ... as in is there a way to get MM to recognize the space in the name or am I pooched on parts with mesh names of this nature? Do you have an example? I don't see why the space should be an issue Quote Link to comment Share on other sites More sharing options...
Starwaster Posted August 7, 2017 Share Posted August 7, 2017 1 hour ago, DoctorDavinci said: Hi all Got a question regarding manipulation of a mesh texture using MM ... I'm having an issue changing textures on some parts when the mesh name has a space in it Is there a work around for this use case ... as in is there a way to get MM to recognize the space in the name or am I pooched on parts with mesh names of this nature? You can use a ? in place of the space. That will let you run MM patches against it but doesn't guarantee that there won't be a problem internally with KSP. The proper solution to spaces is for people not to use them. @Sigma88 Spaces are a problem for Unity URLs; when parsing them, nothing after the space is seen and they require special handling to deal with. Underscores can also be problematic internally and KSP replaces those with a dot. Module Manager can still parse those however. Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted August 7, 2017 Share Posted August 7, 2017 7 minutes ago, Starwaster said: You can use a ? in place of the space. That will let you run MM patches against it but doesn't guarantee that there won't be a problem internally with KSP. The proper solution to spaces is for people not to use them. @Sigma88 Spaces are a problem for Unity URLs; when parsing them, nothing after the space is seen and they require special handling to deal with. Underscores can also be problematic internally and KSP replaces those with a dot. Module Manager can still parse those however. Ah ok it's a targetting issue? I wasn't sure from the question Quote Link to comment Share on other sites More sharing options...
DoctorDavinci Posted August 7, 2017 Share Posted August 7, 2017 (edited) 19 minutes ago, Starwaster said: You can use a ? in place of the space. That will let you run MM patches against it but doesn't guarantee that there won't be a problem internally with KSP. The proper solution to spaces is for people not to use them. I'll try that, thanks 10 minutes ago, Sigma88 said: Ah ok it's a targetting issue? I wasn't sure from the question It appears that if a model has a mesh name that has a space in it, MM doesn't want to recognize the space so it wont apply the changes that I'm calling for on the section of the model that has the mesh name with a space Hope the ? works Edited August 7, 2017 by DoctorDavinci Quote Link to comment Share on other sites More sharing options...
sarbian Posted August 8, 2017 Author Share Posted August 8, 2017 On 8/7/2017 at 1:43 PM, DoctorDavinci said: It appears that if a model has a mesh name that has a space in it, MM doesn't want to recognize the space so it wont apply the changes that I'm calling for on the section of the model that has the mesh name with a space As explained earlier it is not a problem with MM but with how KSP parse the cfg. For a node definition the parser stops at the first space, line break or { (and possibility some other). So your @PART:HAS[#model[xxx yyyy]] is parsed by KSP (and so seen by MM) as @PART:HAS[#model[xxx Quote Link to comment Share on other sites More sharing options...
DoctorDavinci Posted August 8, 2017 Share Posted August 8, 2017 4 hours ago, sarbian said: As explained earlier it is not a problem with MM but with how KSP parse the cfg. For a node definition the parser stops at the first space, line break or { (and possibility some other). So your @PART:HAS[#model[xxx yyyy]] is parsed by KSP (and so seen by MM) as @PART:HAS[#model[xxx That is what I am seeing with parts that have a space in the mesh name Thanx for clarifying Quote Link to comment Share on other sites More sharing options...
TheRagingIrishman Posted August 12, 2017 Share Posted August 12, 2017 (edited) @sarbian Is there any way to edit some of Squads #autoLoc_XXXXXX's? Normally I'd just edit the parts that use those autoLocs but the autoLocs I want to change are used in code and not in parts so that's not an option. Edited August 12, 2017 by TheRagingIrishman Quote Link to comment Share on other sites More sharing options...
MacLuky Posted August 12, 2017 Share Posted August 12, 2017 Hi, I've wrestled through the many hints on texture replacements in this forum, but am still stuck. I hope you can help me. I tried: +PART[landerCabinSmall] { @name = MacLuky.LanderCanMk12 @title = Mk1 Lander Can Refurbished @manufacturer = MacLuky Space Solutions description = After observing subway commuters during rush hour our lead engineer figured out how to add 2 more seats to the interior. @mass *= 1.02 @entryCost *= 1.2 @cost *= 1.2 @CrewCapacity = 3 !mesh = DELETE MODEL { model = Squad/Parts/Command/mk1LanderCan/model texture = ksp_s_landerCan_normal, MacLuky_Dev/LanderCanMk12/ksp_s_landerCan_normal } @INTERNAL { @name = MacLuky.LanderCanMk12.Internal } } The new IVA shows up just fine, but I can't get the replaced texture to show up. The original texture is at Squad/Parts/Command/mk1LanderCan/ksp_s_LanderCan_normal.dds, the new one at MacLuky_Dev/LanderCanMk12/ksp_s_landerCan_normal.dss What am I doing wrong? (KSP 1.2.2 MM 2.7.5 and KSP 1.3 MM 2.8.1 tested. Puzzled Quote Link to comment Share on other sites More sharing options...
MacLuky Posted August 12, 2017 Share Posted August 12, 2017 Ah, I had mistyped the name of the texture I was trying to replace: texture = ksp_s_landerCan_diff, MacLuky_Dev/LanderCanMk12/ksp_s_landerCan_diff but this leads to a new can of worms: [LOG 12:15:15.075] PartLoader: Compiling Part 'Squad/Parts/Command/mk1LanderCan/mk1LanderCan/MacLuky.LanderCanMk12' [ERR 12:15:15.078] PartLoader: Encountered exception during compilation. System.NullReferenceException: Object reference not set to an instance of an object at PartLoader.ReplaceTextures (UnityEngine.GameObject model, System.Collections.Generic.List`1 textureNames, System.Collections.Generic.List`1 newTextures) [0x00000] in <filename unknown>:0 at PartLoader.CompileModel (.UrlConfig cfg, .ConfigNode partCfg, Single scaleFactor, .AvailablePart partInfo) [0x00000] in <filename unknown>:0 at PartLoader.ParsePart (.UrlConfig urlConfig, .ConfigNode node) [0x00000] in <filename unknown>:0 at PartLoader+<CompileParts>c__Iterator62.MoveNext () [0x00000] in <filename unknown>:0 [ERR 12:15:15.078] PartCompiler: Cannot compile part This time the files _are_ present :-) Quote Link to comment Share on other sites More sharing options...
MacLuky Posted August 13, 2017 Share Posted August 13, 2017 Hypothesis: creating and changing can't happen in the same pass. (But how to test) Quote Link to comment Share on other sites More sharing options...
KerbMav Posted August 13, 2017 Share Posted August 13, 2017 6 minutes ago, MacLuky said: Hypothesis: creating and changing can't happen in the same pass. (But how to test) Both examples below would work just fine. @part[something] { anything = 10 @anything = 10 } +part[something] { @name = somethingelse } I cannot see any basic syntax mistake in your new config - but I never tried replacing a texture myself. Quote Link to comment Share on other sites More sharing options...
Sigma88 Posted August 13, 2017 Share Posted August 13, 2017 1 hour ago, MacLuky said: Hypothesis: creating and changing can't happen in the same pass. (But how to test) You'll have to be more specific than that Quote Link to comment Share on other sites More sharing options...
User456321 Posted August 13, 2017 Share Posted August 13, 2017 How do you go about adding stuff instead of replacing Section I want to modify is currently: MODULE { name = FSfuelSwitch resourceNames =MetallicOre;Uraninite;Substrate;Minerals;Karbonite;ExoticMinerals,RareMetals;MaterialKits;Metals;Polymers;Supplies;Ore;Machinery;Recyclables;SpecializedParts;Fertilizer;Hydrates;Gypsum;Dirt;Silicates;Silicon;RefinedExotics;ColonySupplies;Organics;Rock resourceAmounts = 2000;2000;2000;2000;2000;1000,1000;2000;2000;2000;2000;400;2000;2000;2000;2000;2000;2000;2000;2000;2000;2000;2000;2000;2000 initialResourceAmounts = 0;0;0;0;0;0,0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 tankCost = 3520;1400;600;1600;640;300000;4000;28480;16000;5000;8;31600;14000;64000;4000;1000;20;600;20;40;500000;30000;1000;1000 basePartMass = 0.25 tankMass = 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 hasGUI = false } I want to ADD resources to this, however using the following replaces rather than adds resources. @PART[C3_Kontainer_01] { @MODULE[FSfuelSwitch] { @resourceNames = MetalOre;Metal;RocketParts;ScrapMetal @resourceAmounts = 2000;2000;2000;2000 @initialResourceAmounts = 0;0;0;0 // Always use 0, start empty @tankCost = 2602;19210;3490;1258 // Total resource cost when full plus container cost } } 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.