• 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.

Item Bonding

V2.

V2.

Level 3
Joined
Mar 24, 2007
Messages
20
Item Bonding

tutorialsubmissionforum.gif
+
storywritingart.gif
=
updatesandnewsforum.gif


This Tutorial is to teach everyone out there making a hero based map that wants something like the troll tribe system of creating awesome items from a set of crap items...

First what you will need is a basic understanding of what you want to do, a basic understanding of triggers, and plenty of patience...

To begin lets just say you want to make Item 3 from item 1 and item 2...

You want when a unit picks up an item to check if you have item 1 and item 2 in slots one and 2 the event is simple, the condition looks long but its also very simple you have to use a condition at the bottom called And from 3-7 times without charges and from 5-11 times with charges, its allot of ands i know but once u have put the ands down u just need to enter the a boolean condition in preferably the last or first slot saying that triggering unit is a hero or if your using a skill an ability confirmation and/or a unit type comparison.

Now that u have got down to finished the starts of the and u need to fill in the spaces basicaly all u need to put in is a item type condition in each and checking that triggering unit has item 1 in slot 1 and item 2 in slot 2(2 conditions for uncharged items).

Finished that now the action u need to remove the items in item slot 1 and item slot 2 just with Item - Remove (item carried by (triggering unit) in slot 1) then a hero action to give the item to the triggering unit...

The trigger should look like this...
  • Event
  • Unit - A unit Acquires an item
  • Condition
  • ((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Item 1) and (((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 2) and (((Triggering unit) is A Hero) Equal to True)))
  • Action
  • 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)
Now thats pretty basic but it will work for anything that you want to make you can change the Event if you want so if they cast an ability or anything you want(must require a triggering unit though)

Charge Bonding

Now working with charges, lets say that Item 1 requires 2 charges and Item 3 requires 2...

  • Event
  • Unit - A unit Acquires an item
  • Condition
  • ((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Item 1) and (((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 2) and (((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Greater than or equal to 2) and (((Charges remaining in (Item carried by (Triggering unit) in slot 2))
  • Action
  • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 1) to ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) - 2)
  • If ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 1)) else do (Do nothing)
  • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 2) to ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) - 2)
  • If ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 2)) else do (Do nothing)
  • Hero - Create Item 3 and give it to (Triggering unit)
Quite daunting huh... Basicaly what all that just said was check if Item 1 is in Slot 1 and had 2 charges or more, Item 2 was in Slot 2 and had 2 charges or more and they remove the items if there charges reached 0...

Lazy Bonding

All of the triggers above require you to put items in the right order now what if you want the person to have them in any order they want, but just require the items(I suggest you only do this if you don't want to fuse many items and you use a spell to fuse them with...). The Trigger would go a little something like this.

  • Event
  • Unit - A unit Acquires an item(I do suggest you use a different event)
  • Condition
  • ((Item-type of (Item carried by (Triggering unit) of type Item 1)) Equal to Item 1) and (((Item-type of (Item carried by (Triggering unit) of type Item 2)) Equal to Item 2) and (((Charges remaining in (Item carried by (Triggering unit) of type Item 1)) Greater than or equal to 2) and (((Charges remaining in (Item carried by (Triggering unit) of type Item 1) Greater than or equal to 2)
  • Action
  • Item - Set charges remaining in (Item carried by (Triggering unit) of type Item 1) to ((Charges remaining in (Item carried by (Triggering unit) of type Item 1)) - 2)
  • If ((Charges remaining in (Item carried by (Triggering unit) of type Item 1)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) of type Item 1)) else do (Do nothing)
  • Item - Set charges remaining in (Item carried by (Triggering unit) of type Item 2) to ((Charges remaining in (Item carried by (Triggering unit) of type Item 2)) - 2)
  • If ((Charges remaining in (Item carried by (Triggering unit) of type Item 2)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) of type Item 2)) else do (Do nothing)
  • Hero - Create Item 3 and give it to (Triggering unit)
Multiple Bonding

You can also make one trigger do every single item combination, lets say you want to make a trigger that makes item 2 and 3 into item 1 and item 1 and 3 into item 2 you would need to make something like this...

  • Event
  • Unit - A unit Acquires an item
  • Condition(leave blank unless you only want a certain type of unit to bond)
  • Action
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (((((Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Item 2) and ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Greater than or equal to 1)) and ((((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 3)) and ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) Greater than or equal to 1))
    • Then - Actions
      • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 1) to ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) - 1)
      • If ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 1)) else do (Do nothing)
      • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 2) to ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) - 1)
      • If ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 2)) else do (Do nothing)
      • Hero - Create Item 1 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 (Item carried by (Triggering unit) in slot 1)) Equal to Item 1) and ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Greater than or equal to 1)) and ((((Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Item 3)) and ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) Greater than or equal to 1))
    • Then - Actions
      • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 1) to ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) - 1)
      • If ((Charges remaining in (Item carried by (Triggering unit) in slot 1)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 1)) else do (Do nothing)
      • Item - Set charges remaining in (Item carried by (Triggering unit) in slot 2) to ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) - 1)
      • If ((Charges remaining in (Item carried by (Triggering unit) in slot 2)) Equal to 0) then do (Item - Remove (Item carried by (Triggering unit) in slot 2)) else do (Do nothing)
      • Hero - Create Item 2 and give it to (Triggering unit)
    • Else - Actions
You can do this chain as long as you want it to and you can use every single different type of system i explained in the tutorial for you...

Stacking System

For the Charges Triggers you may need a item stacking system, that can easily be created with simple GUI, you will need to create a looping trigger for all slots 1-6, when a unit acquires an item. If you don't know how to use Integer A or Looping actions you should just use this trigger if you do how ever I suggest that you create a way of limiting the amount of charges to your liking(the max amount of charges for every single item is 5)(a nice way of making the item charges be easy to be manipulated is to change the 5 to be the level of the item(Implemented in the test map)).

  • Events
  • Unit - A unit Acquires an item
  • Conditions
  • (Charges remaining in (Item being manipulated)) Not equal to 0
  • Actions
  • For each (Integer A) from 1 to 6, do (Actions)
  • Loop - 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 (Integer A))) Equal to (Item-type of (Item being manipulated))
  • (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) Less than 5 in slot (Integer A)))
  • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
  • Then - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) Greater than 5
  • Then - Actions
  • Item - Set charges remaining in (Item being manipulated) to (((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) - 5
  • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to 5
  • Else - Actions
  • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
  • Item - Remove (Item being manipulated)
  • Else - Actions
  • Do nothing
Looks complicating huh, but it actually is easier than using variables...

A few things that I suggest...
- that you should label carefully each item being crafted and what it requires above the If/Then/Else Multipull Functions(if you are using them) it will save you allot of time...
- make a ability that makes the item not just when a unit picks up an item...
- make sure that you have ample help on how to make the items to help out noobs on your map...
- give as much rep as possible to V2.

This tutorial might not explain how to make them but i find that i learn better with visuals than words and i hope you do aswell, so open up the map and toy around with it and whatever.

- V2. Dropping on a house near you...
 

Attachments

  • Item Stacking.w3x
    17.8 KB · Views: 128
Last edited:
Level 9
Joined
Jul 27, 2006
Messages
652
Nice :smile:

Very nice :smile:
Only problem is that you have to create a new trigger for every single combination!
 
Level 8
Joined
Jan 18, 2007
Messages
331
nice toto v2=) but can you make a jass one? so i just can copy it, or do i have to know how to edit the jass? if then , just let it be=)

oh and how do i get that ... Less than 5 in slot (Integer A))) ?? waths the function? please mail me a private mess about this =)

Nwm, i just dl:ed your map and took that one=)
 
Last edited:
Level 7
Joined
Dec 26, 2006
Messages
303
Question

This really stupid but I understand the item bonding, but can you tell me how to make item charge increased?? Just like we bought potion in 1 charges, bought more to make it 2 charges, more and more...

I don't understand this... Please tell me
 
Level 13
Joined
Aug 31, 2005
Messages
823
Actually this is incorrect. The items will only bond (according to your triggers) if the item is in slot one or two. The alternative is:
Item - Unit aquires an item
Condition - Type of item equal to Item1
Action - If Unit (triggering unit) has item of type Item 2 then do (multiple actions)
-Item Remove item 1
-Item remove item 2
-Item Create one item 3 and give it to triggering unit

Not to mention this way is much more efficient and time saving. Please edit the tutorial and correct the errors.

Edit:
Just tested the map. Its horribly bugged.
If you pick up two ones and then a two it creates 3 different items with odd charges.
Additionally if you pick up item 1 and move it to slot 3-6 then pick up item 2 it glitches again doing the same thing.
Fix this please.
 
Top