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

[Trigger] Trigger not working

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
I have tried to make 3 items form into one when you aquire them all, but when you buy the third and last item its the only item that dissapear from the inventory, you get the blood-drenched crown of protection, but i still got 2 of the components for it left in my inventory, why doesnt all items get removed?

  • BloodDrenchedCrownOfProtection
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Bal´gun Crown) Equal to True
      • ((Triggering unit) has an item of type Band of Protection) Equal to True
      • ((Triggering unit) has an item of type Blood-drenched Claws) Equal to True
    • Actions
      • Hero - Drop (Item carried by (Triggering unit) of type Bal´gun Crown) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • Hero - Drop (Item carried by (Triggering unit) of type Band of Protection) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • Hero - Drop (Item carried by (Triggering unit) of type Blood-drenched Claws) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • Hero - Create Blood-Drenched Crown of Protection and give it to (Triggering unit)
 
Level 18
Joined
Mar 7, 2005
Messages
824
Maybe you try using "Hero manipulating item" instead of triggering unit, somethings wc3 editor has some bugs. Used a trigger that should work, and just changed some order or some name of it, that doesn't affect the trigger itself and what it should do, but then it worked.. maybe you got a similar problem.. Or add "any - multiple" condition, or something like that..
 
Level 7
Joined
Mar 29, 2009
Messages
139
try this:
  • Item
    • 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 Ring of Protection +2) Equal to True
          • ((Hero manipulating item) has an item of type Ring of Protection +3) Equal to True
          • ((Hero manipulating item) has an item of type Ring of Protection +4) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +2)
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +3)
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +4)
          • Hero - Create Ring of Regeneration and give it to (Hero manipulating item)
        • Else - Actions
or if you want, you can use a special effect too. with this trigger:
  • Item
    • 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 Ring of Protection +2) Equal to True
          • ((Hero manipulating item) has an item of type Ring of Protection +3) Equal to True
          • ((Hero manipulating item) has an item of type Ring of Protection +4) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +2)
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +3)
          • Item - Remove (Item carried by (Hero manipulating item) of type Ring of Protection +4)
          • Hero - Create Ring of Regeneration and give it to (Hero manipulating item)
          • Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
          • Wait 2.00 seconds
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
That should work.

EDIT: LOL SRY!! I was in a hurry and did something wrong. Try it now.
 
Level 1
Joined
Mar 25, 2008
Messages
5
Your events and conditions seem right but for the actions have
Item- remove (item1) by hero manipulating item of type (item1)
Item - remove (item2) by hero manipulating item of type (item2)
Item- remove (item3) by hero manipulating item of type (item3)
Item- Create (item your want made) at position of hero manipulating item
Hero- give last created item to hero manipulating item.

i did this in my game and it worked just fine.
 
Level 3
Joined
May 7, 2009
Messages
21
"Variables you need.."

-Yoda

It will glitch without variables.. try putting like a .01 wait between when you remove the last dropped item and the next item is dropped because atm they're removing the last dropped item which will be the 3rd one down..

I'm with Chief. WE is probably bugging out with the "last dropped item" definition since essentially all three items are being dropped at the same time. Also agreed, however, that you should avoid 'waits' when possible. I'm currently on my phone and can't remember, is there a trigger option to remove the items without having to drop them first? Seems that should clear it up if so.
 
Level 12
Joined
Aug 22, 2008
Messages
911
"Variables you need.."
-Yoda
Strong with you is the Force, my padawan.

I think the problem is with the dropping... Dropping more than 1 item at once is probably really confusing and is considered an order, I think, so it only does the last order.
I trust using this would be more productive:
  • Item - Remove Item carried by (Triggering Unit) of type Bal´gun Crown
 
Level 8
Joined
Apr 7, 2008
Messages
176
Yea you dont DROP items, simply remove them. Also there is no such thing "At the same time" for computers, they cycle through the trigger in order. Even when you have 10 triggers running, They DO NOT run all 10 at the same time, they run them in order, Just really freakin fast. So no worries with your comp gettin confused there.
 
Level 11
Joined
Feb 22, 2006
Messages
752
Don't use hero manipulating item; use get triggering unit. It does the exact same thing only it's faster and works after waits (though you shouldn't use waits).

Even when you have 10 triggers running, They DO NOT run all 10 at the same time, they run them in order, Just really freakin fast. So no worries with your comp gettin confused there

This assumes that all jass functions carry out what theyre supposed to do immediately (i.e. no blocking, hanging, or threading), which isn't the case. There's lots of situations where JASS simply doesn't do what it seems like it should do (like if you try to remove an item on a unit drops item event, it just WON'T happen, but if you use a timer and wait 0.02 seconds and try to remove it then, it works!).
 
Status
Not open for further replies.
Top