my first attempt at making a serious ability for my map has failed... basically what the ability is supposed to do, is "consume" all nearby corpses and restore energy to the caster.
How I've gone about doing it is creating an Effect - Instant ability, which does a Search effect with a radius of 1.5, extended by unit radius, having filters set to: "Required: Biological, Dead. Excluded: Hidden, Missile, Structue". The search effect then again applies a set effect, one which hides the target and one which restores 25 energy to the caster. The thing is, no corpses are hidden and no energy is restored to the queen. I tried removing the "dead" requirement and everything works perfectly, living units around the caster are being hidden and she is given 25 energy per unit "consumed".
I also tried with the above search filters, meaning without the "Required: Dead" but then using an IsDead validator on the set effect, this didn't work either.
Any help would be very much appreciated, I am at my wit's end :(
(I realize this could quite easily be triggered, but I'm trying to learn the data editor!)
actually, that might just be the case, was starting to wonder if that was maybe the source of the problem. I guess I'll have to come up with something creative...
SC2 actually does support "dead" units but it's highly finnicky (you have to get your data exactly right) and also quite buggy. (but there are workarounds)
Things to watch for:
- Unit/Stats/Death Time has to be set to something. Setting it to -1.0 means the unit will stay dead for ever. 0.0 means the unit will instantly disappear when it dies. X means the unit will stay around for X seconds.
- Just because the unit stays around doesn't mean the actor will. For some actors, you have to modify the actor events, such as by having the animations pause sometime during the death phase, in order for a corpse to stay on the board. If the model doesn't have a "dead" animation, you will need to make some fairly extensive modifications to the actor.
- Dead units can't be selected/targeted even when they do exist as units. This appears to be hard coded into SC2 itself. Even abilities whose data is specifically set to target dead units can't target dead units. This is dumb but all my testing indicates that's the way it is.
- There is a workaround, though; if you want an ability that does something with dead units, have that ability target a point instead of a unit. Then use a trigger that fires on that ability, and a unit group search like (All units within 2.0 meters of target point matching conditions: Dead) to find the dead unit(s) and act on them.
Hello there,
my first attempt at making a serious ability for my map has failed... basically what the ability is supposed to do, is "consume" all nearby corpses and restore energy to the caster.
How I've gone about doing it is creating an Effect - Instant ability, which does a Search effect with a radius of 1.5, extended by unit radius, having filters set to: "Required: Biological, Dead. Excluded: Hidden, Missile, Structue". The search effect then again applies a set effect, one which hides the target and one which restores 25 energy to the caster. The thing is, no corpses are hidden and no energy is restored to the queen. I tried removing the "dead" requirement and everything works perfectly, living units around the caster are being hidden and she is given 25 energy per unit "consumed".
I also tried with the above search filters, meaning without the "Required: Dead" but then using an IsDead validator on the set effect, this didn't work either.
Any help would be very much appreciated, I am at my wit's end :(
(I realize this could quite easily be triggered, but I'm trying to learn the data editor!)
Are there any "dead" units around? I don't belive SCII units leave "corpses" by default...
@Anthius: Go
actually, that might just be the case, was starting to wonder if that was maybe the source of the problem. I guess I'll have to come up with something creative...
SC2 actually does support "dead" units but it's highly finnicky (you have to get your data exactly right) and also quite buggy. (but there are workarounds)
Things to watch for:
- Unit/Stats/Death Time has to be set to something. Setting it to -1.0 means the unit will stay dead for ever. 0.0 means the unit will instantly disappear when it dies. X means the unit will stay around for X seconds.
- Just because the unit stays around doesn't mean the actor will. For some actors, you have to modify the actor events, such as by having the animations pause sometime during the death phase, in order for a corpse to stay on the board. If the model doesn't have a "dead" animation, you will need to make some fairly extensive modifications to the actor.
- Dead units can't be selected/targeted even when they do exist as units. This appears to be hard coded into SC2 itself. Even abilities whose data is specifically set to target dead units can't target dead units. This is dumb but all my testing indicates that's the way it is.
- There is a workaround, though; if you want an ability that does something with dead units, have that ability target a point instead of a unit. Then use a trigger that fires on that ability, and a unit group search like (All units within 2.0 meters of target point matching conditions: Dead) to find the dead unit(s) and act on them.
@Venificus: Go
Well, that explains pretty much everything. Should be able to fix my ability now, thanks!