Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item ID discovery #53

Open
samdeane opened this issue Sep 6, 2022 · 2 comments
Open

Item ID discovery #53

samdeane opened this issue Sep 6, 2022 · 2 comments

Comments

@samdeane
Copy link

samdeane commented Sep 6, 2022

Now that we have system.getItem (which is great by the way - thanks for that), we could do with a better way to discover item ids.

For example, I'm building an in-game industry helper, where you can specify an item, and it will tell you what you need to build, how much ore you need, and so on.

Right now if I want to give the user a UI to pick items, I need my own lookup table. That's potentially a big table, and if it is hard-coded in my source, it's fragile and likely to break or be out of date quite often.

I can think of two approaches.

The first is a function system.getItemsMatching(string), which returns a list of items whose localized name includes the string.

The second is a set of functions which lets you obtain lists of items by category - using the same categories as the industry / crafting UI uses in game:

  • system.getItemCategories(string) which returns a list of top level categories (if you pass nil in), or returns a list of subcategories (if you pass a category name in).
  • system.getItemsInCategory(string), which takes a sub-category and returns a list of item ids

I think both approaches have merit and would be useful in different situations.

@ShadowLordAlpha
Copy link

Another possible way would be to have something similar to the bank where we can get the item IDs that the industry is able to create with filters for all items, ones that the industry is able to produce or have schematics for, and ones that we have all items to produce

@NQ-Ligo
Copy link

NQ-Ligo commented Jan 19, 2023

Hummm, why not, I will consider a way to get an extract of the itembank with potential conditions or filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants