Jump to content

ModuleManager confusion: trying to edit a resource converter


Recommended Posts

I am trying to patch the fuel cell for the Shuttle Orbiter Construction Kit space shuttle, to replace a stock-style LFO converter with a hydrogen-oxygen fuel cell based on the ones in BDB.

The original module looks like this:

	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = #autoLOC_502022 //#autoLOC_502022 = Fuel Cell
		StartActionName = #autoLOC_502023 //#autoLOC_502023 = Start Fuel Cell
		StopActionName = #autoLOC_502024 //#autoLOC_502024 = Stop Fuel Cell
		ToggleActionName = #autoLOC_502025 //#autoLOC_502025 = Toggle Fuel Cell
		FillAmount = 0.95
		AutoShutdown = false
		GeneratesHeat = false
		UseSpecialistBonus = false
 
		 
		INPUT_RESOURCE
		{
			ResourceName = LiquidFuel
			Ratio = 0.00009
			FlowMode = NO_FLOW
		}
		INPUT_RESOURCE
		{
			ResourceName = Oxidizer
			Ratio = 0.00011
			FlowMode = NO_FLOW
		}
		OUTPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 1.0
			DumpExcess = True
		}
	}

 

My attempt at patching it looks like this:

@PART[benjee10_shuttle_midFuselage]:NEEDS[Benjee10_shuttleOrbiter]:FINAL
{
    !RESOURCE[LiquidFuel]
    !RESOURCE[Oxidizer]

    RESOURCE
    {
        name = Hydrogen
        amount = 64000
        maxAmount = 64000
    }

    RESOURCE
    {
        name = Oxygen
        amount = 32000
        maxAmount = 32000
    }

    @MODULE[ModuleResourceConverter]
	{
		@AutoShutdown = True

        !INPUT_RESOURCE[LiquidFuel]
        !INPUT_RESOURCE[Oxidizer]
		 
		INPUT_RESOURCE
        {
            ResourceName = Hydrogen
			Ratio = 0.7
			FlowMode = NO_FLOW
        }
        INPUT_RESOURCE
        {
            ResourceName = Oxygen
			Ratio = 0.35
			FlowMode = NO_FLOW
        }
        @OUTPUT_RESOURCE
        {
            ResourceName = ElectricCharge
            Ratio = 1.5
            DumpExcess = False
        }
        OUTPUT_RESOURCE
        {
            ResourceName = Water
            Ratio = 0.00055643
            DumpExcess = True
        }
	}
}

The first parts of this patch are an attempt to remove the liquid fuel and oxidizer from the part as they are no longer needed for the fuel cell, plus an attempt to add the hydrogen and oxygen that are now needed.

The rest of the patch is for editing the module itself. The result is that the functionality of the edited fuel cell gets inexplicably merged with the functionality of the original fuel cell (see image below), instead of replacing it. What is going wrong here, and what is the correct way to do this?

h8yVkGN.png

Link to comment
Share on other sites

  • 4 weeks later...

When deleting a subnode the correct syntax requires {} at the end (for a key an = value is required). Also the way you were editing the OUTPUT_RESOURCE node would have caused duplicate keys to be created. You need to use @ to tell MM to edit the value.

Corrected patch (untested)

Spoiler
@PART[benjee10_shuttle_midFuselage]:FINAL
{
	!RESOURCE[LiquidFuel] {} // when deleting subnodes the brackets are required
	!RESOURCE[Oxidizer] {}

	RESOURCE
	{
		name = Hydrogen
		amount = 64000
		maxAmount = 64000
	}

	RESOURCE
	{
		name = Oxygen
		amount = 32000
		maxAmount = 32000
	}

	@MODULE[ModuleResourceConverter]
	{
		@AutoShutdown = True

		!INPUT_RESOURCE[LiquidFuel] {}
		!INPUT_RESOURCE[Oxidizer] {}

		INPUT_RESOURCE
		{
			ResourceName = Hydrogen
			Ratio = 0.7
			FlowMode = NO_FLOW
		}
		INPUT_RESOURCE
		{
			ResourceName = Oxygen
			Ratio = 0.35
			FlowMode = NO_FLOW
		}
		@OUTPUT_RESOURCE[#ResourceName[ElectricCharge]]
		{
			@Ratio = 1.5
			@DumpExcess = False
		}
		OUTPUT_RESOURCE
		{
			ResourceName = Water
			Ratio = 0.00055643
			DumpExcess = True
		}
	}
}

 

 

Link to comment
Share on other sites

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...