• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit Recycling

Status
Not open for further replies.
Level 17
Joined
Nov 11, 2010
Messages
1,974
Wouldn't you be able to do it like this?

2n87n6a.jpg


2ilhmjd.jpg


Edit: Added a new method how it could be done.
 
Level 19
Joined
Apr 10, 2010
Messages
2,789
How about triggering it? Store the dying unit in a variable and then create it and use some special effects for eye candy. Try using this:
  • Revive Set
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) slot status) Equal to Is playing
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Footman
        • Then - Actions
          • Set tempunit01 = (Dying unit)
          • Set tempplayer01 = (Owner of tempunit01)
          • Set footmanboolean = True
          • Set footmancount = (footmancount + 1)
          • Unit - Create 1 (Unit-type of tempunit01) for tempplayer01 at (Random point in tempregion <gen>) facing Default building facing degrees
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Game - Display to (Player group(tempplayer01)) the text: You have stored 1 f...
          • Trigger - Turn on Footman Revive <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Rifleman
            • Then - Actions
              • Set tempunit02 = (Dying unit)
              • Set tempplayer02 = (Owner of tempunit02)
              • Set riflemanboolean = True
              • Set riflemancount = (riflemancount + 1)
              • Unit - Create 1 (Unit-type of tempunit02) for tempplayer02 at (Random point in tempregion <gen>) facing Default building facing degrees
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Game - Display to (Player group(tempplayer01)) the text: You have stored 1 r...
              • Trigger - Turn on Rifleman Revive <gen>
            • Else - Actions
 
Last edited:
There isn't a way to revive a unit (non-hero) directly. Once it is dead, it can't be revived without recreation. (unless maybe you have resurrection or something, but I don't know if that just creates clones or what) As far as unit recycling goes, I think they have damage detection to create "simulated deaths" at 1 hp. Play death animation and decay a bit and then off to heaven to be recycled.

As far as systems go, this is the only one for unit recycling:
http://www.wc3c.net/showthread.php?t=101600

Unit recycling has a few complex problems. You have to worry about things such as explosive deaths (mortar, demolishers, etc.), you have to worry about the "heaven" units triggering events or still being in groups, you have to worry about the facing they have once they are revived (since it is not instant), and there are a few other things that are probably annoying to fix. :p

All-in-all, unit recycling requires a lot of dedication and scripting to make it right. It does make a difference in maps and the memory they use, but overall it is a pain and most players won't really notice the difference. Generally, dummy recycling should be enough. There are a few systems for dummy recycling on this site, maybe those might be of interest to you. :)

I'm not trying to bum you out or anything, I'm just saying that it is pretty hard, and there isn't a real clear way to do it, it depends on the map. :D
 
Level 15
Joined
Oct 16, 2010
Messages
941
(unless maybe you have resurrection or something, but I don't know if that just creates clones or what)

I just tried it out. I saved a value to a hashtable using the handle ID of a unit, killed the unit, ressurected it using the paladin ability, and then displayed the stored value and it was correct. So when you revive a unit using that ability it is the same unit as before. I should be able to make my own system to fit my map using this.

Thanks for your help ^-^
 
Status
Not open for further replies.
Top