Kerbal Inventory System (KIS)

Kerbal Inventory System (KIS)

1M Downloads

KIS parts stopped stacking in the container!

ihsoft opened this issue ยท 2 comments

commented

This bug report appears on the forum once a week in average. And while it seems to be a bug of KIS it's not. KIS cannot stack any arbitrary part because it may impact part's internal state. Imagine you stack a full fuel tank with a half-full tank - what will be the result volume of the fuel when they are "unstacked"? Same problem applies on electricity and other, less obvious, internal conditions of a part. When KIS doesn't know if module has state it just doesn't allow stacking of the part to not mess with the game.

How to make a KIS part non-stackble? Simple: add a custom module on it via ModuleManager. When a new mod is installed it may add own modules to the existing parts, and they will stop stacking. This is the reason why parts that used to stack spontaneously stop doing that.

To fix it find a mod that caused the problem. There is always one! Once found, investigate what ModuleManager patches it applies to the game parts. Ensure that these modules don't have internal state or resources (which is a state too). If everything is good then add that module name into KIS whitelist.

commented

One day it will be fixed via #185. There are no short-term plans to address this issue.

commented

For mod developers

If your mod adds new modules to the existing parts then KIS stacking behavior will likely break. It's not feasible for KIS to list exceptions for all the mods around. Not to mention the compatibility issue when your mod is extended with a new module. Though, it's not that bad! If your mod updates other parts then it indeed uses ModuleManager, and if so it's really easy to ask MM to update KIS configuration to have your cool modules whitelisted.

See how it's done in SurfaceLights mod:

@KISConfig:AFTER[KIS]
{
	@StackableModule
	{
		moduleName = ModuleColoredLensLight
		moduleName = ModuleMultiPointSurfaceLight
		moduleName = ModuleStockLightColoredLens
	}
}

Just create a simliar patch and ship it with your mod. No compatibility issues will be claimed by your fans!