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

[Solved] Items reappear at the position of dying unit

Status
Not open for further replies.
Level 4
Joined
Dec 25, 2012
Messages
66
This glitch can be proudly called WTF.

The idea: an ability, that when cast creates a small critter that can carry 1 item (doesn't drop items on death flag set in obj. editor). Then trigger checks for a random item in region and gives it to the critter. Simple.

Event: Unit casts an ability
Condition: Ability being cast equals Silence //Any ability that targets aoe would work
Action:
Unit - Create 1 SmallCritter for Owner of Casting unit at the position of Target point of ability being cast facing <whatever angle>.
Set itemSomeItem = Random item in region centered at target point of abilitybeingcast with 400 width 400 height.
Give itemSomeItem to last created unit

It works fine, yes. They all work "fine" at first :D The fun part begins when one or some of the critters carrying items get killed.

A minute after their corpses fully decay (2-3 min total), the items they were carrying magically manifest at their death locations! I thought that's a leak, checked the death spots (prior to reappearances) with "Count items in range" trigger (showed zero items). So that must be something else...

Thousand kudos to whoever can enlighten me on what the hell is going on...

Update: I turned off all other triggers besides "Create small critter". Same result - items reappear.
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Dying is not the same as removal. What is happening is that the item is being dropped on decay removal of the critter. The item is still in the critter's inventory while it is dead and decaying.

As people suggested above, use triggers to remove the item on death of the critter. That way its decaying corpse has no item on it to eventually drop on removal.
 
Level 4
Joined
Dec 25, 2012
Messages
66
Dying is not the same as removal. What is happening is that the item is being dropped on decay removal of the critter. The item is still in the critter's inventory while it is dead and decaying.

As people suggested above, use triggers to remove the item on death of the critter. That way its decaying corpse has no item on it to eventually drop on removal.

Wow, I was suspecting something like this, but would've never imagined WC3 engine handles items in this unorthodox way. The "Doesn't drop items on Death" flag in "Carry bag" ability seemed solid enough.
Nevertheless, remove items by trigger worked, as drops do not reappear. Thanks everyone for the tip!
 
Level 4
Joined
Sep 13, 2014
Messages
106
Can drop items on Death is in the category Editor - it only affects the WC3 world editor. It's for ease of use only. Although I don't really see what is so helpful about it, compared to the other things in the Editor category.
 
Status
Not open for further replies.
Top