• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit lose item bug?

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2012
Messages
33
hi guys i just find a problem with this, so when hero drop item1, it should create 1 item1_dummy in hero position, but when i run(drop) it, it instead create 2 item1_dummy, whyy?

  • test
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to item1
    • Actions
      • Item - Remove (Item being manipulated)
      • Unit - Create 1 item1_dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
 
Because the coding is intercepting.
When you remove an item (Item - Remove <item>), the holder of the item loses that item.
When a unit loses an item, it still has it.
So you order the unit to drop the item -> dummy is created.
You remove the item -> another dummy is created.

Try disabling the trigger before "Item - Remove (Item being manipulated)" and enable the trigger again after that.
 
thx dude, so i just save item in hashtable?

  • dismiss item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to item1
    • Actions
      • Set Dismiss_handle = (Triggering unit)
      • Unit - Create 1 item1_dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Hashtable - Save Handle Of(Item being manipulated) as (Key loseitem1) of (Key (Triggering unit)) in Hash
      • Trigger - Turn on dcheck <gen>
  • dcheck
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Item - Remove (Load (Key loseitem1) of (Key Dismiss_handle) in Hash)
      • Trigger - Turn off (This trigger)
 
What he meant is turn off at start and re-enable trigger at the end :
  • dismiss item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to item1
    • Actions
      • Trigger - Turn off (This trigger)
      • Item - Remove (Item being manipulated)
      • Unit - Create 1 item1_dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Trigger - Turn on (This trigger)
Also, you have a location leak.
 
Status
Not open for further replies.
Back
Top