Add custom loadout groups#4626
Conversation
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27819212851.zip |
bf405b5 to
20fdd09
Compare
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27823707303.zip |
Let players define their own nestable loadout generics ("custom groups")
and use them as loadout slots, alongside CE's built-in generics.
Persist custom groups inside the save instead of a shared global config file. Hold a group's members in a single ordered list, so any member can be drag-reordered to any position in the editor. Add export/import of groups to standalone files, and move the whole feature into the Custom Groups tab.
20fdd09 to
58bd1db
Compare
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27825072002.zip |
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27850223808.zip |
When enabled, rearmament will acquire members following the list order
99c3e54 to
20f1e4c
Compare
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27850593372.zip |
Safairette
left a comment
There was a problem hiding this comment.
Defs are not an appropriate medium to store this kind of custom player-created data, for various compatibility reasons.
| } | ||
| } | ||
|
|
||
| private static ListLoadoutGenericDef GetOrCreateDef(CustomGroupConfig cfg, HashSet<ushort> takenHashes) |
There was a problem hiding this comment.
You should not be using defs to store this data, as they were never meant for temporary player-created content in game. They should be stored independently and only merged into the defined generic defs when building the loadout options.
If you need a pointer to how the base game handles custom player-created content like that, you should look at how the custom scenarios and xenotypes are created.


Additions
loadoutgroupstorage type).Utility_ReferenceGraph: a small generic lazy-edge cycle-detection helper (IsReachable/WouldCreateCycle), reused by group nesting.UI/Icons/exporticon.Changes
LoadoutGenericDef:_lambdamadeprotected, added a stat-cache invalidation hook and an empty-members guard inupdateVars, so the predicate can be driven by a subclass. No change to built-in generics' behavior.LoadoutManager.ExposeDatanow scribes custom groups before the loadouts, so group defs are registered in time for loadout slots to resolve them bydefName.References
Reasoning
LoadoutGenericDefsubclass, so loadout slot save/load andJobGiver_UpdateLoadoutwork unchanged — a group is a generic.Alternatives
Testing