• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
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.
 
Level 3
Joined
Jul 27, 2012
Messages
33
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)
 
Level 11
Joined
Dec 19, 2012
Messages
411
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.
Top