• 🏆 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!

[Trigger] Respawn is broken

Status
Not open for further replies.
Level 4
Joined
Aug 17, 2014
Messages
102
upload_2018-7-1_18-38-30.png
upload_2018-7-1_18-39-14.png

So I am using this respawn system, but for some reason it works sometimes and it doesn't other times and no matter what I do one specific creep (some custom harpies I have) never respawn. Does anyone know what is wrong with this or how I can fix this? Or of a legit good GUI respawn system for an rpg style game
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
After the wait triggering unit may refer to no unit anymore. This happens, if the unit is gone, during the wait. Flying units usually leave no corpses, so they are gone after their death animation.
For ground units the corpse usually remains longer than 5 seconds, so it will work for them. Still if the ground unit's corpse is removed (e.g. raise dead) it wont' work. Also if the unit is killed by an artillery weapon type attack, no corpse will be spawned.

To fix this you should not refer to triggering unit after the wait. You could use a local variable to store the unit type and use the unit type to respawn the correct unit.
 
Level 4
Joined
Aug 17, 2014
Messages
102
After the wait triggering unit may refer to no unit anymore. This happens, if the unit is gone, during the wait. Flying units usually leave no corpses, so they are gone after their death animation.
For ground units the corpse usually remains longer than 5 seconds, so it will work for them. Still if the ground unit's corpse is removed (e.g. raise dead) it wont' work. Also if the unit is killed by an artillery weapon type attack, no corpse will be spawned.

To fix this you should not refer to triggering unit after the wait. You could use a local variable to store the unit type and use the unit type to respawn the correct unit.
I'll try that out thanks man. I'll let you know
 
Level 4
Joined
Aug 17, 2014
Messages
102
So I fixed the problem I made a few changes to the code like removing the custom value condition which seemed to of had been the problem. As for the harpies I just made a new custom unit based off of a ground melee unit and edited it to be a harpy and it now respawns normally.
 
Level 13
Joined
Oct 12, 2016
Messages
769
The main reason why this does not work for most flying units is because of that one bit in the object editor called "Can raise, does decay." For flying units, by default this is set to "Can't raise, does not decay," which means it leaves no corpse behind and is removed immediately.
To make it work for any flying unit, make sure they're set to "Can raise, does decay."
Also, if your respawn time is greater than the total decay time you have set in the gameplay constants (bones and corpse) it will not respawn.
 
Status
Not open for further replies.
Top