• 🏆 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!

[Trigger] Item Combine need help!!!

Status
Not open for further replies.
Level 2
Joined
Jul 2, 2007
Messages
19
okay i need help on a trigger... it is about combining and item but i need to know how to combine 3 items that are the same and not only need one to combine them.

please, can you discribe it a little better??? because i don't understand what you have written there m8 :/
 
Level 5
Joined
Apr 12, 2007
Messages
158
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Tome of Experience
          • (Number of items carried by (Triggering unit)) Equal to 3
    • Actions
      • -------- Do whatever you want here. --------
Try this. It might not work, but it's worth a shot right? I created the trigger through my notebook. (Yes, I take notes on the World Editor)

Have the condition as And - All Conditions are True with the sub-conditions as Item-Type Comparison and Integer Comparison.

please, can you discribe it a little better??? because i don't understand what you have written there m8 :/

I think Cup2fun is trying to say is he wants three items of the same type to combine.
Example: 3 Exploding Sheeps in Inventory = 1 Big Exploding Sheep with a rigged two-second countdown.
 
Level 6
Joined
Nov 28, 2007
Messages
203
here it is ^^
  • Upgrade weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Claws of Attack +6 Equal to (Item-type of (Item being manipulated))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 1) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Hero manipulating item) in slot 1)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 2) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot 2)
              • Item - Remove (Item being manipulated)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 3) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot 3)
              • Item - Remove (Item being manipulated)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 4)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 4) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot 4)
              • Item - Remove (Item being manipulated)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 5)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 5) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot 5)
              • Item - Remove (Item being manipulated)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 6)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 6) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) in slot 6)
              • Item - Remove (Item being manipulated)
              • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
              • Skip remaining actions
            • Else - Actions
              • Do nothing
        • Else - Actions
          • Do nothing
kinda long trigger, but.. it works ^^
 
Level 3
Joined
Oct 23, 2007
Messages
36
Just a note cup2fun: the code is long, but it is really just the same command over and over. The most tedious part of the item recipe system is making the recipes, not theorycrafting the code.
 
Level 3
Joined
Aug 30, 2007
Messages
38
Hi all !!! I can't understand this Trigger :/ Where is "Claws of Attack +6" i give my item and where is "Hero - Create Claws of Attack +9" i set my own item and now i want to know why it dont work. When my hero buy "Claws of Attack +6" it should change to "Claws of Attack +9" ?? If not can you say what i need to change that.
I want to combine 2-3 items to make 1 new.
Sorry for my eng....
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
First Question: If you mean how to find the comparsion "Claws of Attack +6 Equal to (Item-type of (Item being manipulated))", then it's "Item-Type Comparsion" condition.
Second Question: "Hero - Create Claws of Attack +9" is the "Hero - Create Item For Hero" action.

That trigger is for 2 items. Please tell me if you need a trigger for 3 items or more :)

Btw, Welcome to the Hive :D
 
Level 3
Joined
Aug 30, 2007
Messages
38
Thx =D
I make small version of DoTA its a 2 v 2 game. When you play you want to buy some items... soo i create over 3-5 swords now and i want that : When hero have sword1 and sword2 in inventory => remove 1,2swords => create sword3
I need to combine 2 or 3 items to create new 1. I try use this trigger but i dont know how it work.....
 
Level 6
Joined
Nov 28, 2007
Messages
203
I can make the trigger so you can put in whatever item you want there. So you don't have to make 1 trigger/item. If u want :)
 
Level 6
Joined
Nov 28, 2007
Messages
203
This is for 1 slot. Just copy-paste the if/then/else actions and change the slots. And i hope u understand how to add more items ^^
  • Some Trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Claws of Attack +6 Equal to (Item-type of (Item being manipulated))
              • Claws of Attack +9 Equal to (Item-type of (Item being manipulated))
              • Claws of Attack +12 Equal to (Item-type of (Item being manipulated))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot 1) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Hero manipulating item) in slot 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Claws of Attack +6
                • Then - Actions
                  • Hero - Create Claws of Attack +9 and give it to (Hero manipulating item)
                  • Skip remaining actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Claws of Attack +9
                • Then - Actions
                  • Hero - Create Claws of Attack +12 and give it to (Hero manipulating item)
                  • Skip remaining actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Claws of Attack +12
                • Then - Actions
                  • Hero - Create Claws of Attack +15 and give it to (Hero manipulating item)
                  • Skip remaining actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Here is a shorter trigger for this.
2 big bonuses of this are:

• Smaller code
• You can put those items in any inventory slot you wanted

If you wanted it to be only in slots 1 & 2, you can just make the same condition as humpadumpa made.

  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item_Type[0] = Claws of Attack +6
      • Set Item_Type[1] = Claws of Attack +9
      • Set Item_Type[2] = Claws of Attack +12
  • Naga Pwnz
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Not equal to Item_Type[3]
              • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) of type Item_Type[(Integer A)]))
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Triggering unit) of type Item_Type[(Integer A)])
              • Hero - Create Item_Type[((Integer A) + 1)] and give it to (Triggering unit)
            • Else - Actions

[Offtopic] humpadumpa, I remember you saying you don't know how to use Integer[A/B] loops.
You should learn, they are really usefull at shortening codes :)
It isn't hard really, and if you want a explaination I would be glad to make a thread for it so people can learn how to use them.
 
Level 3
Joined
Aug 30, 2007
Messages
38
TS to AS
Events
Unit - A unit Acquires an item
Conditions
Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Last created item)) Not equal to Item_type2
(Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) of type Item_type0))
Then - Actions
Item - Remove (Item being manipulated)
Item - Remove (Item carried by (Triggering unit) of type Item_type0)
Hero - Create Item_type2 and give it to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Last created item)) Not equal to Item_type2
(Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) of type Item_type1))
Then - Actions
Item - Remove (Item being manipulated)
Item - Remove (Item carried by (Triggering unit) of type Item_type0)
Hero - Create Item_type2 and give it to (Triggering unit)
Else - Actions


I use this trigger ( dont know how make desame as yours :( ) And its work but only with 1 item ... and i need 2 or 3...
It will be great help if uou sey how to copy trigger from here... -.-'
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
First of all you should put your triggers into
  • [tags], by doing this:
  • [trig.ger] put here your trigger [/trig.ger] - Without the dots of course.
  • If you don't know how to get your trigger into a text, go into a trigger, now look a line up from the Events and you'll see a white page with the name of the trigger to the right of it.
  • Right Click on it and do "Copy As Text".
  • Now Ctrl+V (paste) in the middle of the trigger tags.
  • For your question, you can't copy codes from here.
  • Just try to find this things and if you really can't, ask me and ill tell you where hey are.
 
Level 8
Joined
Dec 8, 2007
Messages
312
I just made a triger that combines as much same type items as you want and it's a short triger :) I tryed it. Works good. Here it is:
Combine
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Claws+6
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+6) then do (Set int = (int + 1)) else do (Do nothing))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
int Equal to 4
Then - 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+6) then do (Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))) else do (Do nothing))
Hero - Create Claws+12 and give it to (Hero manipulating item)
Set int = 0
Else - Actions
Set int = 0
 
Level 6
Joined
Nov 28, 2007
Messages
203
Please, Siwewca and Jansi, please use trigger tags :p as Ghostwolf said, copy the triggers as text. Then paste and do [(Trigger)] before the text and [(/Trigger)] after the text. (Without the () )

[Offtopic]
[Offtopic] humpadumpa, I remember you saying you don't know how to use Integer[A/B] loops.
You should learn, they are really usefull at shortening codes :)
It isn't hard really, and if you want a explaination I would be glad to make a thread for it so people can learn how to use them.

Well.. i know how to use them and i understand them, (u have explained b4 ^^)
but i don't know "special" stuff about them. (if there are any >.<)
 
Level 8
Joined
Dec 8, 2007
Messages
312
Please, Siwewca and Jansi, please use trigger tags :p as Ghostwolf said, copy the triggers as text. Then paste and do [(Trigger)] before the text and [(/Trigger)] after the text. (Without the () )

ok. I will try.
  • Combine
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws+6
    • 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+6) then do (Set int = (int + 1)) else do (Do nothing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • int Equal to 4
        • Then - 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+6) then do (Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))) else do (Do nothing))
          • Hero - Create Claws+12 and give it to (Hero manipulating item)
          • Set int = 0
        • Else - Actions
          • Set int = 0
 
Level 8
Joined
Dec 8, 2007
Messages
312
I think my trigger is good too. And it must check every inventory slot becaus main idea was how to combine same type items in to 1 item. My trigger counts how much needed items hero have and if number is right it remuves them and creates new item.
+ this trigger will work with any count of items

I'm shure I can make this trigger combine many items but I don't need this.
 
Level 3
Joined
Aug 30, 2007
Messages
38
  • TS LS to AS
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item carried by (Triggering unit) of type Fire Sword)) Equal to (Item-type of (Item being manipulated))
    • Actions
      • Item - Remove (Item being manipulated)
      • Hero - Create Hell Fire Sword and give it to (Triggering unit)
This is some kind of trigger but its change 1 item to 1 new. I need to change 2-3 different items to 1 new. If you can help me to change that trigger ( add some now conditions. I try change it over 2 hours with no effect. When I add some new condition this trigger don't work. )
 
Level 6
Joined
Nov 28, 2007
Messages
203
2 or 3 items?
Use "Or - Any (conditions) are true" instead of "And - All (Conditions) are true"

[Edit]:
There's something wrong with this ^^ it should be made for 3 items, but it doesn't work. any1 wanna check what i've done wrong? (btw, sorry for the long trigger code -.-)
  • Add item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to ItemType[1]
          • (Item-type of (Item being manipulated)) Equal to ItemType[2]
          • (Item-type of (Item being manipulated)) Equal to ItemType[3]
          • (Item-type of (Item being manipulated)) Equal to ItemType[4]
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 2) Not equal to (Item being manipulated)
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 3) Not equal to (Item being manipulated)
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 4)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 4) Not equal to (Item being manipulated)
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 5)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 5) Not equal to (Item being manipulated)
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 6)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 6) Not equal to (Item being manipulated)
                      • And - All (Conditions) are true
                        • Conditions
                          • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to ItemType[(Integer A)]
                          • (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to ItemType[(Integer A)]
                          • (Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
                          • (Item carried by (Hero manipulating item) in slot 1) Not equal to (Item being manipulated)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item being manipulated)) Equal to ItemType[(Integer A)]
                    • Then - Actions
                      • Item - Remove (Item being manipulated)
                      • Hero - Create ItemType[((Integer A) + 1)] and give it to (Triggering unit)
                    • Else - Actions
                • Else - Actions
 
Last edited:
Level 3
Joined
Aug 30, 2007
Messages
38
I have working trigger but items need to be in special place in inventory. If you can look at this trigger and say how change it to combine items from all inveentory not only from special places.
  • TS LS to AS
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Fire Sword
          • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Laser Sword
          • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to Thunder Sword
    • Actions
      • Item - Remove (Item carried by (Triggering unit) in slot 1)
      • Item - Remove (Item carried by (Triggering unit) in slot 2)
      • Item - Remove (Item carried by (Triggering unit) in slot 3)
      • Hero - Create Hell Fire Sword and give it to (Triggering unit)
 
Level 8
Joined
Dec 8, 2007
Messages
312
Now I finished my trigger.this trigger can combine 2-6 items in 1 item. Just as GhostWolf sugested I made it with Item as variable that this trigger can be used on more than 1 item. Here it is.
  • Combine
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer B) from 0 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to Item[(Integer B)]
            • Then - 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 (Item-type of (Item being manipulated))) then do (Set int = (int + 1)) else do (Do nothing))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int Equal to 3
                • Then - 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 (Item-type of (Item being manipulated))) then do (Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))) else do (Do nothing))
                  • Hero - Create Item[((Integer B) + 1)] and give it to (Hero manipulating item)
                  • Set int = 0
                • Else - Actions
                  • Set int = 0
            • Else - Actions
 
Level 4
Joined
Dec 15, 2007
Messages
108
sry guys bit i didnt understand the post from jansi i try to write it down at WE but i gave up after 1h could u do an esample mabye a map or with example items? THX
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Basicly what it does is setting the item being manipulated to Integer, and then checking if the hero has another copies of that item in the hero's inventory.

If the hero has 3 items in total of the same kind, it will remove all items of that kind from the hero and give him the next "item class".

I will make you a trigger if you want but im going to sleep in a second, and will be back tommarow at about 8 pm (gmt +2) so if no one does untill then ill do it.


And, if you can create that trigger doesn't matter if you don't understand what it does, set in another trigger the Item[x] items.
For example, set Item[0] to claws of attack +3, Item[1] to claws of attack +6 etc. and you will see how it works :)
 
Status
Not open for further replies.
Top