Author Topic: Remove/Change Projectile Cap  (Read 678 times)

the projectile cap is really just getting in the way, especially for things like sniper rifles and such

why not remove it from weapon scripts, but keep it intact as-is for events?

I think that it stays under a certain speed so it doesn't lag out everything. In most games, if something goes faster than the game can render, it can lag and even crash it. Especially on already-laggy servers.

I suggest support of hitscan weapons instead. You can make them using raycasts but I remember Ephi saying they were unreliable at the moment.

I made a raycast-type weapon a while ago which seemed to work, for use in 'tools' such as the Wrench and Hammer. Giving the script infinite range for hitscan sniper rifles didn't seem to cause any problems, except for damage detection on vehicles - miniGameCanDamage() doesn't work between player objects and vehicle objects sometimes. It could damage objects, spawn an effect or explosion on impact and play a sound. I haven't done impact impulses or made it trigger onProjectileHit yet, though. (I'm wondering whether it should and how the events would react to a non-existing "projectile" target)

I made a raycast-type weapon a while ago which seemed to work, for use in 'tools' such as the Wrench and Hammer. Giving the script infinite range for hitscan sniper rifles didn't seem to cause any problems, except for damage detection on vehicles - miniGameCanDamage() doesn't work between player objects and vehicle objects sometimes. It could damage objects, spawn an effect or explosion on impact and play a sound. I haven't done impact impulses or made it trigger onProjectileHit yet, though. (I'm wondering whether it should and how the events would react to a non-existing "projectile" target)

If you can get everything else working properly, you could make it spawn a projectile a tiny distance from the target found by the raycast.  This way, damage and such should be handled normally.

I think that was the method Ephialtes' raycasting sniper rifle used on his server, but occasionally normals/etc. miscalculated (engine problem?) and caused the projectile to miss at certain angles.

I was only using the script for tool weapons (Capture The Flag items and the Police Baton), but when I gave the script to Bushido to test it seemed to work for his 'Metal Slug' weapon fine at long ranges when tested.

If I had the entire Projectile::onCollision or miniGameCanDamage functions I could do the can damage tests reliably, that's the only problem with it. Damage is handled in mostly the same way as Projectile::damage anyway, since it scales with the using player, can't damage more than 100*scale/below 0 and calls %obj.damage() in the right way, including damage type. Radius damage is fine with the projectile explosion doing that automatically.
« Last Edit: March 12, 2009, 02:24:16 PM by Space Guy »

but it's kinda unreliable.

sometimes nothing happens at all, other times it works great

sometimes nothing happens at all
... Oh.

I didn't know that happened. I've never experienced it in my tests. Hmm.

I think that was the method Ephialtes' raycasting sniper rifle used on his server, but occasionally normals/etc. miscalculated (engine problem?) and caused the projectile to miss at certain angles.

I was only using the script for tool weapons (Capture The Flag items and the Police Baton), but when I gave the script to Bushido to test it seemed to work for his 'Metal Slug' weapon fine at long ranges when tested.

If I had the entire Projectile::onCollision or miniGameCanDamage functions I could do the can damage tests reliably, that's the only problem with it. Damage is handled in mostly the same way as Projectile::damage anyway, since it scales with the using player, can't damage more than 100*scale/below 0 and calls %obj.damage() in the right way, including damage type. Radius damage is fine with the projectile explosion doing that automatically.

Well, I'm sure Ephi would agree that math isn't his strong suit.  It should be possible to reliably / consistently calculate appropriate projectile paths so that damage can be handled without so much work.