Home
Intel Depot
Editors Depot
Missions Depot
Addons Depot
Forum
Home
Help
Search
Login
Register
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
Determine the target of the Player
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: Determine the target of the Player (Read 490 times)
0 Members and 1 Guest are viewing this topic.
Kuro
Former Staff
2./FschJgBtl 251 Green Devils
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
Logged
macguba
Former Staff
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 ....
Logged
Plenty of
reviewed ArmA missions
for you to play
icarus_uk
Members
LiarLiarPants Inflame True
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.
Logged
toadlife
OFPEC Old Skool
Former Staff
Official OFP Editing Center Toad
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.
Logged
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer."
--
Cancer Omega
.
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
Determine the target of the Player
Top of page