Page 1 of 1

Shield hit callin

Posted: 11 Dec 2009, 01:01
by Google_Frog
CA needs to detect when shields are hit by projectiles if the shield behaviour is going to be improved. Params would at least need to be ShieldID, AttackerID, damage, collision position. The callin would need to be called even if a weapon has more damage than shield charge (ie it would pass through the shield). The callin should return whether the projectile should be destroyed or not.

Re: Shield hit callin

Posted: 11 Dec 2009, 01:11
by TheFatController
+1

Also - related topic, still relevant..
http://springrts.com/phpbb/viewtopic.php?f=21&t=19657

Re: Shield hit callin

Posted: 11 Dec 2009, 01:16
by Argh
+1, it would be cheaper than constantly checking the state of the Shields, for area shields.

Re: Shield hit callin

Posted: 01 Apr 2010, 09:30
by zwzsg
Google_Frog wrote:ShieldID, AttackerID, damage, collision position.
You forgot the most important one, weaponID.

Re: Shield hit callin

Posted: 01 Apr 2010, 10:32
by thesleepless
wouldn't it be better if it gave you the projectile object as well? then you could choose to do actions on that such as destroy, apply impulse, or modify it in other ways ?

Re: Shield hit callin

Posted: 01 Apr 2010, 12:28
by zwzsg
I've not seen any Lua commands affecting projectiles, so no, you could not apply impulse to the projectile via Lua.

Re: Shield hit callin

Posted: 01 Apr 2010, 12:58
by thesleepless
not with that attitude!

could make some lua projectile functions

Re: Shield hit callin

Posted: 01 Apr 2010, 13:03
by Kloot
zwzsg wrote:I've not seen any Lua commands affecting projectiles
Use your eyes better:

http://springrts.com/wiki/LuaCallinReturn#Projectiles
http://springrts.com/wiki/Lua_SyncedCtrl#Projectiles

(There are more than these.)

Re: Shield hit callin

Posted: 01 Apr 2010, 13:21
by zwzsg
I stand corrected.
0.77b1, 0.77b2 changelog wrote: - new projectile call-outs:
Spring.GetProjectilePosition(projectileID) -> px, py, pz
Spring.GetProjectileVelocity(projectileID) -> vx, vy, vz
Spring.SetProjectilePosition(projectileID, px, py, pz) -> nil
Spring.SetProjectileVelocity(projectileID, vx, vy, vz) -> nil
Spring.SetProjectileDetonate(projectileID) -> nil

Re: Shield hit callin

Posted: 01 Apr 2010, 13:37
by Licho
Its usefull not just for gameplay but also for effects - we could spawn some nice ripples on shield surface or make completely customized shield visualisation.