Tutorial: Item Combinations
Difficulty: Intermediate
RPG Maker: 2000/2003
Author: Thejackyl

Item Combination? What's that?
Simply put, we are going to create an NPC, that takes multiple items, and gives you a better item. For example: Add two potions, and make an elixer.

Sounds interesting... What do I need
- One Variable per Ingredient,
- Knowledge of Conditional Branches
- "Materials" The Items to combine
- "Product" The outcoming Item

Alright, get to the coding
Alright, the following code is an example that takes two items. A Red Gel, and A Blue Gel, to make a Mixed Gel.
<>Condition Branch = If Red Gel Possessed
  <>Conditional Branch = If Blue Gel Possessed
    <>Item Add 1 Mixed Gel
    <>Item Remove 1 Red Gel
    <>Item Remove 1 Blue Gel
  <>Else
    <>--Not enough items message here!--
 <>Else
  <>--Not enough items message her!--
<>End

Hey, that didn't use Variables... You Liar!!
Alright, fine. Say an NPC will take 3 red gels to make an elixer

<>Variable set to #of Red Gel Possessed(Item1)
<>Variable set to #of Blue Gel Possessed(Item2)
<>Condition Branch = If Variable [Item1] =>2
  <>Condition Branch = If Variable [Item2] =>1
    <>Item Add 1 Elixer
    <>Item Remove 2 Red Gel
    <>Item Remove 1 Blue Gel
  <>Else
    <>--Not enough items message here!--
<>Else
  <>--Not enough items message here!--
<>End

That's about it. Test it to see if it works.



Click to Return to the Tutorials Page