Skip to content

[ENHANCEMENT] Increase Flexibility of InjectTableX Functions #114

Open
@Draxiss314

Description

@Draxiss314

Describe the problem which requires a new feature.

The InjectTableX functions fail to account for changes in the number or positions of columns implemented by other mods. I will use the InjectTableItemStats as an example for the rest of this issue, but this applies to any of the functions:

The current InjectTableItemStats() function is currently not coded to account for changes in the number or positions of attributes in the, nor recognize any additional custom attributes supplied by the user. If a modder wants to create additional attributes affectable by items (as demonstrated in my Thirst Resistance Example mod), they risk incompatibility with other mods, depending on load order. While I can account for mismatched row length and position in my code when my code, anyone else's who adds items to the game using InjectTableItemStats() will cause potential crashes.

Describe the solution you'd like

Ideally, I'd like to see InjectTableItemStats() be able to take in additional arguments, account for changes in attribute position, and account for changes in the number of attribute entries per row. This doesn't just help keep modding more compatibility friendly, but also helps future-proof against changes to vanilla Stoneshard.

Describe alternatives you've considered if any

Let users change the load order so people who add custom attributes can elect to go last.

Honestly however, if InjectTableItemStats() wants to be prioritized over manual table injection, it should be more robust.

Additional context

I quickly whipped up a fork to show what I mean:
InjectTableItemStats
InjectTableMobsStats
InjectTableSkillsStats
InjectTableArmor
InjectTableNewColumn (for generating new columns or moving columns around)
InjectTableWeapons

Note: I haven't actually tested these as I can't build MSL on Linux, which is why I didn't just straight-up ask to push to your branch. Also don't know if this is the most efficient way to go about this, but it's definitely A way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions