have an attacker unit shoot a victim, with a slow projectile.
make the attacker die before the projectile hits.
when the projectile hits, both attackerID and attackerTeam passed to wupgets for events (UnitDamaged etc) are nil.
This means that gadgets are unable to tell what team damaged a unit and fail to implement team-based mechanics, despite it generally being obvious to the player,
Use cases
stats tracker that tracks how much damage each player dealt. (Exists in ZK, mostly minor annoyance because it's just stats)
a gadget that makes some units deal no friendly fire. (Exists in ZK, necessitates a big pile of hax involving dead units because else you would get major teamkill)
implementing every one of Brood War Zerg Queen abilities (Modding capability, plus funnily enough broodwar actually has the exact same problem so you may know exactly what i'm talking about even if you're unfamiliar with the ZK examples)
Existing workarounds and how they fail
ZK artificially keeps some units alive beyond death by giving them a fake "death animation" that just hides them and waits 15s, just so that damage can be attributed properly. This fails because units can be force-removed in ways that don't involve any way to delay it (e.g. reclaim), and it's absurdly inelegant and requires a pile of further hax on top.
some damage-related events receive a projectileID param, from which you can poll the projectile for its teamID. This fails because with slow enough explosionSpeed the projectile can be gone by the time the shockwave reaches the victim, and sometimes you simply don't have a projectile in the first place.
Other remarks
damage that was never sourced to any team (e.g. falling, lava) should still pass nil.
attackerDefID is also nil and it would be good if it was available, but that is not in the scope of this request.
Description / repro of the problem
attackerID
andattackerTeam
passed to wupgets for events (UnitDamaged
etc) arenil
.This means that gadgets are unable to tell what team damaged a unit and fail to implement team-based mechanics, despite it generally being obvious to the player,
Use cases
Existing workarounds and how they fail
explosionSpeed
the projectile can be gone by the time the shockwave reaches the victim, and sometimes you simply don't have a projectile in the first place.Other remarks
nil
.attackerDefID
is alsonil
and it would be good if it was available, but that is not in the scope of this request.