HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Does the flying height trick prevent a unit from obstructing movement?

12-30-2006, 04:15 AM#1
CaptainPicard
I was reading the flying height trick thread recently active in this forum.

1.) Is this the same trick that Anitarf and iNfraNe used in their cinematic system with the CreateActor function?
(ANSWER FOUND: YES)

2.) If I use this on a unit, will the unit cease to obstruct the movement of other units? Is there any way to do this?

What I'm really trying to do is make it so that units die but persist in the map at the end of their death animations. (The carnage excites me.) I'd like it so that the bodies litter the ground but do not obstruct the movement of living units.

I tried to do this with the following two triggers:

Trigger:
Witness the Carnage
Collapse Events
Unit - A unit owned by Player 1 (Red) Dies
Unit - A unit owned by Player 3 (Teal) Dies
Conditions
Collapse Actions
Set DyingUnitSlotFound = False
Unit - Suspend corpse decay for (Dying unit)
Collapse For each (Integer DylingUnitLoopA) from 0 to 15, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
DyingUnitTimers[DylingUnitLoopA] Equal to 0
DyingUnitSlotFound Equal to False
Collapse Then - Actions
Set DyingUnitSlotFound = True
Set DyingUnitType = (Unit-type of (Dying unit))
If (DyingUnitType Equal to Swordsman) then do (Set DyingUnitTimers[DylingUnitLoopA] = 31) else do (Do nothing)
If ((DyingUnitType Equal to Archer Commander) or (DyingUnitType Equal to Archer)) then do (Set DyingUnitTimers[DylingUnitLoopA] = 33) else do (Do nothing)
If (DyingUnitType Equal to Priestess) then do (Set DyingUnitTimers[DylingUnitLoopA] = 35) else do (Do nothing)
If ((DyingUnitType Equal to Sentinel) or (DyingUnitType Equal to Hunter)) then do (Set DyingUnitTimers[DylingUnitLoopA] = 20) else do (Do nothing)
If (DyingUnitType Equal to Elite Assassin) then do (Set DyingUnitTimers[DylingUnitLoopA] = 41) else do (Do nothing)
If (DyingUnitType Equal to Master Swordsman) then do (Set DyingUnitTimers[DylingUnitLoopA] = 15) else do (Do nothing)
If (DyingUnitType Equal to Swordsman (White Wolf Form)) then do (Set DyingUnitTimers[DylingUnitLoopA] = 27) else do (Do nothing)
If (DyingUnitType Equal to Wolf Rider) then do (Set DyingUnitTimers[DylingUnitLoopA] = 17) else do (Do nothing)
If ((DyingUnitType Equal to Norj'Hal Elf (Female)) or (DyingUnitType Equal to Norj'Hal Elf (Female, Brunette))) then do (Set DyingUnitTimers[DylingUnitLoopA] = 19) else do (Do nothing)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
DyingUnitType Equal to Jal'Vin Elas
DyingUnitType Equal to Telamar Ne'Fiin
Collapse Then - Actions
Set DyingUnitLoc = (Position of (Dying unit))
Hero - Instantly revive (Dying unit) at DyingUnitLoc, Hide revival graphics
Custom script: call RemoveLocation( udg_DyingUnitLoc)
Unit - Set life of (Dying unit) to 10.00
Unit - Make (Dying unit) Invulnerable
Animation - Play (Dying unit)'s death animation
Set DyingUnitTimers[DylingUnitLoopA] = 33
Collapse Else - Actions
Do nothing
Set DyingUnits[DylingUnitLoopA] = (Dying unit)
Collapse Else - Actions
Do nothing

Trigger:
Suspend Decay
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer DylingUnitLoopA) from 0 to 15, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
DyingUnitTimers[DylingUnitLoopA] Greater than 1
Collapse Then - Actions
Set DyingUnitTimers[DylingUnitLoopA] = (DyingUnitTimers[DylingUnitLoopA] - 1)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
DyingUnitTimers[DylingUnitLoopA] Greater than 0
Collapse Then - Actions
Set DyingUnitTimers[DylingUnitLoopA] = 0
Animation - Change DyingUnits[DylingUnitLoopA]'s animation speed to 0.00% of its original speed
Game - Display to Player Group - Player 5 (Yellow) the text: (Suspending Decay of + (String((Unit-type of DyingUnits[DylingUnitLoopA]))))
Set DyingUnits[DylingUnitLoopA] = No unit
Collapse Else - Actions
Do nothing

The different numbers for different units reflect the length of each unit's death animation. And I do see the debugging message "Suspending Decay of <unit type>." But, the units play their full death and then their decay animation nonetheless, and eventually get removed from the game. Again, I want there to be visible, fully clothed bodies sprawled out across the floor, but I want other units to be able to walk over them.

Any ideas?
12-30-2006, 05:17 AM#2
CaptainPicard
Well, I got it to work. I had to create a dummy unit type for each unit I want to persist, though, and replace each living unit the moment it died--setting pathing on the dummy to zero makes it work. Adding the locust ability was nice so that the player doesn't accidentally click a dead guy or see that he's still got 1 or 2 hp.

Edit: Anyone got an idea of how to make the spawned blood persist as well? It seems I might be able to set the "extra" field of each dummy, pathingless unit to "none", then play the blood sploosh as a separate model, wait a short while, and set its animation speed to zero. But that may not work...
12-30-2006, 05:25 AM#3
grim001
or you can use SetUnitPathing(u, false)
12-30-2006, 09:04 AM#4
Pheonix-IV
Go into Gameplay Constants and set the Decay Time - Flesh number to something like 90000 seconds. Bam, extra-long corpses.

As for the blood, the blood is what's known as an Event Object Ubersplat, there's no way to make it persist. It will always decay after a certain period of time.
12-30-2006, 01:54 PM#5
iNfraNe
You can however just place ubersplats that last after the unit dies..
12-30-2006, 06:29 PM#6
The)TideHunter(
Yeah, or create a corpse.
12-31-2006, 09:40 AM#7
BertTheJasser
Letting persist corpse through a whole game is (at least in my eyes) to treat equally with not setting a handle to null, as both hotsage a handle id, which finally will make the game slower...