Home   Help Search Login Register  

Author Topic: Laser designation...  (Read 865 times)

0 Members and 1 Guest are viewing this topic.

Piraneous

  • Guest
Laser designation...
« on: 28 Mar 2003, 03:24:05 »
is there any way of getpos-ing a projectile fired by a unit?

either that,  or getpos-ing a laser from a designator?

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Laser designation...
« Reply #1 on: 28 Mar 2003, 11:34:58 »
see the laser designator tute in the ed depot for how to use the laser designator dot.

you can getpos a round, but you have to detect when it was fired using an event handler.

eg, if you did this in the player's init field:

Code: [Select]
this addeventhandler ["Fired",{ the_round = nearestObject[(_this select 0),(_this select 4)] }]
the global variable the_round would equal the round fired by the player. ;)

you can make any vehicle fire blanks by using:

Code: [Select]
this addeventhandler ["Fired",{ deletevehicle nearestObject[(_this select 0),(_this select 4)] }]
in the init field
Bohemia Interactive Simulations

Rubble_Maker

  • Guest
Re:Laser designation...
« Reply #2 on: 29 Mar 2003, 20:58:15 »
I'm pretty sure the "fired" event handler doesn't work with the laser designator; at least it didn't when I tried. Also, the laser ammo isn't a real projectile; it moves to the target instantly, so you'd never catch it with "nearestObject".

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Laser designation...
« Reply #3 on: 29 Mar 2003, 23:38:47 »
I'm pretty sure the "fired" event handler doesn't work with the laser designator; at least it didn't when I tried.

Correct, because it doesn't fire anything.

Quote
Also, the laser ammo isn't a real projectile; it moves to the target instantly, so you'd never catch it with "nearestObject".

Correct, see my laser designator tutorial for information on how to detect the laser dot.

I gave the eventhandler info in response to the question is there any way of getpos-ing a projectile fired by a unit?
Bohemia Interactive Simulations