skjiisa / Character-Tracker

Elder Scrolls character tracker for iOS
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Identify ingredients by BaseID and plugin #69

Closed skjiisa closed 4 years ago

skjiisa commented 4 years ago

Right now Ingredients are being identified by their id String which is supposed to be the item's FormID in the game minus their plugin index (though they're not curently being stored correctly), but this isn't specific enough. Two different plugins can have objects with the same FormID, so identification needs to be more specific. Tied to the mod somehow. Either based on the mod's ID, or by the plugin it comes from. The plugin the ingredient comes from would be a better option in case a mod has multiple plugins. This could also be helpful for users using AddItemMenu to find the plugin the item is from.

The easiest way to make this change would be to keep the database structure exactly as-is, but to start using the Ingredient ID as a concatenation of the FormID and the plugin name. For example, changing the Leather ID from db5d2 to 0db5d2 skyrim.esm or skyrim.esm 0db5d2 (I removed too many zeros when adding the IDs initially).

skjiisa commented 4 years ago

Doing plugin then FormID would be better than FormID then plugin as it would group together items from the same plugin when sorted. Because the FormIDs are always 6 characters, they could easily be separated from the plugin name by taking the last 6 characters of the ID string, and the plugin name could be separated by removing the last 7 (because of the space).