Changed slots for on_player_*_inventory_changed
Posted: Sat Aug 01, 2020 10:09 am
We already have events that inform us if ammo, armor, gun, main, or trash inventory of a player have changed. Each event returns the index of the player whose inventory was changed. However, I'd like to be able to get some more precise information: the index of the changed slot, or an array of indexes of changed slots.
Reason: I've added a character selector to minime that allows players to change their character at any time during the game if mods providing alternative characters are active. Some mods provide characters with an extended or a reduced inventory. Switching from a character with a big inventory to one with a small inventory and back could lead to the loss of items. I therefore keep a hidden backup-character for each player, so I can restore the lost slots. If I could pinpoint what slots in an inventory have changed, I could keep the backup in sync with the character by responding to on_player_*_inventory_changed in an efficient way -- without having to copy the complete inventory.
Is there any chance that could be implemented, or would that be impossible for technical reasons?
Reason: I've added a character selector to minime that allows players to change their character at any time during the game if mods providing alternative characters are active. Some mods provide characters with an extended or a reduced inventory. Switching from a character with a big inventory to one with a small inventory and back could lead to the loss of items. I therefore keep a hidden backup-character for each player, so I can restore the lost slots. If I could pinpoint what slots in an inventory have changed, I could keep the backup in sync with the character by responding to on_player_*_inventory_changed in an efficient way -- without having to copy the complete inventory.
Is there any chance that could be implemented, or would that be impossible for technical reasons?