Hey guys.
I am currently working on a crafting recipe helper for a game I play. The general idea is to have a drop down menu where you can select the recipe you want to craft, select how many you want to craft, and then get a total of all the raw uncrafted materials you would need to make said query. All I have right now is a table of all the basic raw materials seperated by type and rarity. Heres an example:
There are quite a few more in my table but this is the gist. The issue I ran into was when rarer items needed common items to be crafted. I can't figure out how to give the Gold Handle its value by drawing a value from the Bronze Handle.
The further down the rarity tree you go, you end up needing 3-4 recipes and basic materials to craft the next item. I can't find a good way to do this. Would making a small table like above be a good way to store the material value of the item while also being able to use it with other recipes to add its value to it? If so how would I use tables to use that info in such a way? I thought I was doing ok but then my math keep being wrong and I can't seem to find a decent way to set my tables up to handle info nesting like that.
I hope this makes sense, I tried to be as clear as possible without making to long of a post.
Any help is appreciated!
I am currently working on a crafting recipe helper for a game I play. The general idea is to have a drop down menu where you can select the recipe you want to craft, select how many you want to craft, and then get a total of all the raw uncrafted materials you would need to make said query. All I have right now is a table of all the basic raw materials seperated by type and rarity. Heres an example:
Common Stone | Rare Stone | Common Wood | Rare Wood | Common Metal | Rare Metal | Common Crafted | Rare Crafted |
Quartz | Ruby | Oak | Beech | Bronze | Platinum | Oak Panel | Beech Shield Panel |
Granite | Diamond | Maple | Ash | Steel | Gold | Bronze Handle | Gold Handle |
There are quite a few more in my table but this is the gist. The issue I ran into was when rarer items needed common items to be crafted. I can't figure out how to give the Gold Handle its value by drawing a value from the Bronze Handle.
Bronze Handle | |
Uncrafted Items | Amount |
Bronze | 1 |
Oak | 1 |
Gold Handle | |||
Uncrafted Items | Amount | Crafted Items | Amount |
Gold | 1 | Bronze Handle | 1 |
Ash | 1 |
The further down the rarity tree you go, you end up needing 3-4 recipes and basic materials to craft the next item. I can't find a good way to do this. Would making a small table like above be a good way to store the material value of the item while also being able to use it with other recipes to add its value to it? If so how would I use tables to use that info in such a way? I thought I was doing ok but then my math keep being wrong and I can't seem to find a decent way to set my tables up to handle info nesting like that.
I hope this makes sense, I tried to be as clear as possible without making to long of a post.
Any help is appreciated!