Blockland Forums > Modification Help

What would be the function that sets a delay of a raycast judging by distance?

Pages: << < (4/7) > >>

Katadeus:

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.

SWAT One:


--- Quote from: Nexus on January 16, 2012, 01:15:49 AM ---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?

--- End quote ---
Modifying...

Destiny/Zack0Wack0:

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.

SWAT One:


--- Quote from: Destiny/Zack0Wack0 on January 16, 2012, 11:11:11 PM ---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.

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


--- Quote from: Katadeus on January 16, 2012, 08:55:37 PM ---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.

--- End quote ---
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.

Destiny/Zack0Wack0:


--- Quote from: SWAT One on January 16, 2012, 11:27:08 PM ---And you are implying this would work while not lagging the server?

--- End quote ---


Pages: << < (4/7) > >>

Go to full version