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

Respawn Unit question w/ remove

Status
Not open for further replies.
Level 3
Joined
Oct 21, 2023
Messages
25
Is the following trigger necessary? My map is all about constantly respawning units after the player's units die. But I'd like to keep the bodies of the dead units too, for summons.

  • Unit - Remove (Triggering unit) from the game
 
Level 3
Joined
Oct 21, 2023
Messages
25
  • PlayerUnitDie Player 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to PlayerUnitFree[1]
        • Then - Actions
          • Wait 2.00 game-time seconds
          • Unit - Remove (Triggering unit) from the game
          • Unit - Create 1 F[(Random integer number between 1 and Z)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[1] = (Last created unit)
          • Unit - Add Inventory (Hero) to (Last created unit)
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
A unit gets removed once it's corpse is done decaying. This gives time for abilities which use corpses to function properly. A Hero doesn't leave behind a corpse and instead becomes "hidden" after their death animation has finished (not sure if it's the same exact hidden mechanic that Zeppelins/Burrows use but I'd assume so). You can modify the Death Types in the Object Editor:

1699204583110.png


You can also go into the Gameplay Constants to modify the timers related to decaying. So most of these are used to determine when to remove a unit from the game:
1699204731475.png

You can also modify a Hero's dissipation period. I assume once this time is up the hero becomes revivable in an Altar again, which would explain the delay. Basically, the game is trying to sync the unit death animations up with other death related mechanics so that everything makes sense.
 
Status
Not open for further replies.
Top