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

[Solved] Dropped Item Disappears. Please help

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2010
Messages
312
I added a trigger that if a hero has an item with 0 charges on it the item is removed. This caused a problem that when a player drops "Venison" it would disappear and and I think is removed/destroyed. They are not the only items that I have made that have abilities though they are connected with another trigger, but it doesn't seem relevant.

Here is the code I used to drop all items that have 0 charges...

  • Remove 0 Charge Items
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 1)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 1)) else do (Do nothing)
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 2)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 2)) else do (Do nothing)
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 3)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 3)) else do (Do nothing)
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 4)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 4)) else do (Do nothing)
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 5)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 5)) else do (Do nothing)
          • If ((Charges remaining in (Item carried by Players_Hero[(Player number of (Picked player))] in slot 6)) Equal to 0) then do (Item - Remove (Item carried by Players_Hero[(Player number of (Picked player))] in slot 6)) else do (Do nothing)
All of my other items are fine and do not disappear when they are dropped but all types 3 of my venisons do. If anyone has any idea of what is going on here please help me out, because I have no clue.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
First thing you have to do is change the event.
Since it is an item with charges, that indicates it can be used. How about using the event when an item is being used?
You're running this trigger 100 times per second now, very demanding.

Are you sure that THIS trigger removes the items when dropped?
You can always use "Game - show message" to debug the triggers (debugging triggers is an art, one that all coders rely on).

Just... instead of creating 6 ITE's (If-Then-Elses), loop an integer from 1 to 6 and create a multiple-action-ITE.
The condition remains the same, the then-action remains the same (no else-actions though) AND you are able to show a message!
Something like "Integer(looped integer) - removed item". Then you instantly know what the trigger was thinking when removing that item. IF it removed it at all.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I added a trigger that if a hero has an item with 0 charges on it the item is removed.
I really wanna know what is your motive of doing this ?
Take Healing Wards (item) as an example, it has a default 3 charges for that item
When each time you use it, it reduce by 1 (logical explanation)
Also, when it reaches to last amount, you used it when it is at 1 charge left, the item is automatically disappears

Now I wonder why do you wanna make a triggered-removing 0 charged item when Blizzard has made your life, easier ?
 
Level 9
Joined
Apr 23, 2010
Messages
312
This is gonna seem really stupid, but the reason the venisons were disappearing was because I had accidentally deleted the model when I was cleaning out the import menu. Thank you ap0calypse for the revised trigger! +rep for you.

@defskull, I'm triggering it because its a whole lot simpler then deleting all of my items and remaking them to be like the Healing Ward. I also had not really thought the whole item process all the way through apparently.
 
Status
Not open for further replies.
Top