EO 2.3 Crafting Tweak Help

Hey guys.

So, I’m currently using this tutorial

http://www.eclipseorigins.com/community/index.php?/topic/129353-dynamic-crafting-system/

And I’m trying to fix a bug that I’m encountering. If you’re trying to craft an item using 2 or more of the same item, the recipe only requires one to work. I believe that this is because of the phrasing of these lines in ModPlayer>CraftItem:

If HasItem(Index, Item(ItemNum).Recipe(1)) Then
If HasItem(Index, Item(ItemNum).Recipe(2)) Then
TakeInvItem Index, Item(ItemNum).Recipe(1), 1
TakeInvItem Index, Item(ItemNum).Recipe(2), 1
GoTo MakeItem

As you can see, if the items for Recipe(1) and Recipe(2) are the same (the items required for final product) the game cannot make distinction between the two and thinks you have all items required.

What I want to do if make a small check.

So basically

If (code I need here) .Recipe(1) = (code I need here) .Recipe(2) then
(triggers a boolean)

if (boolean) = true then
TakeInvItem Index, Item(ItemNum).Recipe(1), 2
else

TakeInvItem Index, Item(ItemNum).Recipe(1), 1
TakeInvItem Index, Item(ItemNum).Recipe(2), 1

something along the lines of that ^^^. Any help?

If you need more info, just post so 😄

TakeInvItem Index, Item(ItemNum).Recipe(1), 1
TakeInvItem Index, Item(ItemNum).Recipe(2), 1

Those lines are part of the problem, but I see it only ever checks if you have the item, not the amounts as well. This entire system seems to be full of poorly written sections, wonder if I have time this weekend to rewrite it.

Yeah, that was my thought as well. 😧 I could have a work-around, but I would like this to be fixed for the sake of being clean.

Log in to reply