Jump to content
Sign in to follow this  
RaymondLu

how do i get the laser designated target?

Recommended Posts

I want to use the object that's targeted by laser designator

in the script. how to script?

since the AV8 can tab onto the target, there must be an object returned.

what i want to do is.

target somthing with laser designator,then call for artillery fire on it.

Share this post


Link to post
Share on other sites

nearestObject [player,"laserTarget"]

when pointing the active laser designator at my toes returns:

"490da698# 5219: lasertgt.p3d"

It's an invisible object created where ever the LOS of the designator intersects another object. You'll need to figure out a way of referring to this object, since nearestObject only works over ~50m.

Share this post


Link to post
Share on other sites
nearestObject [player,"laserTarget"]

when pointing the active laser designator at my toes returns:

"490da698# 5219: lasertgt.p3d"

It's an invisible object created where ever the LOS of the designator intersects another object. You'll need to figure out a way of referring to this object, since nearestObject only works over ~50m.

can i use the script below to get the targetted coordinate?

_pos1=position ( nearestObject[player,"laserTarget"])

Share this post


Link to post
Share on other sites

that will work so long as the laser designator is pointing at an object that is less than 50 meters from the user (making nearestObject pretty useless for this purpose).

Another method to reference the laser designator target object would be to place an appropriate side activated trigger over the expected area of use, and check the each of the objects found in thisList is typeOf "laserTargetW" or "laserTargetE". A laserTargetW object is created by a West/Blufor designator and is on side east (so west will target it).

A better method may be the nearObject command. It seems to be very efficient given the thousands of objects it must check.

getPos player nearObjects ["laserTargetW",5000]

returns an array of laser designator targets within 5000m of the player.

Share this post


Link to post
Share on other sites

I've tried "nearObjects", it works well.

thanks fasad.  biggrin_o.gif

here's my script:

;laser.sqs

_unit = _this select 0

#LOOP1

_tpos = position ((position _unit nearObjects ["LaserTarget", 300]) select 0)

_x=_tpos select 0

_y=_tpos select 1

_tmp="HeliEmpty" createVehicle _tpos

_dist = _unit distance _tmp

_str = "Coordinate:["+str(_x)+","+str(_y)+"]\nDistance:"+str(_dist)

titleText[_str,"plain down"]

~3

"Sh_122_HE" createVehicle _tpos

goto "LOOP1"

exit

the arty fire would never stop biggrin_o.gif


Share this post


Link to post
Share on other sites

hi could you explain this in more detail please for the less technicaly minded please?

& dose it work in MP?

Share this post


Link to post
Share on other sites

thanks, exactly what I was looking for..

But i "improved" it some, got use of the dummy target. It doesn't loop and so on..

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;laser.sqs

_unit = _this select 0

titleText["Searching for laser","plain down"]

~2

_tpos = position ((position _unit nearObjects ["LaserTarget", 1200]) select 0)

_x=_tpos select 0

_y=_tpos select 1

_dist = _unit distance _tpos

_str = "Request strike at\nCoordinate: ["+str(_x)+","+str(_y)+"]\nDistance: "+str(_dist)

titleText[_str,"plain down"]

~3

_bomb = "Bo_GBU12_LGB" createVehicle _tpos

exit

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×