• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Respawn Unit question w/ remove

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 64
Joined
Aug 10, 2018
Messages
6,543
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.
 
Top