OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: OFP_f3d3 on 24 Jan 2011, 15:15:58

Title: Making a single bullet appear
Post by: OFP_f3d3 on 24 Jan 2011, 15:15:58
Hi, i´m making a mission where a president is killed, the problem is that i need something or someone to kill him exactly in the moment i want. Then i thought that maybe i could make a bullet appear at his position so it kills him, now the deal is, HOW TO DO IT???? ??? ??? :dunno: :dunno:

P.D: I HAVE ALREADY TRIED TO PUT A SNIPER AT A LONG DISTANCE BUT HE DOESN´T FIRE AND SOMETIMES THEY MISS SO I TOUGHT OF THIS.
Title: Re: Making a single bullet appear
Post by: savedbygrace on 24 Jan 2011, 15:29:44
The beauty of Hollywood is not limited to the big screen.
Simply set the damage of the President to 1 and he'll drop instantly. You then play a distant shot to symbolize a muzzle blast. No one will see the sniper before he strikes anyways and this will give you complete control over when the kill occurs.
Title: Re: Making a single bullet appear
Post by: RKurtzDmitriyev on 29 Jan 2011, 23:49:03
For what it's worth, it may be possible to "catch" a bullet using a fired eventhandler after a shooter is forced to fire (using the fire command), then use setPos and setVelocity to send the bullet on a perfect trajectory toward the target.

Code: [Select]
;call this as a .sqf FUNCTION in a fired eventhandler from a sniper

_bullet = nearestObject [_this select 0, _this select 4];

_bullet setpos location;
_bullet setVelocity [blah, blah, blah];

One will have to use trigonometry and other higher math (or lots of trial and error) to determine correct values for location and blah blah blah, however.

SBG's suggestion is probably the way to go. :D

PS. Congratulations on making missions depot staff.
Title: Re: Making a single bullet appear
Post by: Walter_E_Kurtz on 05 Feb 2011, 23:34:06
The issue with using setDammage 1 is that all body parts take on their wounded texture, which isn't the (Hollywood) calling card of a masterful assassin.

You could try RKurtz's enhanced sniper method. It would look great in slo-mo with views of the sniper firing.

My suggestion would be to spawn a bullet and hit the target with it. The following should give a puff of blood on impact whereupon the victim falls dead, but I wouldn't rely 100% on it - check half a second later that the target is dead and, if not, then use setDammage on him:

A very simple scenario: the target is on the ground, facing South and is named patsy. The script is as follows
Code: [Select]
_bullet = "BulletSniper" camCreate [ (getPos patsy select 0), (getPos patsy select 1) - 1 , 1.2 ]
_bullet setVelocity [ 0 , 200 , 0]