1. Fill your cup and take your pick among the maps best suited for this year's Hive Cup. The 6th Melee Mapping Contest Poll is up!
    Dismiss Notice
  2. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  3. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

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

Discussion in '"Graveyard"' started by thereallywhitekid, May 27, 2009.

?

How would you rate this tutorial?

  1. Highly Recommended

    0 vote(s)
    0.0%
  2. Recommended

    0 vote(s)
    0.0%
  3. Useful

    0 vote(s)
    0.0%
  4. Lacking

    0 vote(s)
    0.0%
  5. Unacceptable

    100.0%
  1. thereallywhitekid

    thereallywhitekid

    Joined:
    Nov 18, 2008
    Messages:
    115
    Resources:
    0
    Resources:
    0
    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.
     
  2. Pyritie

    Pyritie

    Joined:
    Nov 26, 2006
    Messages:
    11,356
    Resources:
    60
    Models:
    30
    Icons:
    9
    Packs:
    3
    Skins:
    12
    Tools:
    1
    Maps:
    1
    Tutorials:
    4
    Resources:
    60