Results 1 to 8 of 8

Thread: how do i get the laser designated target?

  1. #1
    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.

  2. #2
    Private First Class
    Join Date
    Mar 13 2007
    Posts
    21
    Author of the Thread
    no one helps?

  3. #3
    Master Gunnery Sergeant
    Join Date
    Dec 18 2005
    Location
    Adelaide, Australia
    Posts
    1,306
    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.
    [self-promotion]
    OFP:R Island : Rezina
    [/self-promotion]

  4. #4
    Private First Class
    Join Date
    Mar 13 2007
    Posts
    21
    Author of the Thread
    Quote Originally Posted by (fasad @ April 16 2007,09:25)
    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"])

  5. #5
    Master Gunnery Sergeant
    Join Date
    Dec 18 2005
    Location
    Adelaide, Australia
    Posts
    1,306
    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.




  6. #6
    Private First Class
    Join Date
    Mar 13 2007
    Posts
    21
    Author of the Thread
    I've tried "nearObjects", it works well.
    thanks fasad. ***

    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 [B]




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

    & dose it work in MP?
    \"Demo\'s Kratos\" Greek (People to Rule)

    \"What most call \"Democracy\" today is nothing more the a fudel representative Dictatorship which was formed by those in power who wished to keep there power but at the same time apear to be servants of the people for the same reason of keeping power.\"

    VIVLA DIRECT ELECTRONIC DEMOCRACY!

    www.euro-sports.org

  8. #8
    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&#91;&#34;Searching for laser&#34;,&#34;plain down&#34;&#93;
    ~2

    _tpos = position &#40;&#40;position _unit nearObjects &#91;&#34;LaserTarget&#34;, 1200&#93;&#41; select 0&#41;
    _x=_tpos select 0
    _y=_tpos select 1
    _dist = _unit distance _tpos

    _str = &#34;Request strike at&#92;nCoordinate&#58; &#91;&#34;+str&#40;_x&#41;+&#34;,&#34;+str&#40;_y& #41;+&#34;&#93;&#92;nDistance&#58; &#34;+str&#40;_dist&#41;
    titleText&#91;_str,&#34;plain down&#34;&#93;
    ~3
    _bomb = &#34;Bo_GBU12_LGB&#34; createVehicle _tpos

    exit[/QUOTE]
    My streaming Perhaps catch me working on some addons.
    http://www.anrop.se Swedish ArmA community.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •