RadiusDamage Hardcoded On? [... not sure if bug ...] RESOLVED
by Steve Acaster · in Torque 3D Professional · 07/01/2010 (12:38 pm) · 4 replies
As the title says ... [... not sure if bug ...] b1.1b1
RadiusDamage gets played on a projectile striking an object with the RadiusDamage() function in the weapon's (scripts)weaponName.cs ..... agreed? good, I'll continue.
But if you remove that function (comment it out), radiusDamage still occurs if the (art)weaponName.cs has the required fields (radiusDamage/damageRadius/areaImpulse).
So radiusDamage appears to be hardcoded to start if the correct attributes are there, regardless of whether the projectile::onCollision calls the function in script or not ---> thus making the extra call in the projectile::onCollision unnecessary.
Of course if you don't want a radiusDamage call, you've got to remove the (art)datablock attributes rather than the radiusDamage function in onCol.
Commenting out the (art/datablock) radiusDamage related fields and calling the function from onCollision with manual values calls the function fine as well.
So ... yeah ... not sure if bug or just observation. Either way, the function didn't act entirely as expected.
RadiusDamage gets played on a projectile striking an object with the RadiusDamage() function in the weapon's (scripts)weaponName.cs ..... agreed? good, I'll continue.
But if you remove that function (comment it out), radiusDamage still occurs if the (art)weaponName.cs has the required fields (radiusDamage/damageRadius/areaImpulse).
So radiusDamage appears to be hardcoded to start if the correct attributes are there, regardless of whether the projectile::onCollision calls the function in script or not ---> thus making the extra call in the projectile::onCollision unnecessary.
Of course if you don't want a radiusDamage call, you've got to remove the (art)datablock attributes rather than the radiusDamage function in onCol.
Commenting out the (art/datablock) radiusDamage related fields and calling the function from onCollision with manual values calls the function fine as well.
So ... yeah ... not sure if bug or just observation. Either way, the function didn't act entirely as expected.
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
I did mod the weaponNameProjectile::onCollision to disable damage/explosion under certain circumstances ... hence when I found that the damageRadius was still working regardless...
[edit]
Actually I'm using individual Projectile::onCollision's which of course overrides the main onCollision ... but I hadn't noticed the onExplode function, so yeah ... it makes sense that radiusDamage should still occur.
I'm still thinking like a throwback to TGE!
[double edit} quick test..
07/01/2010 (3:26 pm)
Projectile.cs is stock, don't think I've made any code adjustments to how projectiles work (not knowingly anyhow!).I did mod the weaponNameProjectile::onCollision to disable damage/explosion under certain circumstances ... hence when I found that the damageRadius was still working regardless...
[edit]
Actually I'm using individual Projectile::onCollision's which of course overrides the main onCollision ... but I hadn't noticed the onExplode function, so yeah ... it makes sense that radiusDamage should still occur.
I'm still thinking like a throwback to TGE!
[double edit} quick test..
#3
If I disable ProjectileData::onExplode ---> I still get radiusDamage ...
and I don't see anywhere else in script that it would get called (now I've commented out my custom radiusDamage in WeaponNameProjectile::onCollision
07/01/2010 (3:45 pm)
Okay, I might have spoken too soon ---If I disable ProjectileData::onExplode ---> I still get radiusDamage ...
and I don't see anywhere else in script that it would get called (now I've commented out my custom radiusDamage in WeaponNameProjectile::onCollision
#4
:P
07/01/2010 (4:26 pm)
Okay ... I've just baffled myself - happens with alarming frequency - moving to Resolved. :P
Associate Michael Hall
Distracted...
... remove the unique projectile callback and it's rolling back to the projectile namespace callback.... maybe?
Will have to test this myself later, cant believe this behavior hadn't been noticed before.