Home   Help Search Login Register  

Author Topic: Detecting Laser  (Read 982 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Detecting Laser
« on: 20 Sep 2005, 21:37:39 »
Hi all,

Is it possible to detect weither a unit/vehicle has a laser from the Laser Designator directed at it?

Thanks
« Last Edit: 20 Sep 2005, 21:37:52 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Kyle Sarnik

  • Guest
Re:Detecting Laser
« Reply #1 on: 20 Sep 2005, 21:58:27 »
The closest thing to that that I can think of is using nearestobject to find a laser target (if there is one) within range (approx. 50m) and then measure the distance between it and the object/vehicle. Of course the appropriate distance to check for will be different each time depending on which part of the object its pointed at, so be carefull.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Detecting Laser
« Reply #2 on: 20 Sep 2005, 23:38:34 »
This should be just what you are looking for!

Look for the script called "ld_monitor.sqs".

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Kyle Sarnik

  • Guest
Re:Detecting Laser
« Reply #3 on: 20 Sep 2005, 23:47:32 »
This should be just what you are looking for!

Look for the script called "ld_monitor.sqs".

Wadmann

No, that won't really help any more than my suggestion, and using nearestobject is alot more convenient.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Detecting Laser
« Reply #4 on: 21 Sep 2005, 00:27:41 »
There is such thing as a laser target. Make yourself a BlackOp w/ Laser Designator, and group a flying cobra to you. Then fire the Laser Designator, and using the radio menu tell the cobra to target your LD which should be showing up.

Although that doesn't help all that much :P
« Last Edit: 21 Sep 2005, 00:28:07 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

Kyle Sarnik

  • Guest
Re:Detecting Laser
« Reply #5 on: 21 Sep 2005, 00:29:21 »
There is such thing as a laser target. Make yourself a BlackOp w/ Laser Designator, and group a flying cobra to you. Then fire the Laser Designator, and using the radio menu tell the cobra to target your LD which should be showing up.

Although that doesn't help all that much :P

I know that there is such a thing as a laser target, thats not what I meant  :P I meant if there was a laser target currently created in the game close enough to the targetted object/vehicle.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Detecting Laser
« Reply #6 on: 21 Sep 2005, 02:17:49 »
Quote
Suppose that we want to know what object the notional laser is actually painting in the game. To do this we must extend the script above so that it detects the object nearest to the "LaserTarget", and hence also outputs:


The object nearest "LaserTarget" (laser_tgt)

This script is called 'ld_monitor.sqs', and can be downloaded for viewing here.

From the resource that I directed greg 147 towards.

Is this not what he asked for? All he has to do is add a boolean line to determine if the object nearest "LaserTarget" (laser_tgt) = his target to find out if a unit is being painted, correct?

It is just what SK described that he needed, isn't it?

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Detecting Laser
« Reply #7 on: 21 Sep 2005, 04:15:22 »
Ah. My appologies KS.  :)

Lol. Really tired. Need sleep. No wonder Im construing things.  :P
Guess it's bed time.
« Last Edit: 21 Sep 2005, 04:16:26 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 greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Detecting Laser
« Reply #8 on: 21 Sep 2005, 08:48:55 »
Thanks for the replys guys. I think Kyle Sarnik and Wadmann got it right.  ;)
I wanted a trigger to activate when a lasertarget is pointed at an particular object.
I will try the script Wadmann linked.
I havn't used the nearestobjet command before. I've heard of it, but never had a use for it, so don't know how it works  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Detecting Laser
« Reply #9 on: 21 Sep 2005, 13:51:01 »
nearestObject pos

Operand types:
pos: Array

Type of returned value:
Object

Description:
Nearest building of given type to given position or object. pos may be [x,y,z, "type"] or [object, "type"].

Example:
nearestObject [player, "StreetLamp"]

So you would use
Code: [Select]
_target = nearestObject [player, "LaserTarget"]
or something similar.
« Last Edit: 21 Sep 2005, 13:52:59 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 greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Detecting Laser
« Reply #10 on: 21 Sep 2005, 17:55:18 »
@Wadmann
I got the script working, but it doesn't really help me. I tells me what i'm aiming at, but doesn't tell me when I aim at something. It just tells me al the time (unless I'm using it worng  ;) )

I'll try the nearestObject command now.
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Detecting Laser
« Reply #11 on: 21 Sep 2005, 18:51:01 »
OK, how do I use nearestobject in the form of a triggers condition? Or does it have to be used in a script?  :P
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Kyle Sarnik

  • Guest
Re:Detecting Laser
« Reply #12 on: 21 Sep 2005, 21:07:21 »
A trigger might work:

Condition:
Code: [Select]
(nearestobject [Target,"LaserTargetW"]) distance Target < 3
You might have to adjust the number depending on the size of the target object, and also I'm not 100% sure on the laser target classname, but I know there are different classnames for each of the 4 sides, the W means that the unit/vehicle with the laser designator is on West, but don't get confused by the fact that the laser dot object for West is actualy set to East side, so it appears as an enemy. So the side of the target represents the side of the user, not the side that the dot appears on.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Detecting Laser
« Reply #13 on: 21 Sep 2005, 23:56:54 »
or
Condition:
Code: [Select]
(nearestObject [Target,"LaserTargetW"] in thislist)
« Last Edit: 21 Sep 2005, 23:57:15 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 greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Detecting Laser
« Reply #14 on: 22 Sep 2005, 19:59:30 »
Got it working, thanks for the help guys.  ;D
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB