Home   Help Search Login Register  

Author Topic: Targeting  (Read 1012 times)

0 Members and 1 Guest are viewing this topic.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Targeting
« on: 08 Feb 2004, 02:43:29 »
Anyone have any ideas for how to create a script that returns a value when an object has been targeted?

I want to make a mission where the player is out to assainate a high ranking Kremlin offical visiting the front lines. When the player targets the offical, it activates a trigger.

Anyone have any ideas???

Cheers :cheers:
:gunman:Tyger:gunman:
« Last Edit: 08 Feb 2004, 02:44:03 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Targeting
« Reply #1 on: 08 Feb 2004, 11:43:47 »
You could fake it with a knowsAbout command.      

Condition:   player knowsAbout target > 1.5
Activation:   as you like

syntax not guaranteed.
Plenty of reviewed ArmA missions for you to play

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Targeting
« Reply #2 on: 08 Feb 2004, 15:02:48 »
syntax prob. maccy ,  because the game engine don't know exactly WHEN the player
has detected a certain unit - the best way to beat this bug is to assign a grouped trooper
to the player, and when the AI moron in yer group detects the enemy, the trigger can fire.


 :-* later

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Targeting
« Reply #3 on: 08 Feb 2004, 15:14:10 »
Hmm...

sounds like thats not nessarily workable.  :(
unfourtunatly, that means ill have 2 rework my mission
it was a nice attempt 2 help

(No sweat, ive done it three times or so now, due to scripting errors...) :P

Cheers :cheers:

Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Targeting
« Reply #4 on: 08 Feb 2004, 17:43:43 »
syntax prob. maccy ,  because the game engine don't know exactly WHEN the player
has detected a certain unit - the best way to beat this bug is to assign a grouped trooper
to the player, and when the AI moron in yer group detects the enemy, the trigger can fire.
What bug? I've had the player knowsAbout working just fine...
Once you 'reveal' a target by right clicking your mouse (or what you have bind) the players knowsAbout value is risen, and it works the same way the AIs knowsAbout works...
Longer distance lowers the knowsAbout and vice versa...
I think it was something like 1.05 or 1.5 that is the limit before the player/AI reports a contact via radio though...

So the game engine knows exactly the same time player knows, IF he tells that to the engine, as does the AI... (the AI kinda presses an invisible 'reveal' button...)

So if a trigger is conditioned player knowsAbout target >= 1 it will be activated once the player 'reveals' the target (via the right click or something...)

I'm currently making a mission in which I have this kinda thing succesfully working...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Targeting
« Reply #5 on: 09 Feb 2004, 01:42:32 »
r u just saying create a trigger with this in the cond field:

player knowsAbout myTarget >=1

and in the activation field:

blah blah blah

if so, then this is a lot easier than i thought...

"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Targeting
« Reply #6 on: 09 Feb 2004, 12:23:02 »
It's definitely worth a try.    You may have to play with the number a bit, maybe its 1, or 1.5.    Use a hint format command to investigate that.

hint format ["player knowsabout myTarget = %1", player knowsAbout myTarget]
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Targeting
« Reply #7 on: 09 Feb 2004, 17:55:40 »
r u just saying create a trigger with this in the cond field:

player knowsAbout myTarget >=1

and in the activation field:

blah blah blah

if so, then this is a lot easier than i thought...
Yup... That works fine... In OFP almost everything is lots'a easier than it sounds...  ;)

I think when a player is in question you probably could use > 0 as well...  ???

Oh, and the value I was talking about (the 'magic value') is actually 0.105...  :-[ and has absolutely nothing to do with this current issue  ;D...
Check the on-line comref for knowsAbout, Toadlife and Pals have some exellent info there...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Targeting
« Reply #8 on: 09 Feb 2004, 21:40:09 »
excellent!

cheers all :cheers:

Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Targeting
« Reply #9 on: 12 Feb 2004, 09:45:17 »
I have made a script which checks where are you aiming. (using some sinus and cosinus).

Do you want to give it a try ?

Greetings Kuro

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Targeting
« Reply #10 on: 12 Feb 2004, 22:46:59 »
Quote
I have made a script which checks where are you aiming. (using some sinus and cosinus).

Do you want to give it a try ?

Greetings Kuro


Now does that script indicate elevation, or just which direction the unit is facing?
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Targeting
« Reply #11 on: 13 Feb 2004, 04:12:26 »
No evaluation, because i have found no way to determine the angle which a player aims.

sa8gecko

  • Guest
Re:Targeting
« Reply #12 on: 13 Feb 2004, 20:53:49 »
Quote
No evaluation, because i have found no way to determine the angle which a player aims.

But if the player or AI fires a weapon you can get it. Is there some way
to do that without actually firing a weapon ?

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Targeting
« Reply #13 on: 14 Feb 2004, 11:22:54 »
If you know where he is aiming and what unit he knows about you can tell which unit his target is. By checking the height distance between player & target and the distance you can calculate the elevation.

sa8gecko

  • Guest
Re:Targeting
« Reply #14 on: 14 Feb 2004, 12:56:23 »
Quote
If you know where he is aiming and what unit he knows about you can tell which unit his target is. By checking the height distance between player & target and the distance you can calculate the elevation.
Yes, this is true. The problem is to know where he's aiming, especially
if he's in a turret. If I am right getdir returns the direction where is
pointed the nose of the vehicle, or can getdir returns the direction
of the gunner too (i.e. : getdir gunner vehicle player) ?
If knowsabout goes up to a certain value when the unit fires a shot
at his intended target, then this can lead to an interesting application:
giving the unit an eventhandler "fired", you could guess his target.
Then suppose the unit is a gunner of a car: if you replace the shell
with a beatiful missile, you could have a car launching a missile.
For guidance purpose you could use SEFE's script. I did a crappy
jeep firing SAMS, AI could engage too, but I used the method
to catch the shell and then go all along the shell's trajectory to
search for a suitable target, having found one I passed this to
SEFE's script.
But I think I'm gone a little off-topic so I stop here.