Blockland Forums > Modification Help
What would be the function that sets a delay of a raycast judging by distance?
Nexus:
This problem is actually the core of what I was kinda working on with a raycast projectile mod, which would have raycasts that operate as a function of time by breaking them down into thousands of straight segments, which would make things like movement anticipation and firing ahead of the target possible with raycasts, as well as raycasts being affected by gravity or whatever. It could do all the timing for you, but Rykuta got bored with Gears of War 3 and stopped working on the mod, so I kinda stopped working on the support scripts for it and started doing my own things.
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?
SWAT One:
Brian got it right. Nexus, it's d/0.3d
Brian Smithers:
--- Quote from: SWAT One on January 16, 2012, 01:54:31 AM ---Brian got it right. Nexus, it's d/0.3d
--- End quote ---
Wait.
My stuff works
what
Port:
--- Quote from: Brian Smithers on January 16, 2012, 12:12:15 AM ---
--- Code: ---function getTimeFromDistance(%dist)
{
return %dist / 0.3 * %d;
}
--- End code ---
--- End quote ---
Where are you pulling %d from?
Anyway, the problem with this is that you raycast forward, hitting a player, then that player moves and an explosion spawns in the air next to the player.
Nexus:
--- Quote from: SWAT One on January 16, 2012, 01:54:31 AM ---Brian got it right. Nexus, it's d/0.3d
--- End quote ---
that is a constant, 3.333
no matter what the distance d is it will always be 10/3