Jump to content
Sign in to follow this  
Bejmo

Please help loosing the will to live need very simple arty script

Recommended Posts

Hi all i am trying to find a very simple arty script and its doing my head in. All i want to do is have arty rain down on a town on a trigger set to how many opfor are left in the area and then stop after a minit or so so that opfor reinforcements can move in. I dont want the player to have any controll over this as it is cover for opfor.

Sorry if it has been covered before but i have spent the last two nights looking for something (and found many many many scripts/tutorials) but what i have found either just dosnt work or is all to involved with FO and targeting and such. It cant be this hard im sure but i just dont have the time to delve into scripting and such to a level where i can either write or even just understand the stuff.

I un pbo'd one of the i44 maps (parras i think) and played around with their script trying to understand it, it works but it wont stop and when i change even the smallest thing i just bugger it up.

:(

Thanks in advance to anyone who can help : )

Share this post


Link to post
Share on other sites

Well if you are looking for something simple, and though this has been covered many many times before and is avaliable on the wiki, this maybe what you are looking for.

http://community.bistudio.com/wiki/Artillery_Module

there are 2 ways, one using the SOM modules which is simple but requires the player to do something, or you can go straight for the main artillery module.

The artillery module can be a little more difficult however, the one example is

[_myBattery, _targetPos, _heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;

and what it doesn't specify is that using _ doesn't seem to be any good in SP (so don't bother) and 'myBattery' refers to the artillery module name.

so as long as you follow the instructions and diagram you should be fine. the command i have just used is what calls the artillery and you can insert it into a trigger that has a condition for 'OPFOR' - not present

OR

you could use !(alive unitname) in the trigger condition

OR

you could search the forums on how to collectivilly group units together as a number say 40 and then use a condition check such as if < 23 units. but that is just a theory and I don't know specifically how to check for a certain amount of units but i'm well sure others do if they would like to chip in, or you can search.

Share this post


Link to post
Share on other sites

Thanks for the reply Borg :) i have looked at the BI page and just couldn't get it to work.

i have done this

in editor i have placed 3 m252 mortars grouped then synched the lead to an artilery module with the name arty i then placed a heli pad and named it targetpos then placed a trigger with radio alpha for test purposes (i have allready got the trigger on number of op left sorted) then in the triger i have put

heTemplate = ["IMMEDIATE", "HE", 0, 15];

targetPos = getPosASL targetUnit;

[arty, targetPos, heTemplate] call BIS_ARTY_F_ExecuteTemplateMission; [artyLogic, true] call BIS_ARTY_F_SetShellSpawn;

Taken from the bi arty page

ok so in game on alpha trigger the mortars turn to allmost face the target then the lead fires one round almost straight up then the other two turn to odd directions and fire but they do fire and all seems well but nothing lands. I have tried moveing the target further away for eg i have the target at on end of the runway on utes and the mortars at the other they fire but nothing lands i have moved them closer and again no good and i have put the target and mortars at opposite ends N/W of the island and still no joy.

Ps: as for the bi arty page it says a lot of good stuff but it dosnt realy help scripting noobs like me because its hard to know how many of the provided snippets you need to use and where exactly they go. Like is there an order they need to go in or is it better to use them in a script or in the editor.

Anyway thak you and im sure i will get it working eventualu :p

Share this post


Link to post
Share on other sites

Erm i did post an update on the situation but its not here. Are we haveing to wait for aproval or something :(

Argh man this sucks ok here we go again

thanks borg for the reply i have looked at the bi page before but none of it seems to work for me. I have allready got all the triger stuff worked out but its the arty stuff im haveing trouble with. I dont know if my other reply will show up but some of it may have changed so here again is what i have done.

in editor

placed arty module named it mybattery put down 3 us mortars (maned) all grouped then synched the group leader to the arty module then placed a trigger set to alpha radio for test purposes

then in the on act i have

heTemplate = ["IMMEDIATE", "HE", 0, 15];

targetPos = getPosASL targetUnit;

[myBattery, targetPos, heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;

also i have a heli pad as marker and it is called targetpos

So on the alpha trigger the mortars rotate to an angle that is not in line with the target and start to fire. The lead mortar fires straight up LOL. However nothing lands anywhere as far as i can tell. I have tried varying the distance eg using utes map target is at one end of the runway and mortars at the other but mothing ever lands :(

Edited by Bejmo

Share this post


Link to post
Share on other sites

Try this:

// Create a invisible H, name it h1 and place it over the town you want to destroy
// Create a trigger with with On Act: null = [h1] execVM "artillery.sqf";


private ["_bomb","_ammo","_position","_pos","_target"];

_target = _this select 0;

_pos = getPos _target;
_ammo = "ARTY_Sh_82_HE";

for "_i" from 1 to (50) do
{
   _position = [(_pos select 0) + ((random 150)+(random -150)), (_pos select 1) + ((random 150)+(random -150)), 0];  
   _bomb = _ammo createVehicle [(_position select 0), (_position select 1), 100];
   _bomb setVelocity [0, 0, -10];
   sleep random 3;
};

Change the 50 if you want more or less explosions.

Change the 150 to increase or decrease the radius.

Share this post


Link to post
Share on other sites

Wiggum thank you so much it is exactly what i was after. Well now it works i can finish the mission it will go in and i now have something i can study and learn from (that works) :)

I will put a nice big credit with it for you :) :) :)

PS what script editor do you use. I have seen some scripts in coulou likr this. Should i try using something like it, does it make it easier?

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  

×