OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Piraneous on 28 Mar 2003, 03:24:05

Title: Laser designation...
Post by: Piraneous 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?
Title: Re:Laser designation...
Post by: snYpir 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
Title: Re:Laser designation...
Post by: Rubble_Maker 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".
Title: Re:Laser designation...
Post by: snYpir 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?