• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How To Make Item Recipes

Level 2
Joined
Aug 5, 2008
Messages
5
I seem to be getting my recipe triggers working by using GSE's setup, but it seems that every time i try to edit the description of the "mask" item to make it show what's required/bonuses given, i can't seem to fit all the information on the basic description where it shows the buyer the information in the shop. I tried doing things such as Requires :|r|n-Gauntlers|r|n to skip the lines and what not, but all of it seems to not fit?
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Hey,use this,it works,i'm using it :)
  • Events
  • Unit - A unit Acquires an item
  • Conditions
  • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
  • Actions
  • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +15) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ItemAmount Equal to 2
  • Then - Actions
  • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
  • Item - Remove (Last dropped item)
  • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
  • Item - Remove (Last dropped item)
  • Hero - Create Crown of Kings +5 and give it to (Hero manipulating item)
  • Else - Actions
  • Set ItemAmount = 0
And this it works 100%,I'm using it too.
  • Events
  • Unit - A unit Aquires an item
  • Conditions
  • ((Triggering unit) has an item of type Item1) equal to True
  • ((Triggering unit) has an item of type Item2) equal to True
  • ((Triggering unit) has an item of type Recipe) equal to True
  • Actions
  • Item - Remove (Item carried by (Triggering unit) of type Item1)
  • Item - Remove (Item carried by (Triggering unit) of type Item2)
  • Item - Remove (Item carried by (Triggering unit) of type Recipe)
  • Hero - Create Weapon and give it to (Triggering unit)

How the **** do you Set Item ammount + 1? And 2 also?.
Pwease help.
 
Level 2
Joined
Nov 21, 2008
Messages
6
need some help

Hi, Im having trouble with those triggers... i cant seem to replicate part of Nemisis's Auto combine trigger: For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +15) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
so i was wondering if u can send/post a map with the triggers in them Please?
 
Level 10
Joined
May 20, 2008
Messages
433
Another glitch in the trigger. I used the first trigger, minus the recipe, and I got 2 of one object, and when I got the other object I needed, all 3 of the objects disappeared.
AKA:
Objects needed for box: 1 wood, 1 wire spool
Objects in units inventory: 2 wood
Objects gained: 1 wire spool
Objects lost in all: 2 wood, 1 wire spool
Objects gained: 1 box
Any ways to fix this?
 
Level 2
Joined
Mar 10, 2009
Messages
9
Thank you

Einstein once said:
"Try to make things as simple as posible, but not simpler"
with this in mind:
instead of using the more complex trigger wich requires more computing and has more lines where u can go wrong( the one that uses fors from 1 to 6) just use the simpler trigger( check items...remove items...create new item) and change the recipe
old recipe:
fire(drops of dragon)+fire(drops of dragon)=greater fire
new recipe:
blue fire(drops off blue dragon)+red fire(drops off red dragon)=greater fire.
I believe adding an item is easier then using the more complex trigger.

Thx for the tread...it helpped me alot.
 
Last edited:
Level 4
Joined
Apr 7, 2009
Messages
108
i have a nice suggestion out there.....for people who arent exactly good at triggers, you mind saying to make the variables. you just randomly say 100 variables without saying what type they are. ` ` ` ` D:
 
Level 9
Joined
Dec 17, 2008
Messages
499
(Kinda old topic but.. uhh... yeah)
So, I wanted to make a unit enters region and then combine items.
And so I did. Here's the trigger. And this is if you want the items in specific slots.

PHP:
Events
   Units - A unit enters Region <gen>
 
Conditions
   ((Triggering unit) is A Hero) Equal to True
   ((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Item 1
   ((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 2
 
Actions
   Item - Remove (Item carried by (Triggering unit) in slot 1)
   Item - Remove (Item carried by (Triggering unit) in slot 2)
   Hero - Create Item 3 and give it to (Triggering unit)

Might be usefull for someone.
 
Level 4
Joined
May 20, 2009
Messages
96
(Kinda old topic but.. uhh... yeah)
So, I wanted to make a unit enters region and then combine items.
And so I did. Here's the trigger. And this is if you want the items in specific slots.

PHP:
Events
   Units - A unit enters Region <gen>
 
Conditions
   ((Triggering unit) is A Hero) Equal to True
   ((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Item 1
   ((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 2
 
Actions
   Item - Remove (Item carried by (Triggering unit) in slot 1)
   Item - Remove (Item carried by (Triggering unit) in slot 2)
   Hero - Create Item 3 and give it to (Triggering unit)

Might be usefull for someone.










WOW THANKS!!!! :D :grin:
 
Level 9
Joined
Dec 17, 2008
Messages
499
happy-weird-cat.jpg
 
Level 2
Joined
Aug 20, 2009
Messages
19
how can i make that i could only make items in some places like near blacksmith or something like that:confused:
 
Level 2
Joined
Dec 10, 2009
Messages
13
Umm. I followed the tutorial. Double checked it. I even downloaded his map to check if it was right. But when i did it in my map, it created like 18 of them instead of 1. What did i do wrong?
 
Your item that requires 2 of the same item.

after thinking breifley about the trigger i posted earlier i figured a much shorter way of doing it because of how the variable used is temporary and regularly re-written it wouldnt matter if it was an array. remember this is used for combining two items of the same type:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +15) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Create Crown of Kings +5 and give it to (Hero manipulating item)
        • Else - Actions
          • Set ItemAmount = 0
this used in combination with razorbrains trigger is the best and simplest recipie system imo.


I tried to use this item trigger though it leaks. The trigger only focuses when a unit acquires an item then you have it as long as your conditions meet; BUT, WHEN THE UNIT LOSSES THE ITEM, THE TRIGGER LEAKS. Especially when you have drop the first one, then take it again. I'll see this again, maybe I can manage to correct some errors.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
that was just an example. to make it into one single trig all you would need to do is

create an item array....
and insure all recipe items are in the same category. e.g., charged, unique...

now

event unit acquires item

condition
item acquire of category 'the category off all your recipes'

action
for... create a for loop of the size of your item array

if item is of recipe set
then
check if all items of recipe have been collected. dump items and add combined item
destroy trig Que
end of for loop.
 
Level 2
Joined
Jun 24, 2013
Messages
6
Im confused...

after thinking breifley about the trigger i posted earlier i figured a much shorter way of doing it because of how the variable used is temporary and regularly re-written it wouldnt matter if it was an array. remember this is used for combining two items of the same type:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +15) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
          • Item - Remove (Last dropped item)
          • Hero - Create Crown of Kings +5 and give it to (Hero manipulating item)
        • Else - Actions
          • Set ItemAmount = 0
this used in combination with razorbrains trigger is the best and simplest recipie system imo.



HOW to make set ItemAmount +1? Or for example ItemAmount Equal to 2 Condition?
 
Level 6
Joined
Aug 24, 2022
Messages
85
toolbox describes the theory of item recipies very well but the triggers he shows are bugged and not effective in all situations. i would suggest using these two triggers:




this one by razorbrain can be used to automatically create an item when a unit picks up two items of a different type. with this trigger you must also have a recipie item, but if you remove the lines "((Triggering unit) has an item of type Recipe) equal to True" and "Item - Remove (Item carried by (Triggering unit) of type Recipe)" it will do it when the unit automatically when the unit aquires the items.

and:



this can be used to turn two items of the same type into another item (for example Claws of Attack +15 + Claws of Attack +15 = Crown of Kings +5). this happens automatically but by adding the condition and action mentioned above you can make it require a recipie item. for this you need the integer variable ItemAmount.

[Edit by Wolve] ~ Tutorial edited and (re)approved.
I would like to thank you for this answer. I'm reading your post in 11/04/2022, and used it on my project, and it works very well (and found 0 bugs for now). I'm using a simple merge system, when we pick 2 same items, they merge into 1 more powerful version. I tried to pick up diferent levels of each item, and they didn't merge. They only merge when we pick exactly the same item. Thank you veyr much for your answer here years ago.
 
Top