Home   Help Search Login Register  

Author Topic: Determine the target of the Player  (Read 490 times)

0 Members and 1 Guest are viewing this topic.

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Determine the target of the Player
« on: 10 Feb 2003, 12:54:48 »
Hello,

is there a script or variable which returns the actual Target of the Player ?

I have a nice capture script, but i want to capture the guy which the player is aiming at ? But big question who is that guy ? Any ideas ?

Yours
Kuro

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Determine the target of the Player
« Reply #1 on: 15 Feb 2003, 02:05:43 »
Don't know.

You could do it based on the direction in which the player is facing.....

getpos the player
getdir the way he is facing
use some trigonometry (yes there is even a tute on that) to figure out the area of capture
getpos the likely prisoners
check if the prospective prisoner is in the capture zone

*thinks* there must be an easier way ....
Plenty of reviewed ArmA missions for you to play

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Determine the target of the Player
« Reply #2 on: 16 Feb 2003, 15:19:41 »
While you cant get the "target" of the player unit, you can get the direction its looking relative to another unit.

Theres a function in the function library that calculates a units facing relative to another unit.  A facing of 0 indicates the unit it looking directly at another unit.

Thus you could set this up to check for all units and when one of them is 0 it makes they guy surrender.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Determine the target of the Player
« Reply #3 on: 17 Feb 2003, 22:00:10 »
the only problem with using getdir is it returns the direction the units body is facing and not the actual direction the unit is looking at. >:(

So you can use the functions in the library to help with your script, but until BIS gives out a command that returns the direction a unit is looking, and not juts the direction the units body is pointing, it will allways be a bit inaccurate.

 :(
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.