I'm trying to get lead-on distance to work with my bots, but i'm not exactly sure how to start. Given the projectile's velocity, the velocity of the player the bot's firing at, the distance between the player and the bot, how would I do this?
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
dummy = FireProjectile(rbot, projectile_weap0[curweap], -1, -1, '0 0 0', '0 0 0', 1.0, 0, 0.0, 0.0); projVel = GetThingVel(dummy); DestroyThing(dummy); opVel = GetThingVel(target); velDif = VectorSub(projVel, opVel); speed = VectorDist('0 0 0', velDif); distance = VectorDist(GetThingPos(target), GetThingPos(rbot)); time = distance / speed; moved = VectorScale(opVel, time); meet = VectorAdd(GetThingPos(target), moved);