OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?
-
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:
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:
this addeventhandler ["Fired",{ deletevehicle nearestObject[(_this select 0),(_this select 4)] }]
in the init field
-
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".
-
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.
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?