| 11-18-2002, 12:13 AM | #1 |
Guest | Argh! I need a way to make a trigger run when a unit dies, but is reincarnated. It doesn't count as a death, seeing as the Unit dies event doesn't work.. I tried orderes, I even tried when the unit enters a region, but.. it's not working.. any ideas? |
| 11-18-2002, 02:33 AM | #2 |
Guest | Reincarnation takes a few seconds to activate. Try this. Event Unit Dies Action Wait X seconds if (Dying Unit is Alive = True) then blahblahblah Note this will also catch Ankhs of Reincarnation, and quick Ressurections. But I am assuming you are probably trying to catch the reincarnation of a specific unit, so you can put that in the conditions. Or are you saying that a reincarnated unit doesn't activate the "Unit Dies" event at all, even when it dies initially? Then you might want to try the "Unit Finishes Reviving" or "Unit Starts Reviving" events. |
| 11-18-2002, 02:36 AM | #3 |
Guest | Yeah, the Unit dies event does activate when a Unit has reincarnation ready to go, or an ankh, I assume. And the revival crap refers to altars, not reincarnations... |
| 11-18-2002, 03:27 AM | #4 |
Guest | Reincarnation is a self-buff. Maybe you can catch it under "order", but probably not. If those two suggestions don't work, then you probably can't catch a ressurection. What do you want to do with the caught ressurection, anyway? Maybe we can get around the ressurection thing entirely. |
| 11-18-2002, 03:37 AM | #5 |
Guest | Well.. basically it's just a way to kill a unit and keep the same unit alive and well. Basically.. I don't want to be creating losts of units, so instead I'm using hides/unhides.. I need a unit to die and then come back in a few minutes as the same exact unit (same slot in memory)... I guess.. maybe I could play the deanimation, then move them to a far-off region, and call that region "death". I dunno.. it'd be a lot easier if I could etect a ressurection. |
| 11-18-2002, 03:43 AM | #6 |
Well for ahnks you can do something like (if unit has ahnk=true)then do nothing else do whatever. And i dont understand what this would have to do with the altar, since if theres an altar to revive at then you shouldnt need a revive unit trigger. But if you wanna revive them at the altar, then you would have to make the altar run its revive hero ability, or just play its animation for when it revives something, then make a trigger that unit is revived at location of the altar. That might work, and if it doesnt, or is the wrong thing, then plz say exactly what your trying to do. And dont say "its secret" cuz we cant help you if its a secret. Too little information is bad. |
| 11-18-2002, 04:04 AM | #7 |
Guest | I've tried to discribe it... a unit dies, and acts completely dead, but is still able to come back later using the same slot of memory. I dunno what could be clearer.. It'd also be a LOT easier just to completely remove the unit from the memory.. is there anyway to do that? |
| 11-18-2002, 05:57 AM | #8 |
Guest | Killing a unit (or the death of a unit) usually frees up what memory it was using once its completely removed from the game (Heros don't count of course). Its removing a unit via the "Remove Unit" function that causes memory leaks. Take Blizzard's own advice. In their "ReplaceUnitBJ" function, they actually mention that just removing a unit is dangerous and they should be hidden, killed, THEN removed for best effect. |
| 11-18-2002, 07:33 AM | #9 |
Guest | Hmm.. I tried killing them.. but it doesn't seem to help.. does explode make a difference? And.. regardless wouldn't the best way to keep the memory clear is reuse the same units over and over, instead of creating more and more and just killing them off? |
| 11-18-2002, 07:41 AM | #10 |
Explode makes no difference. How is the unit being reincarnated? If it's being reincarnated via an ankh of reincarnation, use the "Event Response - Specific Unit Event", then select "Uses an item". Then, use the Item-Type Event Response condition to check if it's an ankh. It's also possible to use another event/condition if the player reincarnates via a spell. Lastly, the limits in WC3 are so absurdly high that you shouldn't worry about hitting any limits. But hey, if you want to do it your way, the above should work. |
| 11-18-2002, 08:17 AM | #11 |
Guest | okay.. could you tell me extactly how to detect when a 'Neutral Unit - Reincarnation' ability is used? ;) And.. I need to do this 'cuz otherwise I'm making so many units that it lags.. that is.. about 100 per round, 25 rounds later.. that's 2,000 units... that's a minium.. so.. you can see where the lag comes from. |
| 11-18-2002, 05:26 PM | #12 |
Guest | I've played maps like "Smash TV Arcade" that uses massive amounts of units (each time you attack something, it creates another unit) and not experienced any slowdown. It might actually be the process of creating and killing units (or whatever triggers you are using with those events), not what is left in memory, that is hurting your processor. The problem is that probably any type of triggers that can catch massive amounts of deaths will also slowdown the game, since triggers run slower then the inherent functions within WC3. If you still want to try and "re-use" units, then you could check to see if a unit is damaged, and if their health is at 10% or less, teleport it away and heal it to full health. Then you may be able to reuse, say, a group of 50-so units all placed somewhere off the map. |
