sumghai / SDHI_ServiceModuleSystem

Parts pack for Kerbal Space Program that consists of a stockalike Service Module and accessories inspired by NASA’s Orion MPCV, and designed specifically for use with the stock Mk1-3 Command Pod.
Other
23 stars 9 forks source link

Restock Compatability #129

Closed EngTurtle closed 4 years ago

EngTurtle commented 4 years ago

Right now restock overrides the Mk1-3 pod and blacklists stock assets so that SDHI is borked.

For compatibility a .restockwhitelist file needs to be added.

And the MM patch needs to have BEFORE[ReStock] and RestockIgnore = True added.

I've attached my changes in example files. SDHI.restockwhitelist.txt SDHI_SMS_MMPatch_Mk1-3_Pod_Umbilical_Interface.cfg.txt

sumghai commented 4 years ago

I'm not terribly familiar with ReStock, aside from a cursory browse through Nertea's release thread on the KSP forums.

The CFG edit with :BEFORE[ReStock] seems straightforward enough. As for SDHI.restockwhitelist.txt, I assume it doesn't matter too much where I put that file? (as long as ReStock can scan for it in GameData)

I'll look into folding these changes into the next update - thanks!

EngTurtle commented 4 years ago

Did some more testing, the RestockIgnore MM patch needs to be placed in its own node, as shown below. I think because the FOR and BEFORE keywords interfere with each other.

// Add a toggleable Umbilical Interface mesh to the stock Mark 1-3 Pod

@PART[mk1-3pod]:HAS[~RestockIgnore[*]]:BEFORE[000_ReStock]
{
    RestockIgnore = True
}

@PART[mk1-3pod]:FOR[zSDHISMS]
{
    MODEL
    {
           model = SDHI/Service Module System/Parts/SDHI_Service_Module/SDHI_Mk1-3_Pod_Umbilical_Interface
    }
    MODULE
    {
        name = ModuleAnimateGeneric
        animationName = SDHI_Mk1-3_Pod_Umbilical_Interface_ShowHide_Toggle
        startEventGUIName = #autoLOC_SDHI_Mk1-3_Patch_umbilicalInstallGUIName
        endEventGUIName = #autoLOC_SDHI_Mk1-3_Patch_umbilicalRemoveGUIName
        actionAvailable = false            // Prevents umbilical port retrofit from being toggled via Action Groups
        eventAvailableEditor = true
        eventAvailableFlight = false
        eventAvailableEVA = false
    }
}
sumghai commented 4 years ago

Okay, this is now working in my dev environment, with and without ReStock installed - I'll roll this into this weekend's update.

Many thanks for the help, @EngTurtle!