• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to make an Item Recipe System - Like DotA's

How would you rate this tutorial?

  • Highly Recommended

    Votes: 0 0.0%
  • Recommended

    Votes: 0 0.0%
  • Useful

    Votes: 0 0.0%
  • Lacking

    Votes: 0 0.0%

  • Total voters
    1
How to make an Item Recipe System - Like DotA's

I've seen and observed many people wonder how to make a simple recipe system. Those who do find out a way to do it are not as efficient and have a lot of triggers. My way of making a Recipe System may not be the most efficient but certainly is efficient enough and only takes 2 triggers.


Processes:

Step 1:

Create 3 items.

1. The first item is supposed to be the actual item. Let's say we have an item, it's called Cranium Basher. (Yes, the one from DotA)

2. The second item should be the Display. The display should show the required items. In some cases, people don't use a display but for this tutorial, I will add a Display because I want people to see the icon of the item they're going to buy.

3. The third one is the recipe scroll. This recipe scroll will be used in most of the triggers we're going to make.


Step 2:

Create the needed items. In this example, we have 2 items to make:

1. Javelin
2. Gauntlets of Ogre Strength


Triggering:

This is the first trigger which is the actual creating of the item:

  • Cranium Basher
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Javelin) Equal to True
          • ((Hero manipulating item) has an item of type Gauntlets of Ogre Strength) Equal to True
          • ((Hero manipulating item) has an item of type Cranium Basher (Recipe)) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Javelin)
          • Item - Remove (Item carried by (Hero manipulating item) of type Gauntlets of Ogre Strength)
          • Item - Remove (Item carried by (Hero manipulating item) of type Cranium Basher (Recipe))
          • Item - Create Cranium Basher at (Position of (Hero manipulating item))
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\Alem\AlemTarget.mdl
          • Hero - Give (Last created item) to (Hero manipulating item)
          • Wait 2.00 seconds
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Do nothing
The second trigger gives the Hero the recipe scroll when he buys the display.

  • Cranium Basher Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) has an item of type Cranium Basher (Display)) Equal to True
    • Actions
      • Item - Remove (Item carried by (Hero manipulating item) of Cranium Basher (Display))
      • Item - Create Cranium Basher (Recipe) at (Position of (Hero manipulating item))
      • Hero - Give (Last created item) to (Hero manipulating item)

Well, I guess that's all. I told you, only 2 triggers are needed.
If you find anything wrong or If you found a memory leak or you saw skirmish with my triggering then please tell me.
Also, try to tell me how to improve the triggering.
 
Top