Replies: 2 comments
-
You're talking about the |
Beta Was this translation helpful? Give feedback.
-
In TOS the index basically dictates the order in which the items appear in your inventory. The indices also use ranges to determine in which category the items should appear. For example, 1000~2000 might be weapons, 2000~3000 might be armors, etc. The client regularly wants item data together with the indices though, and getting the index for an item which you need to send to the client is a little annoying right now, because you'd have to ask the inventory to find the item and get its index. The index is otherwise irrelevant and we don't even store it. We only store an int for the sort order, to keep the order the same on load next time. The index is assigned when the item is added to the inventory iirc. |
Beta Was this translation helpful? Give feedback.
-
When I initially coded the inventory, I thought it would be nice to keep the inventory index out of the Item class, so it doesn't has to know anything about that stuff. While this still works, maybe it would be easier to just set the index on the item, so we don't have to jump through hoops to get items with their indices, like creating indexed dictionaries or tuples. Right now you can't get an item with its index in one object, I think that's not ideal.
Beta Was this translation helpful? Give feedback.
All reactions