Author Topic: How to set projectile speed to infinity  (Read 1778 times)

So, I was playing Blockland and I tricorded a T+T Sniper Rifle. It said that the projectile speed is infinite. How do I make it work that way?

what is "tricorded"

either way its because the sniper rifle uses raycasts (instant 3d line from muzzle to target) instead of normal projectiles



Yeah you totally can set it over the 200 limit though.

Code: [Select]
package NewMuzzleVelocityPackage {
function Projectile::onAdd(%projectile, %a, %b) {
%datablock = %projectile.getDatablock();

if(%datablock.newMuzzleVelocity !$= "") {
%projectile.initialVelocity = vectorScale(vectorNormalize(%projectile.initialVelocity), %datablock.newMuzzleVelocity);
}

return Parent::onAdd(%projectile, %a, %b);
}
};

activatePackage(NewMuzzleVelocityPackage);
From the Scattered Space forums. Used and tested. The projectile models may lag behind the actual projectiles at high speeds though.

P.S. Define a new projectile's velocity as newMuzzleVelocity = 1000; or whatever value you want instead of MuzzleVelocity = 200;

i have a feeling that method is far outdated and doesn't work anymore.

The projectile models may lag behind the actual projectiles at high speeds though.

So, it doesn't work.

i have a feeling that method is far outdated and doesn't work anymore.
i used it in battlemix and it worked


i have a feeling that method is far outdated and doesn't work anymore.
i used it in battlemix and it worked
it works from the server side but the clientside is hard coded to clamp projectile speeds over 200 so the client will think the projectile only has a speed of 200 so the client prediction will be all janky
plus im sure there will be some sort of other untold horrors like projectiles going through walls etc if you set it to some value over 200 and the engine doesn't have a case for it because the game purposely limits the speeds to 200 and by setting it above 200 you are basically going against what the engine is telling you explicitly not to do

projectile system was probably only created for slow moving projectiles like fireballs missiles etc, and bullets were probably intended to be raycasts but thats not how badspot did that and thus people learned how to create weapons from the base add-ons and thus slow projectile culture emerged

Nah, projectiles were originally unlimited speed.  I cannot seem to find it in the change log so I can only assume it happened in v9. There were collision issues at high velocities and potentially caused lag when miniguns would fire high speed projectiles.

Nah, projectiles were originally unlimited speed.  I cannot seem to find it in the change log so I can only assume it happened in v9. There were collision issues at high velocities and potentially caused lag when miniguns would fire high speed projectiles.
oh huh youre right the limit used to be "10000" my bad I could have sworn I read that clamping in the engine but I was wrong