OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Jaenak on 24 Feb 2004, 00:59:36
-
I took the artillery script from the mission "Underhill" and I like it but I'd like to know if there's anyway of having it shoot sabot shells instead of normal bombs. Here's the script:
; Bombarding
; Run from mission:
; [who, A, B, C, "Name"] exec "Artillery.sqs"
; who - who runs the script (can be anybody)
; A - how many bombs
; B - diameter of "Area bombed"
; C - timout between two bombs
; D - name of the marker, which is in the middle of the "Area bombed"
_pos = getmarkerpos (_this select 4);
_bomb = "Bomb" createVehicle _pos;
_i = 0;
_j = _this select 1;
_k = _this select 2;
_t = _this select 3;
#LOOP
_u = random _k;
_bomb setpos [(_pos select 0) - _k/2 + random _k, (_pos select 1) - _k/2 + random _k]
_bomb setdammage 1;
~(random _t)
_bomb setdammage 0;
~(random _t)
_i = _i+1;
? prijeli : exit
? _i < _j : goto "LOOP"
deleteVehicle _bomb;
It seems to do its job but I'm confused about the sabot shell issue. I've tried changing out bomb and _bomb with heat120 and _heat120 but it just shoots one sabot shell and no more. Anyone have any idea's?
-
Change the line;
_bomb = "Bomb" createVehicle _pos;
To read;
_bomb = "shell120" camcreate _pos
-
You can make it fire whatever you like
_bomb = "Bomb" createVehicle _pos;
Just replace "Bomb" with what you want: check the weapons and ammo listing in the Ed Depot - tutorials - referencese.
-
Thanks, that does fix part "A" but the other problem still occurs. The script fires one lone round somewhere within the barrage area and quits. No barrage, just one solitary round. :-\
-
? prijeli : exit
Perhaps the above is always true ?
-
The script works now. Sa8gecko gave me the idea to try and monkey with the coding. The script now goes like this:
; Bombarding
; Run from mission:
; [who, A, B, C, "Name"] exec "Artillery.sqs"
; who - who runs the script (can be anybody)
; A - how many bombs
; B - diameter of "Area bombed"
; C - timout between two bombs
; D - name of the marker, which is in the middle of the "Area bombed"
_d = getmarkerpos (_this select 4);
_i = 0;
_a = _this select 1;
_b = _this select 2;
_c = _this select 3;
#LOOP
_bomb = "heat120" camcreate _d;
_e = random _b;
_bomb setpos [(_d select 0) - _b/2 + random _b, (_d select 1) - _b/2 + random _b]
_bomb setdammage 1;
~(random _c)
_bomb setdammage 0;
~(random _c)
_i = _i+1;
? _i < _a : goto "LOOP"
deleteVehicle _bomb;
exit