| 06-16-2009, 12:18 PM | #1 |
So in one of my spells i explain I want to avoid RemoveUnit because it is evil.... however no longer remember why ... so if anyone could help =P |
| 06-16-2009, 01:00 PM | #2 |
Because a removed unit doesn't trigger onDeath, where most Indexing Utils fire, and it doesn't remove units from groups, but sets them to null, so FirstOfGroup(g) would return null, even if there are still units in teh group! Greez |
| 06-16-2009, 01:10 PM | #3 |
The first reason Seshiro gave is now, with stuff like AutoIndex, inaccurate. The second reason was never a reason, relating to FirstOfGroup, was never a reason, since if you were suffering that, then you're doing it wrong. Plus GroupRefresh now makes it easy in those cases where you're doing it badly to avoid doing it wrong without any hassle... |
| 06-16-2009, 01:15 PM | #4 | |
All the problem here will be solved once native hooking comes into play. Quote:
I agree with the point that using FirstOfGroup in such case is usually a bad practice. But anyway, back to the original complaint, GroupRefresh is not bulletproof. You can't call that every time before doing anything, and bugs still can happen unless you do it. That's because removing units can happen literally anytime, and ghost units take place instantly (once execution ends)..... |
| 06-16-2009, 02:08 PM | #5 |
With that logic it was never evil. RemoveUnit is evil precisely because you need things like that to make other things work. |
| 06-16-2009, 03:02 PM | #6 |
Mmm so it is evil only because it sets the unit null and it doesn't remove it from groups right? I thought it was connected to "ghost handles", or maybe it is and I am just to newb to make the link between those two things. =P |
| 06-16-2009, 03:07 PM | #7 |
afaik "ghost units" are just what you just described: Units that stay in groups as a null unit when removed and thus making exitwhen FirstOfGroup(g) == null and similar things bug. |
| 06-16-2009, 03:57 PM | #8 |
So, is there a way to remove a dead corpse from a game, without using "RemoveUnit" ?? |
| 06-16-2009, 04:01 PM | #9 |
killing it, and if it has decay, wait 88 seconds and the game will take care of it. |
| 06-16-2009, 04:36 PM | #10 | |
Quote:
The spell in cause acts on a dead body. After acting, I would like the dead body to go away, but that doesn't happen... not without remove unit =S |
| 06-16-2009, 04:53 PM | #11 | |
Quote:
Either hide it and move it somewhere out of reach of spells, or use some ability like raise dead that gets rid of corpses. |
| 06-16-2009, 05:02 PM | #12 |
UnitSuspendDecay(u, false) might work on trigger-created corpses. You could try that. |
| 06-16-2009, 06:10 PM | #13 | ||
Quote:
Thx God I have a special zone that is used for nothingness but ... I would prefer to avoid it =S Quote:
|
| 06-16-2009, 07:27 PM | #14 |
There is a gameplay constant, I believe, that sets the time in which a unit is removed from the game after death. Or else I am mixing it all up with an object editor data field. Anyway, I am sure there is a field where you can select 'can raise, does decay', and stuff like that. You could use that field in combination with the chaos ability, if it works. However, I am not sure about, even if it works, if it would solve your problem. |
| 06-16-2009, 08:24 PM | #15 |
why not explode the unit? shouldnt that prevent corpse creation? |
