Page 1 of 1

Add teamID in Explosion call-in and AddDamage call-out

Posted: 08 Nov 2011, 22:00
by zwzsg
I implemented a handicap system where handicap results in damage multiplier between teams.

But KP implements Damage over Time (DoT) Area of Effect (AoE) weapons by using Script.SetWatchWeapon, gadget:Explosion, and Spring.AddUnitDamage.

I managed to workaround to rattach the damage to another unit of the same team when the unit that fired the shot before its DoT AoE expire.

However, when the unit dies before the shot explodes, I can't know which team does it belong, and thus a wrong damage modifier may be applied.

So it would be nice if instead of just:
gadget:Explosion(weaponID, px, py, pz, ownerID)
it was:
gadget:Explosion(weaponID, px, py, pz, ownerUnitID, ownerTeamID)

And it would be nice if Spring.AddUnitDamage had an extra parameter to pass an attackerTeamID even if there is no attackerUnitID.

So that I could retrieve the team dealing the damage from the gadget:UnitPreDamaged of the other gadget.

Loosely related, but is it possible to delete a shot in mid-air, or to prevent its CEG from triggering when it reaches ground?

Re: Add teamID in Explosion call-in and AddDamage call-out

Posted: 09 Nov 2011, 00:54
by Kloot
zwzsg wrote:Loosely related, but is it possible to delete a shot in mid-air

Code: Select all

Spring.SetProjectileCollision(projectileID)
makes a projectile go poof.

Re: Add teamID in Explosion call-in and AddDamage call-out

Posted: 09 Nov 2011, 01:01
by zwzsg
KDR_11k just taught me that return true in gadget:Explosion makes the CEG not appear.

Re: Add teamID in Explosion call-in and AddDamage call-out

Posted: 09 Nov 2011, 04:10
by Google_Frog

Code: Select all

gadget:Explosion(weaponID, px, py, pz, ownerUnitID, ownerTeamID)
+1. ZK has minelayer artillery with the annoying bug that shots in mid air when the unit dies cannot spawn as mines because they can't be assigned a team.

Re: Add teamID in Explosion call-in and AddDamage call-out

Posted: 10 Nov 2011, 11:43
by Jools
Loosely related: what exactly is an explosion? I tried to watch the flamethrower weapon but it isnt caught in gadget:Explosion even though set in Script.WatchWeapon.

Is flamethrower not applicable to explosions?

Re: Add teamID in Explosion call-in and AddDamage call-out

Posted: 10 Nov 2011, 13:42
by Google_Frog
Your flamethrower probably has "noExplode = true".