| 08-29-2003, 01:53 AM | #1 |
Ok im making a trigger that when an ability is cast by a building it will take the 2 items if they are the right 2 item and combine them into 1 item. For some reason its not working though, could someone help me? I have it layed out like this. Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Forge ((Casting unit) has an item of type Item A) Equal to True ((Casting unit) has an item of type Item B) Equal to True Actions Item - Remove (Item carried by (Casting unit) of type Item A) Item - Remove (Item carried by (Casting unit) of type Item B) Hero - Create Item C and give it to (Casting unit) |
| 08-29-2003, 01:59 AM | #2 |
try using triggering unit instead of casting unit. |
| 08-29-2003, 02:02 AM | #3 |
Can explain what does happen? If nothing appears to happen, try adding messages to see if the trigger is even executing. |
| 08-29-2003, 02:58 AM | #4 |
Ok this may seem wird but it's a part of a trigger i use to do that. The variable "craft unit" is the unit that will have the item combined. You can set it by adding a set variable action infront of this, this is only a action. Ignore the items, change them to what you want. I also have a special effect at the end that you can take out if you want to. This also works with any order in the first 2 slots, just set it up with the items you want. 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 CraftUnit in slot 1)) Equal to Ring of Strength Lvl.5 (Item-type of (Item carried by CraftUnit in slot 2)) Equal to Healing Potion Lvl.4 And - All (Conditions) are true Conditions (Item-type of (Item carried by CraftUnit in slot 1)) Equal to Healing Potion Lvl.4 (Item-type of (Item carried by CraftUnit in slot 2)) Equal to Ring of Strength Lvl.5 Then - Actions Player - Add -250 to (Owner of CraftUnit) Current gold Item - Remove (Item carried by CraftUnit in slot 1) Item - Remove (Item carried by CraftUnit in slot 2) Hero - Create Amulet of life Lvl.7 and give it to CraftUnit Special Effect - Create a special effect at (Position of CraftUnit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl Set CraftUnit = No unit Else - Actions |
| 08-29-2003, 03:25 AM | #5 |
Ok so I took that trigger that i listed in my first post and started playing around with it and found out that the: ((Triggering unit) has an item of type Item A) Equal to True ((Triggering unit) has an item of type Item B) Equal to True Was causing the problem, when it was deleting the trigger went to the action part and completed the trigger. So I then remembered of another map that had a trigger like i want to do so I copied and pasted it and it looked like this: Events Unit - A unit Is issued an order with no target Conditions (Issued order) Equal to (Order(thunderclap)) (Blacksmith 0002 <gen> has an item of type ItemA) Equal to True (Blacksmith 0002 <gen> has an item of type Item B) Equal to True Actions Item - Remove (Item carried by Blacksmith 0002 <gen> of type Item A) Item - Remove (Item carried by Blacksmith 0002 <gen> of type Item B) Hero - Create Item C and give it to Blacksmith 0002 <gen> So I was thinking, I know the spell already sets it off so I changed the first part back to: Unit - A unit Begins casting an ability (Ability being cast) Equal to Forge And it worked perfectly.... so then I started working backwards and changing little by little and ended up with this: Events Unit - A unit begins to cast an ability. Conditions (Ability being cast) Equal to Forge ((Triggering unit) has an item of type Item A) Equal to True ((Triggering unit) has an item of type Item B) Equal to True Actions Item - Remove (Item carried by (Triggering unit) of type Item A) Item - Remove (Item carried by (Triggering unit) of type Item B) Hero - Create Item C and give it to (Triggering unit) And once again it still worked......but wait a minute... this trigger is exactly the same as the one I posted in my first post asking for help..... why did it not work then but mysteriously works now? Would someone like to lend me a gun so I can shoot myself now? P.S. Its not exactly the same because its (triggering unit) instead of (casting unit) but during the period of time when I was searching for a solution I did change it all to (Triggering Unit) and it still didn't work. |
