Home   Help Search Login Register  

Author Topic: Bullets hitting the ground  (Read 971 times)

0 Members and 1 Guest are viewing this topic.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Bullets hitting the ground
« on: 27 May 2006, 08:20:30 »
Ive wondered about this for a while, is it possible to make a script which creates a bullets which hits the ground? so that you dont have to have some AI doing it with a gun, Im asking because I wanted to make a mission which had a greater atmosphere with bullets hitting the ground all over :)
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Bullets hitting the ground
« Reply #1 on: 27 May 2006, 08:26:02 »
Code: [Select]
; minigun.sqs
; Syntax:
; [marker object,time in seconds,radius in metres,rate of fire in rounds per min] Exec "minigun.sqs"

; notes
; bullets 'fired' at 30 degree angle to maximise chance of hitting something,
; point of aim is offset from target object to compensate.
; _radius = random _strikeradius - linear distribution
; _radius = _strikeradius * (random 1)^2 - concentrates fire on point of aim
; _radius = _strikeradius * sqrt (random 1) - even spread across area



_markerobj = _this Select 0
_firetime = _this Select 1
_strikeradius = _this Select 2
_rateoffire = _this Select 3

_strikex = GetPos _markerobj Select 0
_strikey = (GetPos _markerobj Select 1) - 6
_delay = 60 / _rateoffire

_stoptime = time + _firetime


#fire
; POI
_angle = random 360
; _radius = random _strikeradius
; swap with either to taste:
; _radius = _strikeradius * (random 1)^2
 _radius = _strikeradius * sqrt (random 1)


_strike = "Bullet12_7W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
; _strike = "Bullet7_6W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
_strike SetVelocity [0,500,-300]
~_delay
?(time > _stoptime): exit
Goto "fire"

exit

James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re: Bullets hitting the ground
« Reply #2 on: 27 May 2006, 11:03:30 »
Thanks I'll give it a go and see if I can get anywhere with it :D

thanks alot it works perfectly
« Last Edit: 27 May 2006, 11:57:47 by Ding »
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Bullets hitting the ground
« Reply #3 on: 27 May 2006, 11:29:40 »
I usually bump the rounds per minute up to about 100 000.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."