OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Zayfod on 26 Jun 2003, 17:54:28
-
Is there anyway u can estimate point of impact (position) of a tank fired shell before it impacts?
Ive Tried this. I get the projectile from fired eventhandler.
Almost works but aloota the time the shell is too fast and b y the time the script has gotten its position its exploded and gone to position [0,0,0] as exploded shells do :-\
#shells
_incoming = shellins call shuffle select 0
_gl = "Logic" camcreate [(getpos _shooter select 0) + sin (getdir _shooter ) * 200, (getpos _shooter select 1) + cos (getdir _shooter ) * 200, getpos _shooter select 2]
_gl say _incoming
#loopb
_dist = _shooter distance _projectile
~0.01
? isnull _projectile: goto "shelldead"
goto "loopb"
#shelldead
? _dist <= 200: deletevehicle _gl; exit
~0.4
deletevehicle _gl
exit
This is very urgent
any help appreciated
Zay out
-
Could you please post the complete code? This is not very understandable; I dont see where you actually grab the projectile, and what you need the gamelogic for. You should try to use the velocity vector of the projectile to make a CCIP for it; no need to actually track it (that will never work reliably because of the speed of the projectile)