Jump to content

Need help writing MM patch.


Recommended Posts

Trying my hand writing a MM patch to add stock cargo capacity to two parts from Suicidal Insanity's Project Orion mod. Here is the patch as written:

Spoiler

@PART[SPO_CrewSpine_Short]
{
    MODULE
    {
        name = ModuleInventoryPart        
        InventorySlots = 12
        packedVolumeLimit = 1500
    }
}            

@PART[SPO_375mHab]
{
    MODULE
    {
        name = ModuleInventoryPart        
        InventorySlots = 24
        packedVolumeLimit = 5000
    }
}

It works, but TOO well. For some reason it adds two stock inventories to each part, each with the listed specs (12 slots/1500L for the small one, 24 slots/5000L for the larger.) Each one works fine, loading and unloading parts independently Pic:

k6Vudb8.png

Now I could work around it just by halving the specs, but I can't figure out why it is giving me two separate inventories in the first place. I'm really new at writing MM patches, so please ELI5.

KoS

Edited by Kerbals_of_Steel
Link to comment
Share on other sites

I can only think it’s linked to the crew seats ie 2 seats so adds it twice thinking it’s seat inventory? Does the MM log throw anything up? (In main KSP folder/patches/ModuleManager).

Link to comment
Share on other sites

In Module Manager syntax (link) writing  MODULE { ... } will insert a new  module in the configuration.

To change an existing configuration, usually you want the @ or 'at' operator, and the name of the module in square brackets.  The % operator, like @, says to make a change but % will also add the entry if it is not already in the configuration.

    @MODULE[ModuleInventoryPart] {
        %InventorySlots = 12
        %packedVolumeLimit = 1500
    }

Edited by OHara
better link
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...