Home   Help Search Login Register  

Author Topic: Old Flashpoint script  (Read 1183 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Old Flashpoint script
« on: 08 Jan 2009, 00:39:27 »
Can any of you guys figure this out? I want to be able to use this old OFP script in ArmA but when I try it does nothing. I know you have to change the ammo to ArmA ammo but that didn't work either. Where's Macguba when you need him?

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 Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Old Flashpoint script
« Reply #1 on: 08 Jan 2009, 00:51:31 »
camCreate -> createVehicle

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Old Flashpoint script
« Reply #2 on: 08 Jan 2009, 03:49:25 »
Sweet that worked a treat.

Now, I tested this with three enemy groups and a fire time of 60 seconds. After about 10 tries I got an average death rate of about 4 bad guys per minute. How can I get that up? I presume I could change the angle so that the rounds were flying almost horizontally, thus covering more ground before they hit anything.

Unfortunatley I have no Idea what I'm doing and tampering with the script caused some undesirable side effects.

Any ideas on how to increase the body count? Reducing the target area isn't really an option.

EDIT: I decided to just use bigger rounds. I dug up some AC130A literature and found that they had 20mm bofors so using 20mm rounds from ArmA isn't a bad thing.

Here's the next problem.

How do I edit this script to be able to use onmapsingleclick?
« Last Edit: 08 Jan 2009, 21:04:04 by The-Architect »
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 Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: Old Flashpoint script
« Reply #3 on: 09 Jan 2009, 16:37:36 »
Code: [Select]
; minigun.sqs
; Syntax:
; [position from map click,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 = (_this select 0) Select 0
_strikey = ((_this select 0) 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

The map click command would then be:
Code: [Select]
onMapSingleClick "[_pos,myTime,myRadius,myROF] exec 'minigun.sqs'"
where myTime, myRadius, and myROF are the values you wish to insert. _pos is a variable passed by the onMapSingleClick command.

If you wish to disable the map click after it's been executed, use this command instead:
Code: [Select]
onMapSingleClick "[_pos, myTime, myRadius, myROF] exec 'minigun.sqs'; onMapSingleClick ' ';"

[EDIT] That should work - if it doesn't I'll give it a run when I can play in ArmA.
« Last Edit: 09 Jan 2009, 16:41:49 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Old Flashpoint script
« Reply #4 on: 09 Jan 2009, 22:41:19 »
Cool. This is pretty awsome. Here is what I changed to make it ArmA compatible. Thanks to those above. Give it a try.

Code: [Select]
; minigun.sqs
; Syntax: onMapSingleClick "[_pos,myTime,myRadius,myROF] exec 'minigun.sqs'"
; [position from map click,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 = (_this select 0) Select 0
_strikey = ((_this select 0) 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 = "B_30mm_HE" createvehicle [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
; _strike = "B_30mm_HE" createvehicle [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
_strike SetVelocity [0,500,-300]
~_delay
?(time > _stoptime): exit
Goto "fire"

exit

Now, wouldn't it be cool if it were a fully operational script with added chatter to get fully immersive? How would I have it so that when the map was clicked, a radio message would pop up giving the grid square I'd just clicked on? and then another message confirming the grid square click? Sorry to pick your brains.
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."