Open erem2k opened 1 year ago
This is something I've hit trying to randomize weapons and appropriate uniform\vest\backpack cargos, but this can also be quite useful for handling fully or partially DLC-restricted loadouts.
PR to address this is being prepared, hopefully this issue will provide additional context.
Currently inventory system resolves final loadout from config name right in the
XPT_fnc_loadInventory
before applying it to the unit. This includes fetching inventory defines from XPTLoadouts, performing random selections, etc. before formatting an array forsetUnitLoadout
call which does the actual application.It would be beneficial to have an opt-in API that will allow to override the default behavior for creating loadout array, while preserving the general function of XPT loadout system.
This can be achieved by abstracting out the section of logic that currently does loadout resolution into separate function and introducing define for description.ext which will allow scripter to declare override function to be used in
XPT_loadInventory
in place of default one.Such API will allow to extend the behavior of loadInventory in consistent and easier to maintain fashion, while generic use case will remain unaffected.