Jump to content
Sign in to follow this  
marcusm_uk

Simple artillery script

Recommended Posts

I know about Murrays more fancy script but I would like one of the oldfashioned simple ones. I tried some of the ofpec ones but they dont seem very compatible with ArmA.

I think the main reason seems to be the changes in strings.

Thank you in advance.

Marcus

Share this post


Link to post
Share on other sites

This is the one i would like to adapt to arma. It seems the new way of handling strings is the problem?

// Generic Artilly Script

;//

;// by Fishion

;//

;//

;// I made this because of the enourmous number of Artillery Scripts

;// which use Men to place bombs, Vehicles to create the illusion of

;// an explosion, or simple in a different from to shoot smoke shells

;//

;// to replace all those Artillery Simulating Scripts this should be sufficient

;// to the needs of most people (evan has sound)

;//

;// big advantage is you can actually choose the ordanace (if you wish you

;// shoot Boats or Car by the Artillery, eventhough this is simply stupid)

;//

;// ©Aug 2001

;//

;//********************

;//**** Parameters ****

;//********************

;// Target Coordinates:

;// This should be an array containing min 2 numbers (X and Y Coord) but a normal

;// GetPos should do (no select 0 etc.)

_coords = _this select 0

;// Type of Ordanance (String Value), look at Weapons and Ammo or Objects Tree for types

_ord = "M_Javelin_AT"

;// Height (numeric) at which Ordanance should be Spawned (150 or so works fine)

_height = _this select 1

;// Number of volley fired by the Artillery

_VolleyNr = _this select 2

;// Number of Shots in each Volley

_ShotNr = _this select 3

;// Time between Volleys

_vTime = _this select 4

;// Time Variation between Volley (the Max deviation from _vtime)

_vTimeVar = _this select 5

;// Time Variation within each Volley

;// (Note: For Time on Target Barrages (ToT) put a 0 here)

_vTimeVol = _this select 6

;// Maximum Distance for shots off the Aimed Point

_radius = _this select 7

_ik = 0

;//************************

;//**** Parameters END ****

;//************************

;//Put in Radiochatter here!

;//**************************

;//**** Main Arty Script ****

;//**************************

_nr = 0

#loop

if (_nr > _Volleynr) then {goto "ende"}

_volnr = 0

;//inner loop (within volley)

#volley

hint "test1"

;// Increment Counter

_volnr = _volnr + 1

;// create ordonance

_ordin = createVehicle [_ord,[(_coords select 0) + (random _radius) - (_radius / 2), (_coords select 1) + (random _radius) - (_radius / 2), _height],[],0,"FLY"]

;// wait a random time for the next Shot

;// (note _vTimeVol is the total time a Barrage needs to land, thus devided by the number

;// of shots)

;// wait and avaoid errormessage

if (_shotnr == 0) then {goto "avoid"}

~(Random(_vTimeVol / _Shotnr))

_ordin setDamage 1

deleteVehicle _ordin

{goto "endrnd"}

#avoid

~0.1

#endrnd

if (_volnr <= _Shotnr) then {goto "volley"}

;//innerloop end

;// Increase Counter

_nr = _nr + 1

~(_vtime + (Random _vTimeVar ))

{goto "loop"}

#ende

;//Put in Radiochatter here!

Share this post


Link to post
Share on other sites

Here you guys. A simple artillery support script.

Works well but I would have prefered to use while loops, i just cant get sleep to work properly for some reason.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;Based on Johan Gustafssons script

_Centre = _this select 0

_area = _this select 1

_freq = _this select 2

_rounds = _this select 3

_ActorPos = _Centre

_oldx = _ActorPos select 0

_oldy = _ActorPos select 1

_oldz = _ActorPos select 2

_CentrePos = _Centre;

_cx = _CentrePos select 0

_cy = _CentrePos select 1

_areaX2 = _area * 2

#update

_ammo = "BO_GBU12_LGB" CreateVehicle _ActorPos

~_freq

_Actor SetDammage 0

_rounds = _rounds - 1

_ammo SetPos [_cx + Random(_areaX2) - _area,_cy + Random(_areaX2) - _area, 0]

~0.1

_ammo SetDammage 1

~0.1

deleteVehicle _ammo

? (_rounds > 0 ) : goto "update"

end;

Marcus

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×