Home   Help Search Login Register  

Author Topic: "LaserTarget" Getting that dot.  (Read 1349 times)

0 Members and 1 Guest are viewing this topic.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
"LaserTarget" Getting that dot.
« on: 06 Sep 2002, 18:09:09 »
Im working on a laser scripty do-daa thingy.  Right now I just want to capture the dot and use it to mark a position.

I have a trigger, named "DetectLaser".  The condition being;

"LaserTarget" CountType list detectlaser > 0

From what I understand "LaserTarget" is the name of the dot, and I can get the trigger to activate with the above condition.  But I cant get its position and use a Getpos with the dot.

What I want to do is just have a trigger that detects when the dot is active, and then get the position of the dot to use with a getpos.

Any ideas?
« Last Edit: 06 Sep 2002, 18:31:42 by [icarus_uk] »

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:"LaserTarget" Getting that dot.
« Reply #1 on: 06 Sep 2002, 21:39:42 »
I just sent off an email, but I'll say something here more briefly, and probably clearly:
yeah, you can fire a trigger that way, but you still need to find the dot.  That should take a script, but you might be able to do something fancy to avoid a script. Try this in the "on activation" field:

LT = "LaserTarget"; P1 = "%1"; ex = " = _x";"LT + Format [P1, LT CountType [_X] + ex ForEach [_x]" Foreach list detectlaser

After that, the variable LaserTarget1 should correspond to what you seek.
Ugh. I think I blew a cortex.
« Last Edit: 06 Sep 2002, 21:52:00 by Dinger »
Dinger/Cfit

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:"LaserTarget" Getting that dot.
« Reply #2 on: 07 Sep 2002, 03:26:59 »
I get an :Error, Generic Expression In Expression, at

LT = "LaserTarget"; P1 = "%1"; ex = " = _x";"LT + Format [P1, LT CountType [_X] + ex ForEach |#| [_x]" Foreach list detectlaser

that part there.  I would try and fix it myself if I knew what the heck that line meant.

[Edit]:  Ok, you say that it cant be done in a script.  Lets do that.  All just need to know, how to call it, what activates it, and the name of the object I can use to use my SetPos, Getpos commands.  Right now Im just experimenting, I want to move an object (a jeep) to the position of the laser dot.
« Last Edit: 07 Sep 2002, 03:32:01 by [icarus_uk] »

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:"LaserTarget" Getting that dot.
« Reply #3 on: 07 Sep 2002, 05:11:15 »
For some reason, this bracket won't appear.
LT = "LaserTarget"; P1 = "%1"; ex = " = _x";"LT + Format [P1, LT CountType [_X]] + ex ForEach [_x]" Foreach list detectlaser
Dang, I don't understand it.  It's not appearing. Let's try again:
Code: [Select]
LT = "LaserTarget"; P1 = "%1"; ex = " = _x";"LT + Format [P1, LT CountType [_X]] + ex ForEach [_x]" Foreach list detectlaser
I'll test it in a second.

Confirmed: believe or not, it actually works!  LaserTarget1 corresponds to the position of the laser target int he world.  Add in a boolean variable on activation/deactivation, and make sure the trigger covers the whole map, and you're done.


Of course, it can be done in a script. Just install a 1500-m radius trigger called detectlaser, copy switchmode.sqs and initlld.sqs to your mission directory, and run initlld.sqs
when laserinitialized is TRUE, then the laser designator dot exists in the real world, and you can get its loc using a gepos on LaserTarget

Still, this one line trigger is so darn cool, you don't want to do it any other way.  Any solution that works in one line, and uses metavariables has gotta kick butt.

« Last Edit: 07 Sep 2002, 05:15:53 by Dinger »
Dinger/Cfit

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:"LaserTarget" Getting that dot.
« Reply #4 on: 07 Sep 2002, 13:18:32 »
Woohoo!!  My jeep moved to the right place.  Excellent, excellent.  Now I can make my airstrike script for my mission.