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

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

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

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

Post 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?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

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

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

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

Post by zwzsg »

KDR_11k just taught me that return true in gadget:Explosion makes the CEG not appear.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

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

Post 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.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

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

Post 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?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

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

Post by Google_Frog »

Your flamethrower probably has "noExplode = true".
Post Reply

Return to “Feature Requests”