HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

the best way to detect if a dead unit is in a corpseDecayTime or in a boneDecayTime

07-29-2008, 07:44 PM#1
Troll-Brain
I need to know if a dead unit is still a corpse or already a skeleton.
I know one solution, using a dummy unit with a dummy undead ability (a skeleton target).
And use the native
Collapse JASS:
IssueTargetOrderById         takes unit whichUnit, integer order, widget targetWidget returns boolean
If it's true then the unit is a skeleton.

A better way ?

Can we do some actions with a corpse that we can't with a skeleton (unit paused or not), or the opposite ofc.
07-29-2008, 08:33 PM#2
DioD
all units turn to skeletons after some fixed (game play constants) time.

detect this time via your current method and then use timers

unit death = flag flesh

after some time = flag bone

after some time = clean up.
07-30-2008, 07:40 AM#3
Troll-Brain
I already thought about that, but if i suspend the decay then this method fails.
I search something more accurate and safer.

For example if we could add an ability to a corpse decay unit and not for a skeleton.
But we can add one for the twice.
I search something like that.

Because if i use a dummy unit maybe i will must manage and recycle some.
I don't mean that's over complicated, but if i don't need it why i would do that ?
Btw i didn't test, and maybe only one unit is enough, but anyway it's still over skill.
07-30-2008, 08:29 AM#4
Toadcop
and if someone eat the corpse =O ? or you don't have such ability in your map ? (or summon a skeleton)
07-30-2008, 08:31 AM#5
Troll-Brain
Quote:
Originally Posted by Toadcop
and if someone eat the corpse =O ? or you don't have such ability in your map ? (or summon a skeleton)
Don't worry about this, that's not he point of my question.
And you forget the revive spell
07-30-2008, 08:26 PM#6
midiway
maybe:
unit is alive -> EVENT_UNIT_DEATH -> corpseDecayTime -> EVENT_UNIT_DECAY -> boneDecayTime
07-31-2008, 01:52 PM#7
Troll-Brain
Quote:
Originally Posted by midiway
maybe:
unit is alive -> EVENT_UNIT_DEATH -> corpseDecayTime -> EVENT_UNIT_DECAY -> boneDecayTime
Yes it will works, but the decay event is only a single unit event not a player_unit event.
So it will leak if i must add this event when an unit enter the map.

Btw it seems the corpseDecayTime depends the model (time of the animation death).
I tried to change the animation speed without any effect.
And when you change the constants this time don't change.

But it affects the time for a completely decay = time of animation death + time of corpseDecayTime + time of boneDecayTime.