I'm using LuaGameScript::create_inventory to temporarily store an entity's inventory before copying it back at a later time. Unfortunately I can't easily copy across filters because inventory.supports_filters() is false for an inventory created with LuaGameScript.create_inventory().
I'm going to use a workaround that stores the filters in a separate table, but it is quite inconvenient
Thanks
Support filters for inventories created with LuaGameScript::create_inventory
Support filters for inventories created with LuaGameScript::create_inventory
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Support filters for inventories created with LuaGameScript::create_inventory
I'd rather not; filters in an inventory more than doubles the amount of CPU time it takes to do any operation with the inventory; even when not used. There's a reason most inventories in the game are not filtered.
If you want to get ahold of me I'm almost always on Discord.
Re: Support filters for inventories created with LuaGameScript::create_inventory
That makes sense, thanks for the quick reply.
I suppose you could do LuaGameScript::create_filtered_inventory that creates a completely different kind of inventory with filters, but that would presumably be a lot more work, and would make the api more cluttered for little gain. Obviously I'd appreciate it though
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings