Jump to content
Sign in to follow this  
bigshotking

Enemy Artillery firing on a town

Recommended Posts

Hello all, I was wondering if there are ways to make enemy artillery begin firing on a town, or a fixed position when a trigger is activated. I've looked by using the search function on the forums here, but didn't find anything the meets my criteria (Or I'm blind).

Any help on this is greatly appreciated!

Thanks in advance,

Bigshot

P.S. Oh I'm not talking about virtual artillery, I want to destroy the artillery pieces in order to stop the firing on the position! Thanks!

Share this post


Link to post
Share on other sites

G'day bigshotking,

I have a solution for you! It involves a bit of scripting though - but I'm pretty sure this is what your looking for:

(1) Call this file "Arty_Fire.sqf"

_targetArray = ["target_1", "target_2", "target_3", "target_4", "target_5", "target_6"];
_artyGunsArray = [Arty1, Arty2, Arty3];


while {(damage Arty1 < 0.4) and ((damage (gunner Arty1) < 1) and (side (gunner Arty1) == east)) or 	(damage Arty2 < 0.4) and ((damage (gunner Arty2) < 1) and (side (gunner Arty2) == east)) or 	  (damage Arty3 < 0.4) and ((damage (gunner Arty3) < 1) and (side (gunner Arty3) == east))} do {

_shots = 0;
	{
		if ((damage _x < 0.4) and ((damage (gunner _x) < 1) and (side (gunner _x) == east))) then {
			_gunner = gunner _x;
			_gunner lookAt [(getpos _gunner select 0), ((getpos _gunner select 1) + 50), 50];
			sleep 1;
			_x fire "D30";
			_shots = _shots + 1;
			sleep 1;
		};
	} forEach _artyGunsArray;

sleep 10;

_x = 0;
while {_x < _shots} do {
	_rndNum = round(random 5);
	_target = _targetArray select _rndNum;
	_explosion = "ARTY_Sh_122_HE" createVehicle (getMarkerPos _target);
	_x = _x + 1;
	sleep 1;
};

sleep 15;

};

(2) Put 3 static Arty on the map and call them, Arty1, Arty2 and Arty3

(3) Put 6 markers on the map called, target_1, target_2... etc.

(4) - IMPORTANT - notice the line that says:

_x fire "D30";

well this is the classname of the weapon. I don't know what static Arty you want to use, I used the D30 from ArmA 2 OA. You can find the weapon class name your looking for here: http://www.armatechsquad.com/ArmA2Class/

Find the static Arty you wish to use, click on it and copy the text next to "Weapon Class(1)". Then place the classname in the code so the line looks like this:

_x fire "weapon classname";

(5) put this line in the onAct field of any trigger you want to start the Arty:

_nil = [] execVM "Arty_Fire.sqf";

(6) enjoy

If there is anything you want to ask me about the code feel free to ask but I probably won't be able to answer until tomorrow afternoon.

Hope this helps,

undercoverbrother

Edited by undercoverbrother

Share this post


Link to post
Share on other sites

Thanks for the great reply, no doubt i am not the only one that wanted a answer to this question!!

Share this post


Link to post
Share on other sites

thank you for the quick reply! And also thanks for the explanation with it! :D

I will try this out when i get home, and let you if there are any problems :D

oh and im using OA too, so the script is setup with D-30 already.

thanks again!

-Bigshot

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  

×