Home   Help Search Login Register  

Author Topic: Point of impact calculation and distance from shooter thereof  (Read 538 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
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 :-\


Code: [Select]
#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

« Last Edit: 26 Jun 2003, 17:58:08 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Rubble_Maker

  • Guest
Re:Point of impact calculation and distance from shooter thereof
« Reply #1 on: 29 Jun 2003, 23:23:16 »
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)