1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. 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,357
    Resources:
    60
    Models:
    30
    Icons:
    9
    Packs:
    3
    Skins:
    12
    Tools:
    1
    Maps:
    1
    Tutorials:
    4
    Resources:
    60