Home   Help Search Login Register  

Author Topic: Making a single bullet appear  (Read 1342 times)

0 Members and 1 Guest are viewing this topic.

Offline OFP_f3d3

  • Former Staff
  • ****
  • Fraud is the ready minister of injustice.
Making a single bullet appear
« on: 24 Jan 2011, 15:15:58 »
Nothing in the world is as certain as death.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Making a single bullet appear
« Reply #1 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.

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: Making a single bullet appear
« Reply #2 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.
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Walter_E_Kurtz

  • Guest
Re: Making a single bullet appear
« Reply #3 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]