Jump to content

[1.8.x-1.12.x] Module Manager 4.2.3 (July 03th 2023) - Fireworks season


sarbian

Recommended Posts

13 hours ago, DialoMalison said:

I'm trying to write a patch to create 0.625m versions of the stock 1.258m fuel tanks.

I wrote this to make a 0.625m version of the FL-T100 Fuel Tank, and it worked perfectly:

  Reveal hidden contents

+PART[fuelTankSmallFlat]
{
    @name = probeTank_Tiny
    @rescaleFactor = 0.5
    @node_stack_top[6] = 0
    @node_stack_bottom[6] = 0
    @entryCost = 600
    @cost = 75
    @title = 0 FS-T040
    @description = A small 40 liter LFO tank for probe size rockets.
    @mass = 0.0312
    @bulkheadProfiles = size0, srf
    @RESOURCE,0
    {
        @name = LiquidFuel
        @amount = 18
        @maxAmount = 18
    }
    @RESOURCE,1
    {
        @name = Oxidizer
        @amount = 22
        @maxAmount = 22
    }
}

So I copy-pasted it 3 times and changed the entries to make copies of the FT-200, FT-400 and FT-800.

  Reveal hidden contents

+PART[fuelTankSmall]
{
    @name = probeTank_Small
    @rescaleFactor = 0.5
    @node_stack_top[6] = 0
    @node_stack_bottom[6] = 0
    @entryCost = 800
    @cost = 140
    @title = 0 FS-T080
    @description = A small 80 liter LFO tank for probe size rockets.
    @mass = 0.0625
    @bulkheadProfiles = size0, srf
    @RESOURCE,0
    {
        @name = LiquidFuel
        @amount = 36
        @maxAmount = 36
    }
    @RESOURCE,1
    {
        @name = Oxidizer
        @amount = 44
        @maxAmount = 44
    }
}

+PART[fuelTank]
{
    @name = probeTank
    @rescaleFactor = 0.5
    @node_stack_top[6] = 0
    @node_stack_bottom[6] = 0
    @entryCost = 1250
    @cost = 250
    @title = 0 FS-T125
    @description = A 125 liter LFO tank for probe size rockets.
    @mass = 0.125
    @bulkheadProfiles = size0, srf
    @RESOURCE,0
    {
        @name = LiquidFuel
        @amount = 56
        @maxAmount = 56
    }
    @RESOURCE,1
    {
        @name = Oxidizer
        @amount = 69
        @maxAmount = 69
    }
}

+PART[fuelTank_long]
{
    @name = probeTank_long
    @rescaleFactor = 0.5
    @node_stack_top[6] = 0
    @node_stack_bottom[6] = 0
    @entryCost = 2400
    @cost = 400
    @title = 0 FS-T250
    @description = A 250 liter LFO tank for probe size rockets.
    @mass = 0.25
    @bulkheadProfiles = size0, srf
    @RESOURCE,0
    {
        @name = LiquidFuel
        @amount = 112
        @maxAmount = 112
    }
    @RESOURCE,1
    {
        @name = Oxidizer
        @amount = 138
        @maxAmount = 138
    }
}

When I run this however, I get 4 errors.

  Reveal hidden contents

[LOG 03:31:00.743] Log started at 2021-01-19 03:31:00.743
[LOG 03:31:01.644] Checking Cache
[LOG 03:31:01.806] SHA generated in 0.157s
[LOG 03:31:01.806]       SHA = 4D-76-74-E8-58-5C-63-03-F5-21-BE-B6-A6-EF-35-DF-16-CC-76-AE-69-C2-13-02-99-D9-86-DD-DF-5B-2C-49
[LOG 03:31:01.827] Changes :
Added   : zMyPatches/MM-ProbeTanks.cfg

[LOG 03:31:01.827] Cache SHA = F8-48-AA-8B-6F-46-B2-3C-E2-4F-BA-4D-1D-AB-DF-8F-6A-35-3E-6E-11-49-C2-FC-E7-27-3B-5A-4E-CB-8D-F3
[LOG 03:31:01.827] useCache = False
[LOG 03:31:01.828] Pre patch init
[LOG 03:31:01.986] compiling list of loaded mods...
Mod DLLs found:
  Name                                    Assembly Version         Assembly File Version    KSPAssembly Version      SHA256

  Assembly-CSharp                         0.0.0.0                  0.0.0.0                  1.10                     535f53fe218e045b57a9d56b78878c944261cf2a4a20b975b19ea8f58c423ec6
  ModuleManager                           4.1.4.0                  4.1.4.0                  2.5                      c3a771f61e578ac9e9d69ac642ddd98dde19de8e26635266876748c86b829d81
Non-DLL mods added (:FOR[xxx]):
Mods by directory (sub directories of GameData):
  Squad
  zMyPatches
Mods added by assemblies:

[LOG 03:31:01.988] Loading Physics.cfg
[LOG 03:31:01.993] Extracting patches
[LOG 03:31:02.062] Applying patches
[LOG 03:31:02.064] :INSERT (initial) pass
[LOG 03:31:02.184] :FIRST pass
[LOG 03:31:02.184] :LEGACY (default) pass
[LOG 03:31:02.208] Applying copy zMyPatches/MM-ProbeTanks/+PART[fuelTankSmallFlat] to Squad/Parts/FuelTank/Size1_Tanks/fuelTankT100.cfg/PART[fuelTankSmallFlat]
[ERR 03:31:02.210] Invalid Vector Index!
[ERR 03:31:02.210] Invalid Vector Index!
[LOG 03:31:02.211] Applying copy zMyPatches/MM-ProbeTanks/+PART[fuelTankSmall] to Squad/Parts/FuelTank/Size1_Tanks/fuelTankT200.cfg/PART[fuelTankSmall]
[ERR 03:31:02.213] Invalid Vector Index!
[ERR 03:31:02.213] Invalid Vector Index!
[LOG 03:31:02.213] Applying copy zMyPatches/MM-ProbeTanks/+PART[fuelTank] to Squad/Parts/FuelTank/Size1_Tanks/fuelTankT400.cfg/PART[fuelTank]
[LOG 03:31:02.215] Applying copy zMyPatches/MM-ProbeTanks/+PART[fuelTank_long] to Squad/Parts/FuelTank/Size1_Tanks/fuelTankT800.cfg/PART[fuelTank_long]
[LOG 03:31:02.223] :BEFORE[ASSEMBLY-CSHARP] pass
[LOG 03:31:02.223] :FOR[ASSEMBLY-CSHARP] pass
[LOG 03:31:02.223] :AFTER[ASSEMBLY-CSHARP] pass
[LOG 03:31:02.223] :BEFORE[MODULEMANAGER] pass
[LOG 03:31:02.223] :FOR[MODULEMANAGER] pass
[LOG 03:31:02.223] :AFTER[MODULEMANAGER] pass
[LOG 03:31:02.223] :BEFORE[SQUAD] pass
[LOG 03:31:02.223] :FOR[SQUAD] pass
[LOG 03:31:02.223] :AFTER[SQUAD] pass
[LOG 03:31:02.223] :BEFORE[ZMYPATCHES] pass
[LOG 03:31:02.223] :FOR[ZMYPATCHES] pass
[LOG 03:31:02.223] :AFTER[ZMYPATCHES] pass
[LOG 03:31:02.226] :FINAL pass
[LOG 03:31:02.226] Done patching
[WRN 03:31:02.227] Errors in patch prevents the creation of the cache
[LOG 03:31:02.364] ModuleManager: 4 patches applied, found <color=orange>4 errors</color>
4 errors related to GameData/zMyPatches/MM-ProbeTanks.cfg

[LOG 03:31:02.365] Ran in 0.720s
[LOG 03:31:02.369] Done!

 

I can't for the life of me see why these patches differ from the first. Can someone tell me what I am doing wrong?

I am using a clean install of KSP 1.10.1 with no mods (other than Module Manager) on Windows 10.

Looks like probably node_stack_top/node_stack_bottom, verify the the parts you're targeting actually have a size specified on the nodes

Also prefer @RESOURCE[LiquidFuel] { @amount = x  @maxAmount = x } over indexing, it's less brittle

Edited by blowfish
Link to comment
Share on other sites

16 hours ago, blowfish said:

Looks like probably node_stack_top/node_stack_bottom, verify the the parts you're targeting actually have a size specified on the nodes

Thank you @blowfish. You were absolutely correct, the two target parts that were producing the errors did not specify the size.

I rewrote the lines like this: 

@node_stack_top = 0.0, 0.55525, 0.0, 0.0, 1.0, 0.0, 0

and now the patch works with no errors.

Link to comment
Share on other sites

I'm hoping to get some help in sorting out a series of patches I need to to apply. I'm trying to convert a lot of parts from the Near Future mods to work with Real Fuels and its customizable fuel tanks. Normally this wouldn't be an issue at all as swapping in the RF module is a fairly simple process of deleting to old tank contents and patching in the module. Unfortunately, Nertea's approach to part variety was to create a few parts which use B9PartSwitch to change their appearance and contents and I really want to preserve the variety of appearances while replacing the tank contents that come along with each appearance. This is where things have started to go sideways for me as I've found it impossible to affect the individual options through a patch in any way that hasn't also resulted in invalidating them.

Anyway, here's what I've tried so far...

First, an example of the config I'm trying to edit:

Spoiler




MODULE
{
name = ModuleB9PartSwitch
moduleID = surfaceSwitch
switcherDescription = #LOC_NFEX_Switcher_FuelTank
switcherDescriptionPlural = #LOC_NFEX_Switcher_FuelTankPlural
baseVolume = 240
	
SUBTYPE
{
name =  Gold 
transform = Tank1875_Large_Foil
title = #LOC_NFEX_Switcher_FuelTank_Gold
descriptionSummary = #LOC_NFEX_Switcher_FuelTank_Gold_summary
descriptionDetail = #LOC_NFEX_Switcher_FuelTank_Gold_detail
primaryColor = #fccb0a
secondaryColor = #fccb0a
tankType = LFOX
addedMass = -0.15
}
...
}

 


This was an attempt to search out the fuel tanks from the mod that I hadn't done a custom edit on (there are a few that I think might need it for various reasons) and delete the tank type and mass adjustment from each subtype, which would then be replaced with its own RF module. I also tried skipping the addition of the RF module and just deleting the tank type references so I could just add a single RF module afterward to the whole part. This is the only one of my attempts that did anything at all and that was generate an error. I'm not really sure where I went wrong with it though.

Spoiler





@PART[nfex-fueltank*],HAS[@MODULE[ModuleB9PartSwitch],!MODULE[ModuleFuelTanks]]:NEEDS[RealFuels]:FOR[zzzMyMods]
{
@MODULE[ModuleB9PartSwitch]
{    
@SUBTYPE,*
{
!tankType
!addedMass

MODULE
{
name = ModuleFuelTanks
utilizationTweakable = true
type = Default
typeAvailable = Default
typeAvailable = Cryogenic
typeAvailable = ServiceModule
typeAvailable = Fuselage
typeAvailable = Balloon
typeAvailable = BalloonCryo
typeAvailable = Structural
typeAvailable = ElectricPropulsion
}
}
}
}    

 

 

This was my second attempt where I tried to affect the B9 tank definitions instead thinking that if I couldn't affect the part switcher subtypes I'd instead change what those tank types inserted into the part. Unfortunately, this patch didn't work at all and I didn't even get errors.

Spoiler





@B9_TANK_TYPE,*:FOR[zzzMyMods]
{
!tankMass
!tankCost
!RESOURCE,*
    
MODULE
{
name = ModuleFuelTanks
utilizationTweakable = true
type = Default
typeAvailable = Default
typeAvailable = Cryogenic
typeAvailable = ServiceModule
typeAvailable = Fuselage
typeAvailable = Balloon
typeAvailable = BalloonCryo
typeAvailable = Structural
typeAvailable = ElectricPropulsion
}
}

 

 

I've tried a few other minor patches, but so far nothing has created the desired result. I've thought about trying to create a new B9 tank type with the RF module already built in, but I'm not sure that the B9 Part Switch module can handle inserting a whole other module like that and even if it can work, I'm still stuck with the problem of not being able to edit the subtypes correctly through a patch.

Any help would be greatly appreciated.

EDIT: Managed to solve it on my own through lots and lots of trial and error.

Edited by SpacedInvader
Link to comment
Share on other sites

On 1/19/2021 at 7:35 AM, DialoMalison said:

I'm trying to write a patch to create 0.625m versions of the stock 1.258m fuel tanksws 10.

Hmm.. I certainly am no expert on MM patching, but I see vector related errs in your log snippet, and looking at the patch, I see these lines, and I have never seen MM patching a vector with this method:
 

 @node_stack_top[6] = 0
 @node_stack_bottom[6] = 0

*If* specifying just one part of the normal node attachment key wors lie that, looing at it, I assume you are trying to edit the *size* portion of the node?
if so, would that not be `[7]` instead of 6?
the 6th element is changing the Z direction of the node, NOT the size, which would be the *7th* element vOv

EDIT:  @DialoMalison so, yeah, i just got confirmation from someone moar MM experienced, that that edit for the attach nodes should work...
so, yeah, what I said about the 6th & 7th positions holds: 6th position is for the Z direction of the node... 7th position is what you want for the *size*

Edited by Stone Blue
Link to comment
Share on other sites

  • 2 weeks later...

Would anyone have an idea why this patch doesn't add kOS to drone cores and the rover probe, but still does to the regular probe cores? I've looke through the config files and they are almost identical, so I don't know what the issue is?

Spoiler

PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[kOSProcessor],#CrewCapacity[0]]:NEEDS[kOS]:Final
{
    MODULE
    {
        name = kOSProcessor
        diskSpace = 10000
        ECPerBytePerSecond = 0
        ECPerInstruction = 0.000004
    }
}

 

Link to comment
Share on other sites

@KawaiiLucy its because you are targeting #CrewCapacity... the drone & rover cores, and others, dont have that key defined in the cfgs.
You could either add a seperate patch to the parts missing it, to add it before your patch runs, or better, try to target the minimumCrew = key in ModuleCommand.
CrewCapacity & minimumCrew define two different things.

Idk if this would work:
 

PART[*]:HAS[@MODULE[ModuleCommand[#minimumCrew[0]]],!MODULE[kOSProcessor]]:NEEDS[kOS]:Final

 

Edited by Stone Blue
Link to comment
Share on other sites

1 hour ago, KawaiiLucy said:

Edit: doesn't work sadly.

Yeah... i was not completely correct with the syntax.
But one of the MM Masters has suggested a correction to me. Lets see if I get it right this time.

I was missing an inner :HAS
Try this:

PART[*]:HAS[@MODULE[ModuleCommand]:HAS[#minimumCrew[0]],!MODULE[kOSProcessor]]:NEEDS[kOS]:Final

 

Link to comment
Share on other sites

4 minutes ago, KawaiiLucy said:

Hmm it tells me that there are three errors, but I can't seem to find it in the log.

Wanna link your log?... also, MM cache file?

I might have mismatched brackets in there now vOv

Edited by Stone Blue
Link to comment
Share on other sites

Hi all,

Looking for a volunteer to write a small patch for me.

There is one mod which has a few parts with size0.5 in the bulkheadProfiles line.  I need to get a patch written which will change that to be size0p5

The mod in question is:  

and while I've contacted the author, I don't know if he is still around and active.  So I'd like to get this patch written so I can include it in the upcoming update to Janitor's Closet (I've totally rewritten the filter section which deals with part sizes).  Of course, if he does update it, then there wouldn't be a need, but I'm not holding my breath.

The four lines which contain it are:

Vostok/_Almach_Control_A.cfg      bulkheadProfiles = size0.5, size0
Vostok/_Almach_Crew_A.cfg         bulkheadProfiles = size0.5, size0
Vostok/_Almach_Decoupler_A.cfg    bulkheadProfiles = size0.5
Vostok/_Almach_Service_A.cfg      bulkheadProfiles = size1, size0.5

Thanks in advance

Edited by linuxgurugamer
Link to comment
Share on other sites

32 minutes ago, linuxgurugamer said:

Hi all,

Looking for a volunteer to write a small patch for me.

There is one mod which has a few parts with size0.5 in the bulkheadProfiles line.  I need to get a patch written which will change that to be size0p5

The mod in question is:  

and while I've contacted the author, I don't know if he is still around and active.  So I'd like to get this patch written so I can include it in the upcoming update to Janitor's Closet (I've totally rewritten the filter section which deals with part sizes).  Of course, if he does update it, then there wouldn't be a need, but I'm not holding my breath.

The four lines which contain it are:


Vostok/_Almach_Control_A.cfg      bulkheadProfiles = size0.5, size0
Vostok/_Almach_Crew_A.cfg         bulkheadProfiles = size0.5, size0
Vostok/_Almach_Decoupler_A.cfg    bulkheadProfiles = size0.5
Vostok/_Almach_Service_A.cfg      bulkheadProfiles = size1, size0.5

Thanks in advance

This should do the trick. I tested it out with Vostok Continued and didn't see any errors or issues. And it's a damn simple patch so it's hard to screw up.

@part[IronVostok_Control_A]
{
	@bulkheadProfiles = size0p5, size0
}

@part[IronVostok_Crew_A]
{
	@bulkheadProfiles = size0p5, size0
}

@part[IronVostok_Decoupler_A]
{
	@bulkheadProfiles = size0p5
}

@part[IronVostok_Control_A]
{
	@bulkheadProfiles = size1, size0p5
}
Link to comment
Share on other sites

36 minutes ago, TBenz said:

This should do the trick. I tested it out with Vostok Continued and didn't see any errors or issues. And it's a damn simple patch so it's hard to screw up.

Thank you.

I added a NEEDS to the lines:

Spoiler

@part[IronVostok_Control_A]:NEEDS[Vostok]
{
	@bulkheadProfiles = size0p5, size0
}

@part[IronVostok_Crew_A]:NEEDS[Vostok]
{
	@bulkheadProfiles = size0p5, size0
}

@part[IronVostok_Decoupler_A]:NEEDS[Vostok]
{
	@bulkheadProfiles = size0p5
}

@part[IronVostok_Control_A]:NEEDS[Vostok]
{
	@bulkheadProfiles = size1, size0p5
}

 

 

Edited by linuxgurugamer
Link to comment
Share on other sites

Is there a way to see what the final incarnation of a part's config looks like after all MM patches are applied? There used to be a way to get at it through the database in the console menu, but the option to view the configs seems to have disappeared. Is there any way to get access to it again?

Link to comment
Share on other sites

7 hours ago, SpacedInvader said:

Is there a way to see what the final incarnation of a part's config looks like after all MM patches are applied? There used to be a way to get at it through the database in the console menu, but the option to view the configs seems to have disappeared. Is there any way to get access to it again?

Look at the file:  ModuleManager.ConfigCache

Link to comment
Share on other sites

Is there a way to delete a top-level node with MM ?

I'm trying to write a patch that would provide compatibility with SpaceDust for Galileo's Planet Pack.

I need to delete the pre-existing SpaceDust resources entirely or the game throws an error when trying to load resources for planet that don't exist in GPP.

I've tried this 

Spoiler

!SPACEDUST_RESOURCE:HAS[#body[Jool]]:NEEDS[GPP]:AFTER[SpaceDust]
!SPACEDUST_RESOURCE:HAS[#body[Eve]]:NEEDS[GPP]:AFTER[SpaceDust]
!SPACEDUST_RESOURCE:HAS[#body[Laythe]]:NEEDS[GPP]:AFTER[SpaceDust]
!SPACEDUST_RESOURCE:HAS[#body[Duna]]:NEEDS[GPP]:AFTER[SpaceDust]

For reasons I can totally understand, it doesn't work.

Is there a correct syntax to do it or is it impossible to target top level nodes? 

Edit: Solved

Edited by lBoBl
Link to comment
Share on other sites

12 hours ago, lBoBl said:

Is there a way to delete a top-level node with MM ?

yes, I think you're just missing brackets which will cause KSP (and thus MM) to treat is as a node, e.g.

!SPACEDUST_RESOURCE:HAS[#body[Duna]]:NEEDS[GPP]:AFTER[SpaceDust] {}

 

Link to comment
Share on other sites

  • 2 weeks later...

I love cats as much as the next person (and perhaps even more,) but would it be possible to at least put a message in the log that says "Nyan Cat - no, your install isn't broken" for when the Nyan Cats show up as an easter egg? I just blew an hour on trying to figure out what went wrong with my install when the answer was apparently "nothing" >_>

Link to comment
Share on other sites

Goal: avoid TweakScale under RealismOverhaul (known to be problematic) by using MM to selectively make 3 or 4 rescaled copies of a few select parts that I tend to want different sizes.

To figure it out I started with the stock vernierEngine and am trying to MM copy it to 2x scale.  I hand calculated the cubic mass increase (not sure I needed to but will circle back as req'd) and hand calculated the quadratic thrust increase.  I think I have the general idea right but am not getting the patch into the correct order with regards to RealismOverhaul patches, or I'm totally missing a step that would actually make them available in the editor generally.

The problem is they don't show up in the editor.  So I'm open to any education on any aspect of my cfg file even if it doesn't directly solve this issue as I'm trying to learn as much as I can about MM.  I've read through the wiki and have done what I can with that info given my current understanding of it at this point; and I'm clearly not understanding something...

I'm not getting any related errors in KSP.log, mono.log, or Player.log so unless you really want them, I'll hold off for now.

Here is the patch file:

// based on RO entry for vernierEngine, a bit of a stab in the dark, placed AFTER RO in hopes it plays nice with RO that way

+@PART[vernierEngine]:AFTER[RealismOverhaul]
{
    @name = vernierEngine2x
    @title = Vernier 2x
  %rescaleFactor = 2.0
    %RSSROConfig = True

    @mass = 0.08

    %useRcsConfig = RCSBlock
    %useRcsMass = True
    %RcsNozzles = 1

    @crashTolerance = 10
    @maxTemp = 1473.15
    %skinMaxTemp = 2473.15

    @title = Attitude Jet 2x, Conformal (275/445 N class)
    @manufacturer = Generic
    @description = A generic conformal RCS thruster 2x. Use this for attitude control or translation/ullage for spaceplanes. LEO-rated heat shielding.

    @MODULE[ModuleRCS*]
    {
        @thrusterPower = 1.1
        !resourceName = DELETE

        !PROPELLANT,*{}

        PROPELLANT
        {
            ratio = 1.0
            name = Hydrazine
        }

        @atmosphereCurve
        {
            @key,0 = 0 254
            @key,1 = 1 82.08
        }
    }
}

// the following is a bit of a stab in the dark also reflecting another RO entry i found for vernierEngine

@PART[vernierEngine2x]:AFTER[RealismOverhaul]
{
    @MODULE[ModuleEngineConfigs]
    {
        @CONFIG[MMH+NTO]
        {
            @IspSL = 0.953
        }

        @CONFIG[UDMH+NTO]
        {
            @IspSL = 0.95
        }

        @CONFIG[Aerozine50+NTO]
        {
            @IspSL = 0.963
        }
    }
}

 

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...