Jump to content
Sign in to follow this  
wickedstigma

Simple Artillery Strike v1.0

Recommended Posts

I found out that freezing it had an odd effect that messes up the vectoring anyway.

If you spawn the bomb 100 meters for eg and then vector it you can use the attachto command to attach it to an object.

_bomb attachto [player,[0,2,2]] pust the bomb 2 meters in front and 2 meters high so you can see it.The problem is that doing this will make it always appear to be flat.

However if you place the attachto command before the vectoring it works and you can check the orientation of the vector.

So it is of some use for things that fly too fast to see properly.

Warning the bomb is still live so don't knock it.

.

Ok I get it. The thing is I made a thread about IEDs,it was one of my first things to do in Arma 2, and I just wanted to spawn a gbu or something like it was laying down on the place I placed the IED, no one came out with the right answer, and the IED graphics package thats running around in other pages the links are broken. Now with the vectorUp and with the attach code I might be able to finally spawn some sort of missile to simulate the IED, I am currently using a grave as a marker of an IED which works great.

---------- Post added at 11:57 AM ---------- Previous post was at 11:54 AM ----------

I do believe that bombs such as the GBU-12 and Mk82 naturally don't fall straight down - they start accelerating in the X and Z axis as well.

Artillery Shells don't do that for me, and using the vector below I can turn any object directly up-side-down. Tanks, shells, people, boats, anything.

this setVectorUp [0.001, 0.001, -1];

Lol, yeah I know, I just used the Mk48 to see if the code is working since I didnt know how to stop in mid air the mortar rounds, and the Mk48 is pretty easy to spot when you spawn it due to its size and slow movement.

---------- Post added at 12:00 PM ---------- Previous post was at 11:57 AM ----------

It doesn't matter which way they are initially pointing.

From the biki:

player setVectorUp [0,1,0]
  If the player is facing 0 degrees (north), then this will do NOTHING.
  If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left.

This is the code I used for putting the missile/mortar/anything down:

_artilleryStrike setvectorup [0,9,0.1];

Share this post


Link to post
Share on other sites

EDIT: Scratched old code. Your's does the trick. :D

If it's falling at an angle when you're using that code, maybe artillery shells just fall sideways in-game? :S

The thing is I made a thread about IEDs,it was one of my first things to do in Arma 2, and I just wanted to spawn a gbu or something like it was laying down on the place I placed the IED, no one came out with the right answer, and the IED graphics package thats running around in other pages the links are broken.

You could just spawn a GBU12 and use the code "bomb enableSimulation false;". That'll make it so that the GBU is, well invincible, so it'll just lay on the ground. You could just make some code that'd create a trigger around the bomb so that when you entered a certain radius it will enable the simulation again, therefore making the bomb explode.

_pos = //Whatever you want the position of the IED to be
ied = "Bo_GBU12_LGB" createVehicle _pos;
ied enableSimulation false;

_trg = createTrigger ["EmptyDetector", _pos];
_trg setTriggerArea [5, 5, 0, false];
_trg setTriggerActivation ["ANY", "PRESENT", false];
_trg setTriggerStatements ["this", "ied enableSimulation true", "deleteVehicle this"];

You can add markers or anything else you'd want to that too...

Edited by Fuzzy Bandit
Adding IED code...

Share this post


Link to post
Share on other sites

I use this:

[_obj, -90, 0] call bis_fnc_setpitchbank;

It requires the functions module be on the map and initialised.

Share this post


Link to post
Share on other sites
I use this:

[_obj, -90, 0] call bis_fnc_setpitchbank;

It requires the functions module be on the map and initialised.

I always forget that even when I've used it loads of times to control aircraft.

I did find a setvectorup a while back that was very interesting though, what it did was when applied to a truck it made it jump into the air while flipping over several times as if it had been hit by a bomb. I did however delete the mission and haven't been able to find it again. :mad:

Share this post


Link to post
Share on other sites
I use this:

[_obj, -90, 0] call bis_fnc_setpitchbank;

It requires the functions module be on the map and initialised.

By initialized you mean...? On characters Init?

Share this post


Link to post
Share on other sites
By initialized you mean...? On characters Init?

It's been given a chance to wake up. Make sure you've got the functions module on the map and pop this at the start of your init.sqf:

waituntil {!isnil "bis_fnc_init"};
waituntil {!isnil "BIS_MPF_InitDone"};

That'll make it load before it loads the rest of the mission.

Share this post


Link to post
Share on other sites
It's been given a chance to wake up. Make sure you've got the functions module on the map and pop this at the start of your init.sqf:

waituntil {!isnil "bis_fnc_init"};
waituntil {!isnil "BIS_MPF_InitDone"};

That'll make it load before it loads the rest of the mission.

Thanks man. Is this doable with other modules?

---------- Post added at 01:51 AM ---------- Previous post was at 01:18 AM ----------

I wanted to let all of you know that Im almost done with the next version of the script. It will have:

  1. Preset Values
  2. Patterns [Tight, Scattered, Suppressive, Harass, Spread, Rolling Barrage]
  3. Restructured variable designation
  4. Area Marker on the fire zone
  5. Fire Direction Center (FDC) chatter

Share this post


Link to post
Share on other sites

I believe there are similar for the other modules, but I don't know what they are. I tend to not run any commands on them until a few seconds into the mission to make sure they're running...

Share this post


Link to post
Share on other sites
Hi everyone! This is a Simple Artillery Strike script I made to help myself and some others to have basic idea of a custom artillery strike, or just to add a simple artillery script to your missions.

This script is preset do the following:

Fire: D30 122mm HE

Place: artilleryTarget Marker

Delay: 5 seconds between each round

Height: 500 meters

Amount: 10

Spread: 50 meters

How to use it?

1) Create a marker called artilleryTarget and place it anywhere on the map

2) Make a radio activated trigger and write the following code in the On Act. box:

hint "Left click on map to send coordinates"; onMapSingleClick """artilleryTarget"" setMarkerPos _pos; 

[""ARTY_Sh_122_HE"",""artilleryTarget"",5,500,10,50]execVM ""artillery.sqf""; onMapSingleClick """";";

3)Copy the following code to notepad and save it as artillery.sqf

/*
 ------------------------------|
 Simple Artillery Strike v1.1  |
 ------------------------------|
 By:wickedStigma               |
 ------------------------------|
 June 9, 2010                  |
 ------------------------------|
 Special Thanks to: ST_Dux	|
 ------------------------------|
*/

//Link: http://forums.bistudio.com/showthread.php?p=1646466

//INTRUCTIONS:
//Write the following code on a radio activated trigger
//hint "Left click on map to send coordinates"; onMapSingleClick """artilleryTarget"" setMarkerPos _pos; 

[""ARTY_Sh_122_HE"",""artilleryTarget"",5,500,10,50]execVM ""artillery.sqf""; onMapSingleClick """";";


//Script Start

//Declare Variables and gets data from the array

_ammo      = _this select 0;
_bombsite1 = _this select 1;
_delay     = _this select 2;
_height    = _this select 3;
_amount    = _this select 4;
_spread    = _this select 5;
_y         = 0;

//Delays the script for the amount of time stored in _delay

sleep _delay;

// Loops the amount of times stored in _amount

for [{_x = 0}, {_x <= _amount}, {_x = _x + 1}] 

do 

{
	//Creates the slected ARTY_Sh_122_HE at 300 meters
	_artilleryStrike = _ammo createVehicle [(getMarkerPos _bombsite1 select 0) + (_y - 10),( getMarkerPos _bombsite1 select 1) + 

(_y - 			10), _height];

	//Creates a ramndom number from 0 up to the value assigned to _spread
	_y = round(random _spread);

	//Delays the code for the selected amount of time
	sleep _delay;
};



4) Enjoy! :yay:

----------------------------------------------------------------------------------------

IMPORTANT!

You can change different things in the code to suite your needs. To do this just change the values on the array before the execVM.

[""ammo"",""target"",delay,height,amount,spread] execVM

Feel free to ask any question and if someone knows how to handle variables through the OnMapSingleClick, please PM me. I just want to be able to put an array of the settings of your artillery, (ammo, height, number of rounds, etc.), through the activation trigger.

I hate to bump such an old thread but this is the only script I can find that fits what I'm trying to do. The problem is though whenever I try to use it arma2OA.rpt gives me the following error:

Error in expression <gor\artillery.sqf"

[""ARTY_Sh_122_HE"",""artilleryTarget"",5,5>

Error position: <ARTY_Sh_122_HE"",""artilleryTarget"",5,5>

Error Missing ]

I copied the script exactly from the OP's post, and there's no missing bracket, so I can't figure out what's wrong :S

Share this post


Link to post
Share on other sites

try removing these two lines from the script

//hint "Left click on map to send coordinates"; onMapSingleClick """artilleryTarget"" setMarkerPos _pos; 
[""ARTY_Sh_122_HE"",""artilleryTarget"",5,500,10,50]execVM ""artillery.sqf""; onMapSingleClick """";";

or make it all one line which is how it should be.

//hint "Left click on map to send coordinates"; onMapSingleClick """artilleryTarget"" setMarkerPos _pos; [""ARTY_Sh_122_HE"",""artilleryTarget"",5,500,10,50]execVM ""artillery.sqf""; onMapSingleClick """";";

Edited by F2k Sel

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  

×