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

How do I make a model "appear" as dead?

Status
Not open for further replies.
Level 2
Joined
Jul 24, 2008
Messages
20
Yeah, I've been thinking about this one for some time, but how do I do a unit or doodad appear, as it was a corpse? I mean a corpse, that still looks like the model and not like bones and flesh, if you know what I mean.
I believe it's done by a trigger, but I'm not completely sure...
Any help would be appreciated!

Thanks in forward!
 
Level 6
Joined
Sep 5, 2007
Messages
264
Should be like this in JASS:
JASS:
call SetUnitAnimation(<target unit>, "death")
call QueueUnitAnimation(<target unit>, "death,flesh")

The reason that the "decay" animation is in there, is so that the unit won't just "pop-back-up" again...

But, if you want this to last more than about a minute (you very well may, depending on the model), what you'd have to do to make the unit animation freeze once they are on the ground (you'd need a timer or something, don't use waits), and start it back up when they want to get up:
JASS:
// When on the ground
call SetUnitTimeScale(<target unit>, 0)

// When they want to get up
call SetUnitTimeScale(<target unit>, 1)

Not sure of this:
If you want the enemy NOT to be able to just hold ALT and see your guy's health bar, you have to add the "locust" ability...
JASS:
call ShowUnit(<target unit>, false)
call UnitAddAbility(<target unit>, 'Aloc')
call ShowUnit(<target unit>, true)

:fp: One other solution here, is to make your hero "wind walk" and create a dummy unit of your hero (kill the dummy instead)

That should be it.
 
Last edited:
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • Actions
    • Animation - Player UNIT's death animation
    • Animation - Set animation speed of UNIT to 10000%
    • Wait 1 second
    • Animation - Set animation speed of UNIT to 0%
Make UNIT the unit that you want to effect. 'death' has to be manually typed in the Play animation command.

Keep in mind that this only causes the unit to appear dead. Once somebody orders it to play another animation (like moving or casting an ability), the unit will just execute the order and the death animation is gone. If you want the unit to keep appearing dead, you need to pause it with 'Unit - Pause UNIT'. It will then remember it's orders and when it's being unpaused, it will continiue the orders it's been given.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Please read previous placed posts. It's only 1 post to read and it says exactly what you just said, but then with extra info.

It won't make you more popular to say what someone else already said. Leave alone to expect getting +rep for it...
 
Level 6
Joined
Sep 5, 2007
Messages
264
Avator said:
It won't make you more popular to say what someone else already said. Leave alone to expect getting +rep for it...
LOL :grin:
Go Avator, go!

Anyways, like I said yesterday, just playing the death animation still leaves you open to the enemy being able to hold ALT and see that you're not really dead...

The easiest way, that I can see, is to just use a dummy, kill the dummy instead, but make yourself invisible (wind-walk for example).
EG:
Create dummy ability called "Fiegn Death" (based on wind-walk)
When a unit successfully casts the ability, create a dummy unit (that just looks like the caster) at the caster's position, with the caster's facing angle. Wind-walk stops unit collisions automatically, so that's not a problem.
Then make that dummy unit dead.

Voila, one "pretend to die" ability! :thumbs_up:
 
Level 6
Joined
Sep 5, 2007
Messages
264
We have a bit of a debate going... LOL

Using a destructable:
Wouldn't you see it as strange that an enemy hero just suddenly appears dead, with no dying animation? :confused:

Adding & Removing Locust:
As soon as you remove the locust ability, your health bar would be seen again. Just remember, you're not REALLY dead.

I still think that the wind-walk solution would be the quickest & easiest to implement, but that's just me.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Adding & Removing Locust:
As soon as you remove the locust ability, your health bar would be seen again. Just remember, you're not REALLY dead.

That's the point. You appear dead. if you wouldn't want to get up afterwards, you could just really make him dead. Add the Locust ability when he/she appears dead, and remove it when he/she stops pretending to be dead.
 
Level 6
Joined
Sep 5, 2007
Messages
264
You said:
Avator said:
Can't you just add and remove the Locust ability after the death animation is complete? It can't be targeted, selected or seen as a unit by the enemy then.

The animation finishes about 1-5 seconds after the unit "dies" (depending on the unit). I obviously misunderstood what you were meaning...

My bad... :hohum:

One thing I've thought of:
How are you meant to click the ability to turn off "feign death", when the unit is "locusted"? You can't select it... :confused:

I'm still standing by my "wind-walk" approach... :thumbs_up:
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I was aiming for a trigger-only death appearance. If you'd want it as an ability, you indeed need another solution. And for the 1-5 seconds thing: read my first post. It speeds up the death animation by 10000%, giving you an instant dead unit.
 
Level 6
Joined
Sep 5, 2007
Messages
264
JASS:
local integer abil_id = GetSpellAbilityId()
local unit caster = GetSpellAbilityUnit()

local real caster_x = GetUnitX(caster)
local real caster_y = GetUnitY(caster)
local real caster_facing
local player player_caster

if (abil_id == <dummy ability>) then
    call SetUnitPathing(caster, false)
    set caster_facing = GetUnitFacing(caster)
    set player_caster = GetOwningPlayer(caster)

    set fake = CreateUnit(player_caster, <fake unit>, caster_x, caster_y, caster_facing)
    call KillUnit(fake)
    set fake = null

    call SetUnitPathing(caster, true)
    set player_caster = null
endif

<dummy ability> = ability based off "wind walk"
<fake unit> = copy of your "dying unit", with movement type set to flying, and collision size set to 0.

This works like a charm. :thumbs_up:

You create a "dying" version of yourself when used, and you are rendered invisible (probably to run to hell away :xxd:).
 
Status
Not open for further replies.
Top