ModShardTeam / ModShardTeam/ModShardLauncher

[ENHANCEMENT] Increase Flexibility of InjectTableX Functions

Open
#114 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
55
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the InjectTableX implementations linked in ModUtils/TableUtils, especially ItemStats.cs, MobsStats.cs, SkillsStats.cs, TableArmor.cs, TableUtils.cs, and TableWeapons.cs. Compare their handling of column positions, row lengths, and custom attributes with the requested behavior; done means the injection functions remain compatible when other mods add or move attributes without causing crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.