I am attempting to make a map which uses recipes to make items from a series of components. For example, if I were to combine Iron Ingot, Iron Ingot (Repeated intentionally), and Leather I would make Iron Armor.
I found a very useful tutorial which uses triggers and the activation of a button to accomplish this (Link Below). Unfortunately, that system only checks if the items are present in the inventory, and does not check their order. For most maps I could understand how this would not be a problem, but the map I want to make has many recipes which have repeated components (For example another item, different from the one above could require Iron Ingot, Leather, and Iron Ingot) thus it is important to not only check items present, but the order in which they are present in the inventory.
So here is my question: Is there a way to tweak the method found in the link, or another way outright which I can use to combine items based on their order in an inventory. Also, I have already considered a button for each combination, but this won't work because there is not enough space in the command card.
I didn't even click the link but I think arrays are the clear choice here. Let's say you have an array that holds your recipe ingredients...let's say each ingredient has an integer "ID" associated with it, you would just load up your ingredient array with those IDs, in order.
I use this technique a lot for player groups. The built-in Player Group functions don't take order into account. So I don't generally use those. I use arrays.
Unfortunately the built-in array methods are pretty bad, so you have to manually keep track of array length, manually check for values, and manually push/pop items. I suppose I should write a library to fix that at some point.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am attempting to make a map which uses recipes to make items from a series of components. For example, if I were to combine Iron Ingot, Iron Ingot (Repeated intentionally), and Leather I would make Iron Armor.
I found a very useful tutorial which uses triggers and the activation of a button to accomplish this (Link Below). Unfortunately, that system only checks if the items are present in the inventory, and does not check their order. For most maps I could understand how this would not be a problem, but the map I want to make has many recipes which have repeated components (For example another item, different from the one above could require Iron Ingot, Leather, and Iron Ingot) thus it is important to not only check items present, but the order in which they are present in the inventory.
So here is my question: Is there a way to tweak the method found in the link, or another way outright which I can use to combine items based on their order in an inventory. Also, I have already considered a button for each combination, but this won't work because there is not enough space in the command card.
Previously mentioned link: http://www.sc2mapster.com/forums/resources/tutorials/6380-trigger-data-item-recipe-combining-system-tutorial/
Thank you for any help you can provide!
@DaBernMon: Go
I didn't even click the link but I think arrays are the clear choice here. Let's say you have an array that holds your recipe ingredients...let's say each ingredient has an integer "ID" associated with it, you would just load up your ingredient array with those IDs, in order.
I use this technique a lot for player groups. The built-in Player Group functions don't take order into account. So I don't generally use those. I use arrays.
Unfortunately the built-in array methods are pretty bad, so you have to manually keep track of array length, manually check for values, and manually push/pop items. I suppose I should write a library to fix that at some point.