Mod API add event that fires before character's main inventory changes size
Posted: Sun Apr 30, 2023 7:35 pm
I'm the author of a mod called SpillProof, currently I set all armor bonuses to 0 and listen for armor slot changes to manually add and remove slots via the character's bonus slot value in an attempt to prevent items from spilling when you accidentally unequip armor (the items stacks are moved to a script inventory before reducing the bonus and added back from the script inventory after the bonus is applied).
I propose/request an event that fires before a characters main inventory size changes and has a buffer of the item stacks that are going to be removed from the inventory and spilled to the floor. Then my mod would be able to react to those events instead and I wouldn't need to remove the armor slot bonuses (making it difficult to see how many slots given armor gives you because the tooltip no longer has this information present) plus, it would allow me to react to other mods adding and removing slots without needing specific compatibility built into them (For example, Nullius adds equipment that adds and removes slots via the inventory slot bonuses value, which is where I'm currently experiencing compatibility issues)
Items spilling from accidentally removing armor are frequently complained about by players, and while I understand that preventing it in a fair and balanced way in engine may be impossible, that doesn't need to mean that mods can't do it however the author felt was fair and balanced. Having such an event makes implementing such a mod much easier.
I propose/request an event that fires before a characters main inventory size changes and has a buffer of the item stacks that are going to be removed from the inventory and spilled to the floor. Then my mod would be able to react to those events instead and I wouldn't need to remove the armor slot bonuses (making it difficult to see how many slots given armor gives you because the tooltip no longer has this information present) plus, it would allow me to react to other mods adding and removing slots without needing specific compatibility built into them (For example, Nullius adds equipment that adds and removes slots via the inventory slot bonuses value, which is where I'm currently experiencing compatibility issues)
Items spilling from accidentally removing armor are frequently complained about by players, and while I understand that preventing it in a fair and balanced way in engine may be impossible, that doesn't need to mean that mods can't do it however the author felt was fair and balanced. Having such an event makes implementing such a mod much easier.