KIS Inventory and inflatable parts
TonkaCrash opened this issue ยท 4 comments
I found a closed issue that discusses this a little, but no real resolution.
Using an inflatable part with variable number of seats a Kerbal cannot be transferred into the part. A message is given "Pod doesn't have personal inventory space" The part has a CrewCapacity = 6 closed and CrewCapacity = 24 inflated. To work around issue, setting the closed and inflated capacities equal (24) hides the problem.
If fixed, it would be acceptable to destroy parts in inventory if the number of seats is decreased on a part.
USI Animation is used for the animation.
MODULE
{
name = USIAnimation
deployAnimationName = Deploy
secondaryAnimationName = Rotate
inflatable = true
CrewCapacity = 24
inflatable = true
}
KIS cannot handle variable number of seats. It's defined deep in the mod's design (all parts must be final at the initial screen loading). The CrewCapacity
has to be set to the maximum value in the part's config for KIS to work. This behavior may change in KIS 2.0
. Maybe.
I think I've found a good workaround. The inflatable parts, that by default are deflated (and the crew number is low), can now add inventories themselves. KIS
will correctly detect and use such modules. For this to work, the part's config need to add one inventory per pod seat:
MODULE
{
name = ModuleKISInventory
invType = Pod
}
Alas, it's not possible in the current architecture to dynamically detect the crew number increase. When the game is loaded, the game have to know the number of the modules in the part. With the new saved state upgrade pipeline it's technically possible to intercept the execution and update the part prefab with extra modules just before the actual loading has started. But for now it looks error prone.
Well, when I said I've found a workaround, I meant "I found a way how to fix the code" :) The workaround will only work in the next version of KIS
. Note the commit 16dc3c3. Without this change the externally added pod inventories will be rejected.
I get an error message for the affected part during game load when I implement the pod inventory:
[ERR 09:11:45.114] Part [Part:Centrifuge.30m (id=C4294675024)] has pod inventories in config. Cannot make a proper setup!
From the KSP Dev Log Console this is coming from KIS.KISAddonConfig.AddPodInventories.
I tested it in sandbox and it works at least for the initial 4 Kerbals.
This is for an old part I resurrected that was still a WIP when the developer disappeared. It is incomplete with no interior. It's the big ring in this video of a station of mine. I defined it to be 24 crew expanded/6 collapsed. For this part the internal volume doesn't change, but the ring parts are inaccessible while collapsed.,
After your initial comments on this I had just set the capacity at 24 expanded or collapsed and forgot about the issue. I wasn't planning to release my patched version of the part, so it didn't bother me once I had a workaround that worked for me.
Below is the KISInventory patch I use on the part. Before this morning I already had the first block to define a single large part inventory. I added 24 pod inventories this morning:
@PART[Centrifuge_30m]:HAS[!MODULE[ModuleKISInventory]]:FINAL
{
MODULE {
name = ModuleKISInventory
maxVolume = 300
@maxVolume *= 24 // Expanded capacity is 24 seats
externalAccess = true
internalAccess = true
slotsX = 10
slotsY = 8
slotSize = 50
itemIconResolution = 128
selfIconResolution = 128
openSndPath = KIS/Sounds/containerOpen
closeSndPath = KIS/Sounds/containerClose
defaultMoveSndPath = KIS/Sounds/itemMove
}
... The config file repeats the following block for 24 seats ...
MODULE {
name = ModuleKISInventory
invType = Pod
}