Author Topic: What would be the function that sets a delay of a raycast judging by distance?  (Read 3733 times)

Problem, officers.
So the first, measuring raycast goes out, finds a player standing still, 2000 studs away.
"Holy poop, that's a long way," says the raycast to the script, which then computes that statement to mean that the raycast will fire in 2 seconds.
Got it?
So then, as the delay occurs, a player moves into the way of the sniper, after he sees the gun fire, because he thinks he is safe. Then he dies.
No way to avoid that, unless you fire raycasts that go out, stop at a certain distance, then spawn another identical raycast in the same spot an instant later.
Which I think is a jolly good idea.

Also I really do not understand how you are deriving your timing.  You do realize that (d/d)/(0.3) will always be the same?
Modifying...

Setting initialVelocity in Projectile::onAdd allows you to have unlimited projectile speed. All hail the Almighty Lord Trigun and Solver of the "My stuffty Unoriginal Weapons Don't Shoot Fast Enough" Dilemma. He only requests payment in your souls, your children's souls and so on.

Setting initialVelocity in Projectile::onAdd allows you to have unlimited projectile speed. All hail the Almighty Lord Trigun and Solver of the "My stuffty Unoriginal Weapons Don't Shoot Fast Enough" Dilemma. He only requests payment in your souls, your children's souls and so on.
And you are implying this would work while not lagging the server?

Problem, officers.
So the first, measuring raycast goes out, finds a player standing still, 2000 studs away.
So then, as the delay occurs, a player moves into the way of the sniper, after he sees the gun fire, because he thinks he is safe. Then he dies.
Well it fires at the same time as a gun would normally fire, immediately when pulling the trigger.  It just sets the position that the player is/was looking at to explode at the calculated delay.

Edit: OP Edited with now working equations.
« Last Edit: January 16, 2012, 11:31:39 PM by SWAT One »

And you are implying this would work while not lagging the server?

I am not looking for sarcasm.  I tried to present my question in a feasible way.  If you cannot answer this question maturely, and in a way that does not exceed the current projectile speed limit, then do not post in this thread.

I am not looking for sarcasm.  I tried to present my question in a feasible way.  If you cannot answer this question maturely, and in a way that does not exceed the current projectile speed limit, then do not post in this thread.
I just told you how to get rid of the limit. And I thought you were being arrogant. Don't be so uptight, you're on the Blockland forums, not visiting the Queen.
« Last Edit: January 17, 2012, 12:14:45 AM by Destiny/Zack0Wack0 »

You still didn't directly answer the question of whether or not it lags the server.

You still didn't directly answer the question of whether or not it lags the server.
I wouldn't be telling you if I did.. and when you're running native code against using raycasts, raycasts will always lose.

Alright.  Thank you for making that clear.

I wouldn't be telling you if I did.. and when you're running native code against using raycasts, raycasts will always lose.
But raycasts have the word ray in it, which is like a ray gun. And ray guns RULE THE WORLD.

So anyway, how would this mathematical string be put into Brian's function?

What mathematical string?

Well it fires at the same time as a gun would normally fire, immediately when pulling the trigger.  It just sets the position that the player is/was looking at to explode at the calculated delay.
So you pull the trigger, the raycast kills someone, and then an explosion goes off later, in another place entirely?


What?
I don't understand why, how, what.

Setting initialVelocity in Projectile::onAdd allows you to have unlimited projectile speed. All hail the Almighty Lord Trigun and Solver of the "My stuffty Unoriginal Weapons Don't Shoot Fast Enough" Dilemma. He only requests payment in your souls, your children's souls and so on.
Do clients actually see the increased speed or only the local connection?

Edit: Now that I think about it, isn't the solution %projectile.setVelocity(); in ::onAdd?