Skip to content

Commit c502453

Browse files
committed
Added documentation, small refactors and fixed formatting to arty.sqf
1 parent 5ab3428 commit c502453

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

source/support/arty.sqf

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
// _null = [position,salvos, radius, interval between salvos, shots per salvo] execVM "support\arty.sqf"
2-
// R_60mm_HE / R_80mm_HE /Bo_Air_LGB(no sounds)/ Grenade / Bo_Mk82
3-
//
1+
/*
2+
File: arty.sqf
43
5-
_position = _this select 0;
6-
_salvos = _this select 1;
7-
_radius = _this select 2;
8-
_interval = _this select 3;
9-
_rps = _this select 4;
10-
_supportype = _this select 5; // 1 = arty, 2 = mortar, 3 = jdam
11-
_cost = _this select 6;
12-
_ammotype = _this select 7;
4+
Author: Kibot
135
6+
Description:
7+
Deploy a number of salvos of a
148
9+
Parameter(s):
10+
_this select 0 - POSITION - Center position of 'Strike Area'
11+
_this select 1 - NUMBER - Number of ordinance salvos
12+
_this select 2 - NUMBER - Radius of 'Strike Area'
13+
_this select 3 - NUMBER - Interval between salvos (in seconds)
14+
_this select 4 - NUMBER - Number of ordinance rounds per salvo
15+
_this select 5 - NUMBER - Support type enumerator (1 - Artillery, 2 - Mortar Shell, 3 - JDAM)
16+
_this select 6 - NUMBER - Cost of Support type
17+
_this select 7 - STRING - Ammo type used for salvos
1518
16-
_rpsinit = _rps;
17-
18-
hint "Coordinates received, splash in 30 seconds";
19-
//hint format["Position: %1\nSalvos:%2\nRadius:%3\nInterval:%4\nRPS:%5\nSupport type:%6\nCost:%7\nAmmo type:%8", _position, _salvos, _radius, _interval, _rps,_supportype,_cost,_ammotype];
19+
Returns:
20+
- Nil -
21+
*/
2022

23+
params["_position", "_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammotype"];
2124

25+
_rpsinit = _rps;
2226

27+
hint "Coordinates received, splash in 30 seconds";
2328

2429
commandpointsblu1 = commandpointsblu1 - _cost;
2530
publicVariable "commandpointsblu1";
@@ -28,17 +33,15 @@ sleep 30;
2833

2934
// NUMBER OF SALVOS
3035
while {_salvos>0} do {
31-
_rps = _rpsinit; // reset number of remaining rounds for next salvo
32-
33-
34-
while {_rps>0} do { // FIRE SALVO
35-
_bomb= _ammotype createVehicle [(_position select 0)+(random _radius)-(random _radius), (_position select 1)+(random _radius)-(random _radius), (_position select 2)]; //spawn shells
36-
sleep ((random 20)/10);
37-
_rps = _rps-1 // REMOVE 1 ROUND TO SALVO
38-
};
39-
40-
_salvos = _salvos-1; // remove 1 salvo to counter
41-
sleep _interval;
36+
_rps = _rpsinit; // Reset number of rounds for next salvo
37+
while {_rps>0} do {
38+
_bomb = _ammotype createVehicle [(_position select 0)+(random _radius)-(random _radius), (_position select 1)+(random _radius)-(random _radius), (_position select 2)];
39+
sleep ((random 20)/10);
40+
_rps = _rps - 1;
41+
};
42+
43+
_salvos = _salvos-1; // remove 1 salvo to counter
44+
sleep _interval;
4245
};
4346

4447
hint "Ordinance complete";

0 commit comments

Comments
 (0)