You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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 idsI think both approaches have merit and would be useful in different situations.
The text was updated successfully, but these errors were encountered: