Jump to content
Sign in to follow this  
Kristian

Random artillery around units

Recommended Posts

Hello.

Thank you for even bothering to open this thread! :)

As thread title says, I need help in my mission.

idea is very simple, but I just dont know how to accomplish it.

There would be a marker area, where friendly artillery would fire (24/7, nonstop artillery)

about 3-6 hoqizers, endlessly hammering a town.

I guess the town should be marked with marker, and the marker should be the size of firezone. My friend told me its done with the modules, and I remember I asked it here before but I couldn't get the answer, sadly. I looked from OFPEC but for "newbie" (been around since OFP, but havent learned much editor) like me, it isnt that simple.

Any help will be appreciated, and if a moderator decides to close its fine by me.

-Thank you in advance

Share this post


Link to post
Share on other sites

I guess the first question is, do you just need the explosions or are you wanting the actual units sitting at the guns, firing?

Just the explosions are easy, no modules, just some scripting.

Share this post


Link to post
Share on other sites

This will spawn shells out of thin air but is very easy IMO:

You need to put the code in a file in your mission folder named e.g. "arty.sqf".

(should work, but not tested ;) )

private ["_xPos", "_yPos"];
_xPos = (getMarkerPos "target") select 0;
_yPos = (getMarkerPos "target") select 1;

while {true} do {
"ARTY_30Rnd_105mmHE_M119" createVehicle [_xPos + random 50 - random 50, _yPos + random 50 - random 50, 100 + random 20];
sleep (10 + random 6);
};

If you don't understand a command in this, I suggest looking it up in the comref

Put a marker in your mission named target.

You could then call it from the activation field of a trigger:

_nil = [] execVm "arty.sqf";

You'll have to fiddle around with the numbers, though.

Edited by schaefsky

Share this post


Link to post
Share on other sites

Here's my mortar bombardment script: Change the ammo type or interval as neccesary.

arty.sqf

if(!isServer) exitWith{};
private ["_trg", "_round", "_alpha", "_bravo", "_loc", "_delay"];
_trg = trgArty;
_round = "Sh_85_HE";
_alpha = ((triggerArea _trg) select 0);
_bravo = ((triggerArea _trg) select 1);
_loc = getPos _trg;
while {triggerActivated trgArty} do {
_round createVehicle [(_loc select 0) + _alpha - random (_alpha * 2),(_loc select 1) + _bravo - random (_bravo * 2), 1];	
_delay = 40 - random 30;
sleep _delay;
};

Create a trigger and name it trgArty. Set the size of the trigger to the area of bombardment you want.

Set Activation to BLUFOR Present Repeatable (no use in bombarding if nobody is there to witness it)

Set On Act to:

Nul = execVM "arty.sqf";

If you want to watch the bombardment from a distance, without risking being hit:

Set the condition of the first trigger to:

triggerActivated trgView

Create a second larger trigger and and name it trgView.

Set Activation BLUFOR Present repeatable.

Share this post


Link to post
Share on other sites

Gee, cheers guys! Much appreciated. I will try these out asap, and then report how it worked out. Probably pretty sweet ;)

Share this post


Link to post
Share on other sites

I tried both scripts, I tried using both a marker and a trigger, using a trigger only, and finally even tried executing the VM in init.sqf, but I just couldn't get it to work. Did someone else get it to work?

Share this post


Link to post
Share on other sites
I tried both scripts, I tried using both a marker and a trigger, using a trigger only, and finally even tried executing the VM in init.sqf, but I just couldn't get it to work. Did someone else get it to work?

Yep I got tcp's one going, nice and simple tcp thanks!

Did you remember to name the trigger:- trgArty

I forgot this first try then looked at the script and realised this is what was missing with my trial.

Share this post


Link to post
Share on other sites

Works like dream for m! :D

Could someone tell me how to get the arty rounds to be M119 rounds?

I want it so that when 3 spotters are killed, or have fleed, arty stops.

I tried placing the trgArty where I wanted shells.

Then I placed another trigger, with activation on OPFOR, repeadly, and on act I put "Nul = execVM "arty.sqf";" so that when there are enemies alive on spotting area, artillery keeps shooting, but it didnt work. halp? :rolleyes:

Share this post


Link to post
Share on other sites

Kristian, you only need one trigger

Make a trigger, put it on activation by OPFOR if the snipers and spotters are OPFOR, make it repeatedly and set the name field to trgArty.

on activation:

foo = execVM "arty.sqf"

to get M119 you have to look at http://community.bistudio.com/wiki/ArmA_2:_Weapons

You'll see that the ammo classname is Sh_105_HE, so edit tcp's script.. specificly the part saying _round = "Sh_85_HE"; to:

_round = "Sh_105_HE";

Share this post


Link to post
Share on other sites
Kristian, you only need one trigger

Make a trigger, put it on activation by OPFOR if the snipers and spotters are OPFOR, make it repeatedly and set the name field to trgArty.

on activation:

foo = execVM "arty.sqf"

to get M119 you have to look at http://community.bistudio.com/wiki/ArmA_2:_Weapons

You'll see that the ammo classname is Sh_105_HE, so edit tcp's script.. specificly the part saying _round = "Sh_85_HE"; to:

_round = "Sh_105_HE";

Wouldn't that result that snipers/spotters would get bombed?

Share this post


Link to post
Share on other sites
Wouldn't that result that snipers/spotters would get bombed?

Right. I suppose I misunderstood you.

You want the artillery script to stop bombing whatever they are bombing at trgArty when the spotters leave their position in one way or the other..

Then yes, you would need a second trigger, lets call this one for trgSpot and make it activated by the side that the spotters belong to, repeatedly

now inside the arty.sqf file you need to modify the condition that makes the bombing occur, to something like this:

while {triggerActivated trgArty and triggerActivated trgSpot} do {

that should do the cake

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  

×