Home   Help Search Login Register  

Author Topic: Simple Firing Script (renamed from 'Automated')  (Read 2333 times)

0 Members and 1 Guest are viewing this topic.

Offline Inkompetent

  • Members
  • *
Simple Firing Script (renamed from 'Automated')
« on: 29 Jul 2009, 19:41:18 »
Automated Firing Script with a (slightly) more reasonable name!

PURPOSE:
INKO_SFS.SQF (Simple Firing Script) is designed for script-controlled fire sequences from one or more units towards the area of a specific target. Either to be used just for fixed or pre-planned fires, or just as cosmetica with anti air batteries firing into the air, etc.

It is to be an all-around script that is as easy as possible to use while being as versatile as possible for the mission-maker, functioning for any kind of fires that the mission designer would want to control through script. Instead of making multiple scripts for different units depending on what and how they fire I have intended this as a one-solution-for-all time-saver.

FEATURES:
The script allows for the mission designer to choose what vehicle(s) are to fire, what the target (or reference point) is, in what radius around that target they should fire, and at what altitude relative to the target they should aim. In addition to that one can choose if the firing sequence should be done just once, multiple times, or infinitely, and what the delay in seconds should be between both each burst shot within a sequence, and between each repetition of the sequence. It is now also possible to decide with which muzzle the unit(s) should fire.

KNOWN LIMITATIONS:
  • At the moment mostly suitable for burst-firing weapons.
  • Very limited burst length.
  • Not suitable for units where you want to mix the muzzle used.

FUTURE
Planned additions are as follows:
  • Make the delay more directly dependant on the weapon's reload speed/rate of fire.
  • Create ability to fire longer salvos with automatic weapons.
  • Dynamic (as much as possible) parameter array, making it more user friendly.
  • Return 'true' when done, so sequences of fires are easier to set up.

VERSIONS:
  • 1.1 Beta (2009-08-12): Added possibilty to use groups as well as units simultanously as parameter. Added choice of muzzle. Added additional variables to decide number of bursts/shots per salvo and the delay in between,
  • 1.0 Beta (2009-07-29): First release

CREDITS:
Written by Inkompetent.  Inspired by SUPR3ME KILL3R's flak.sqs script that was released on the BIS forums.


SCRIPT INSTRUCTIONS
Code: [Select]
/* ==========================================
=    INKOMPETENT'S SIMPLE FIRING SCRIPT     =
=                  1.1 BETA                 =
=============================================

PURPOSE:
The script is designed to let the mission maker control and simulate fire from any unit on the battlefield.
It is mainly designed with AAA fire as that from ZSU-23/4 Shilkas or alike in mind, but can be used for practically any PRIMARY WEAPON in the game. This makes it unsuitable for firing with for example coaxial machineguns on AFVs and tanks, without modifying the script.

INSTALLATION:
Simply copy the script to the wanted mission folder in "My Documents/ArmA2/missions".

USAGE:
The script requires a number of parameters when executed to achieve the desired effect. ALL VARIABLES MUST BE ENTERED!
All you need is one or more units to do the firing, and then either a marker, trigger, object or unit as reference point for the shooting.

Call with:  nul=[[obj/group array],string/obj name,[int,int],bool,[int,int],[int,int,int],int] execVM "inko_sfs.sqf";
nul=[[Firing unit(s) name(s)],"target name"/target name,[radius,altitude],refill?,[bursts per salvo,pause between burst],[repetitions,intervalmin,intervalmax],weapon/muzzle] execVM "inko_sfs.sqf";

Example: nul=[[shilka1,shilka2],"shilkaTarget1",[150,100],true,[3,1],[1,0,0],0] execVM "inko_sfs.sqf";
Above example means shilka1 and shilka2 will shoot at the marker shilkaTarget1 within a 150m radius and at 100m above sea level, regain lost ammunition, fire three bursts with one second between every burst, regain lost ammunition, only do this sequence once, and fire with it's primary muzzle.
Note that target should only have quotation marks around it if it is a marker. If it is an object it should not.
Also note that the main weapon of a vehicle has the index '0'.

If using an endless fire sequence (repetitions=0), make sure to name the script handle something else than "nul", for example fire1=[....] execVM "inko_sfs.sqf". This way you can stop the script when you want to with the 'terminate'-command.

Note that even for a single salvo you must enter a number for intervalmin and intervalmax!


Thanks to SUPR3ME KILL3R for his flak-script, giving me the inspiration to make this.
========================================== */
« Last Edit: 28 Nov 2009, 22:35:47 by Inkompetent »

Offline Mr_Centipede

  • Members
  • *
Re: Automated Firing Script
« Reply #1 on: 30 Jul 2009, 01:52:11 »
Very nice, can be usefull for a pre plan suppresive fire prelude to an assault. Good job  :good:


Offline Inkompetent

  • Members
  • *
Re: Simple Firing Script
« Reply #2 on: 12 Aug 2009, 22:34:19 »
The script has been updated to 1.1!

New features include being able to choose the muzzle to fire, ability to control the number of bursts and the delay between them for the firing sequences, and the possiblity to use both groups and units at the same time as parameter.