Home   Help Search Login Register  

Author Topic: laser designator dot position  (Read 956 times)

0 Members and 1 Guest are viewing this topic.

gadolinite

  • Guest
laser designator dot position
« on: 29 Jun 2003, 04:58:58 »
how do you get the computer to return the position of the laser designator.  I read the tute, but there is so much garble in the scripts I get confused on reading the code.  So in that case I will build my own from the ground up.

Komuna

  • Guest
Re:laser designator dot position
« Reply #1 on: 29 Jun 2003, 18:53:09 »
I believe the tut you read was made by snYpir, right? I'm sorry, but i can only see one solution: study that script. Check for 'getpos', 'position' and '_x' or '_y' variables and you might be lucky. It's not hard anyway, have a litle patience and you'll see how funny can be to check a script... ::)

gadolinite

  • Guest
Re:laser designator dot position
« Reply #2 on: 30 Jun 2003, 22:12:43 »
All I need is a simple example line of code that just returns the position itself.  This is what I am unable to find in that script.  Once someone can put this up, I will incorperate the fancy stuff.

deaddog

  • Guest
Re:laser designator dot position
« Reply #3 on: 01 Jul 2003, 00:36:00 »
ok, put this in your init.sqs file:

lt=[0,0]
laser=false;

now,
place a repeating trigger that covers the whole map.
activation:
  anybody

condition:
  this and "LaserTarget" CountType ThisList > 0

on activation:
  {lt set ["LaserTarget" CountType [_x], _x]} foreach thislist; laser=true

on de-activation:
  laser=false

When the laser is on and hitting something, then "laser" will be true.  The laser position will be stored at lt[1].  Use this to get the x and y position.

?laser:target_x=(getpos (lt select 1)) select 0;target_y=(getpos (lt select 1)) select 1

This assumes you have one laser dot.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:laser designator dot position
« Reply #4 on: 26 Jul 2003, 00:11:10 »
The reason nobody has replied to you is that you haven't replied to deaddog.   He's given you a nice script, for which you haven't thanked him.    Nor did you thank Komuna.   You haven't told us anything about what happened when you tried the script.   What do you mean "it doesn't work"?    Be more specific.    What are you trying to achieve?   What did you do?     What happens?    How do you know it isn't working?

Before we help you (which we do as a favour, nobody is obliged to help you so no more comments about a lack of patience, please) you have to help yourself.   I suggest you start by improving your attitude.

/bollocking


I've had a quick look at the tute and I found this

Quote
the global variable 'laser_pos' will contain the position of where the notional laser is hitting the ground, at any point in time.

which answers your question.      You don't have to understand the code to use it.  ;)

Edit:   if you're not sure how to use snYpir's script read the tute again, concentrating on the text and not worrying too much about the code.   If you're still stuck, ask again here.
« Last Edit: 26 Jul 2003, 00:16:08 by macguba »
Plenty of reviewed ArmA missions for you to play

gadolinite

  • Guest
Re:laser designator dot position
« Reply #5 on: 26 Jul 2003, 06:24:04 »
I did figure out the laser script and that global variable.  

What I am doing is modifying his script to camcreate a laser guided bomb at the dot position.

I have been somewhat sucessful, but one problem, when I call radio alpha to camcreate the bomb and the laser designator is off, I get an error.

To get around the problem, I need some code of some kind to return to the computer whether the designator is on.

The next step is to only let radio alpha appear on the screen when the laser designator is on, which will do away with all those syntax screems.  

here is my job so far (see attached)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:laser designator dot position
« Reply #6 on: 26 Jul 2003, 10:10:29 »
WTF?     Don't you even read the answers people are kind enough to give you?    You've just posted a question which is answered earlier in the thread.    Thanks deaddog!


now,
place a repeating trigger that covers the whole map.
activation:
  anybody

condition:
  this and "LaserTarget" CountType ThisList > 0

on activation:
  {lt set ["LaserTarget" CountType [_x], _x]} foreach thislist; laser=true

on de-activation:
  laser=false

When the laser is on and hitting something, then "laser" will be true.  The laser position will be stored at lt[1].  Use this to get the x and y position.

Plenty of reviewed ArmA missions for you to play