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

Revivng dead items - how to reset the animation?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
if i take a dead item (life < 0.45) and increase it's health and make it visible again the item is clickable, but the model is hidden as it's animation is dead. Is there anyway to resolve this so that the item can be recycled?

The only idea I have is to attach an effect to the item and animate it post-recycle, but that would make it very clunky to implement as you'd need to handle every special case that can happen and have to worry about causing leaks due to not being able to detect an item that never died because it was being carried or such things.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
Why are your items dying, why do you want to recycle items, and why can't you just clone the dead item? I presume you could just detect their imminent death with triggers for units being ordered to attack items or use item-affecting abilities on them, then hide the old item before it dies and create a dummy item to kill in its stead so the visuals match up.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
Well what I really wanted was to have a list of items of a certain type and then update some data bound to that item periodically, if the item is killed then the data needs to be freed.

There is the TriggerWidgetDeath event but only for a specific item and creating a trigger for each created item of this type would be iffy as the numbers of items can grow.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
I didn't mean with that event (no idea it even existed). I meant detect attack and spell orders targeting items, as there's no way for an item to be killed without a player explicitly telling a unit to do so (excluding triggered item death).

I suppose that could work actually, though I'm not sure there is any Item takes damage event? And what about the item lost at sea "bug"?

Transportship dies, loop through the carried units, check if they are having items..?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
I'm not saying to use any damage event that doesn't exist. Unit issued an order event.

'Item lost at sea' is in the same realm as 'the mapmaker used RemoveItem'. Either you choose to account for those special cases via some arcane method or just make sure they can't happen in your map.
 
Well what I really wanted was to have a list of items of a certain type and then update some data bound to that item periodically, if the item is killed then the data needs to be freed.

There is the TriggerWidgetDeath event but only for a specific item and creating a trigger for each created item of this type would be iffy as the numbers of items can grow.

Actually, creating such a system with TriggerWidgetDeath is well within bounds of possibility it would use tge same method every DDS applies. You only need to make sure to catch every item that gets created and to clean up yoir trigger in certain intervalls when too many itens were thrown off the list.
 
Status
Not open for further replies.
Top