Jump to content
Sign in to follow this  
45killa

Destroying a town by dropping bombs and artillery

Recommended Posts

Ouch, yes, that must be it. Notice how the file says "text document" instead of "sqf document". Your file is actually named:

artillery.sqf.txt

but you can't change it until you do what F2k Sel says. Well, you can but I won't confuse anyone.

This is the first thing I do after any OS reinstall. I can't believe this is the default behavior still in any OS, it should be banned, it causes nothing but problems... :p

Share this post


Link to post
Share on other sites

Hi, im back. Yes, I agree with F2k Sel and CarlGustaffa, you have to save it as .sqf, when you are going to save it as a .sqf you have to select in the Save type As > All Files (*.*) Then press the save button. That should do it. I will post in the morning the GBU script.

Share this post


Link to post
Share on other sites

Thanks alot guys, now the game could find the script.

But the problem is now: Nothing happens, if I move with a soldier into the trigger!??!! There are no bombs... what did I wrong??

Share this post


Link to post
Share on other sites

Do you get any script errors? You should. Never do scripting without showing the mistakes on screen. wickedstigma forgot a certain command to make it work, probably wrote it from memory, then these things happen easily. Or he "forgot" in order to challenge you. Nobody here wants to write scripts for you, only help you getting better at doing it or aid with specific problems.

With that info, I do expect you to figure it out... Pay attention to what the error message actually tries to say. :)

Oh and by the way, I think most of us has been through a period of "nothing works" :p

Share this post


Link to post
Share on other sites
Do you get any script errors? You should. Never do scripting without showing the mistakes on screen. wickedstigma forgot a certain command to make it work, probably wrote it from memory, then these things happen easily. Or he "forgot" in order to challenge you. Nobody here wants to write scripts for you, only help you getting better at doing it or aid with specific problems.

With that info, I do expect you to figure it out... Pay attention to what the error message actually tries to say. :)

Oh and by the way, I think most of us has been through a period of "nothing works" :p

Dude, there is no error. Everything is fine. But there is no artillery effect. So actually I did a mistake or there is something missing and I do not know how to find it out

Share this post


Link to post
Share on other sites

Ok, I don't know why is working but you are right, it doesn't. Really weird thing is that Its a copy paste of a working code. But anyway here is a working code. Just tested it and it works beautifully.

Save this as artillery.sqf:

//Declare Variables and gets data from the array

_ammo      = _this select 0;
_target    = _this select 1;
_delay     = _this select 2;
_height    = _this select 3;
_amount    = _this select 4;
_spread    = _this select 5;
_velocity  = _this select 6;
_x	   = 0;


//Sets target position 

_targetPos = [getMarkerPos _target select 0, getMarkerPos _target select 1, _height];

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

sleep _delay;

// Loops the amount of times stored in _amount

for "_x" from 1 to _amount do 

	{
		//Creates the slected _ammo at the selected _height

		_artilleryStrike = createVehicle [_ammo, _targetPos, [], _spread, "NONE"];

		// Sets direction of the artillery round and velocity

		_artilleryStrike setvectorup [0,9,0.1];

		_artilleryStrike setVelocity [0,0,_velocity];

		//Delays the code for the selected amount of time

		sleep _delay;
	};


And call it with (I mean put it inside the trigger):

nul = ["ARTY_Sh_122_HE","target",2,500,30,50,-1]execVM "artillery.sqf";

Let me know if it works.

---------- Post added at 11:30 AM ---------- Previous post was at 11:22 AM ----------

I almost forgot, you can change the settings as you please by changing the values in the code that goes on your trigger. It is as follows:

nul = ["ammo","target",delay,height,amount of rounds,spread,velocity of the round]execVM "artillery.sqf";

Remember that the ammo and the target must be used with quotes and everything else just with numbers. the velocity has to be a negative value so it can go down instead of going up. If you change the name of the target remember to change it here too. To add an initial delay just change this:

[color="Red"]//Delays the script for the amount of time stored in _delay

sleep _delay;[/color]

to this...

[color="SeaGreen"]//Delays the script for the amount of time stored in _delay

sleep 60; // It will activate in 60 seconds[/color]

If you don't want to wait any time, just remove that code.

Share this post


Link to post
Share on other sites
I know for sure that that is somewhere on this forum. I am not too familiar with the solution though. You could createvehicle shells into the town though. I suppose that is one option.

Man you get props for helping him out. I had to seek out youtube videos demonstrating how to give yourself artillery command in the editor. I love the freedom of the editor but damn is it intimidating.

Share this post


Link to post
Share on other sites
Ok, I don't know why is working but you are right, it doesn't. Really weird thing is that Its a copy paste of a working code. But anyway here is a working code. Just tested it and it works beautifully.

Save this as artillery.sqf:

//Declare Variables and gets data from the array

_ammo      = _this select 0;
_target    = _this select 1;
_delay     = _this select 2;
_height    = _this select 3;
_amount    = _this select 4;
_spread    = _this select 5;
_velocity  = _this select 6;
_x	   = 0;


//Sets target position 

_targetPos = [getMarkerPos _target select 0, getMarkerPos _target select 1, _height];

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

sleep _delay;

// Loops the amount of times stored in _amount

for "_x" from 1 to _amount do 

	{
		//Creates the slected _ammo at the selected _height

		_artilleryStrike = createVehicle [_ammo, _targetPos, [], _spread, "NONE"];

		// Sets direction of the artillery round and velocity

		_artilleryStrike setvectorup [0,9,0.1];

		_artilleryStrike setVelocity [0,0,_velocity];

		//Delays the code for the selected amount of time

		sleep _delay;
	};


And call it with (I mean put it inside the trigger):

nul = ["ARTY_Sh_122_HE","target",2,500,30,50,-1]execVM "artillery.sqf";

Let me know if it works.

---------- Post added at 11:30 AM ---------- Previous post was at 11:22 AM ----------

I almost forgot, you can change the settings as you please by changing the values in the code that goes on your trigger. It is as follows:

nul = ["ammo","target",delay,height,amount of rounds,spread,velocity of the round]execVM "artillery.sqf";

Remember that the ammo and the target must be used with quotes and everything else just with numbers. the velocity has to be a negative value so it can go down instead of going up. If you change the name of the target remember to change it here too. To add an initial delay just change this:

[color="Red"]//Delays the script for the amount of time stored in _delay

sleep _delay;[/color]

to this...

[color="SeaGreen"]//Delays the script for the amount of time stored in _delay

sleep 60; // It will activate in 60 seconds[/color]

If you don't want to wait any time, just remove that code.

Hey thank you verryyy much man!!!!!!!!!!!!!!!!!!!!!!!!!

But do you know how to script that ->

Share this post


Link to post
Share on other sites
Hey thank you verryyy much man!!!!!!!!!!!!!!!!!!!!!!!!!

But do you know how to script that ->

Yes I know how to do it, but thats with the SOM module, not pure scripting unless he made it by script which I doubt. I can show you how to do it, but I can right now since its almost 1 am and I have to get up at 6 am :(:(:(. I will post tomorrow when I get back.

Share this post


Link to post
Share on other sites

There has to be an error in the original script:

_target = "target"; //Sets the name of the target

_strikePos = [_target select 0, _target select 1, _height];

When is _target an array? It isn't. The obvious fix was to to:

_target = getMarkerPos "target"; //Sets the name of the target

Now _target is an array.

Share this post


Link to post
Share on other sites

Hi!What you might want to do,is to make a trigger-zone that the player enters and before hand has placed a gunbattery(check the availble emplacements(bunkers etcr)in the editor.

Edit a trigger(learn to edit trigger in help-file)where the player enters a zone the gunbattery

(if allready in place)fires a set of salvos on (lets say) tanks on the other side of town out of

sight.Then the plane could come and bomb at number of targets out of sight inside the town according to trigger"mustdestroythistarget>insert name here<"untill all targets are destroyde .If more than one plane use the "command-post" option(a blue squere that must be connected by a blue line(hold and dragged)to All units you want to controll(even

the planes parked on the airport(dont forget to place them on the airport or they never show up.)When you command "Artillery Strike"from the menu,the guns automatically fires upon the targets inside the city and the planes will take-off and strike the targets inside the city(after a travelling to the town).;)

You can also do like this:Trigger"Player enter this area "Marker "ONE"or Flag<Name> "One" placed on the map.Place the gunbattery out of the line of

sight behind a hill and tell it to destroy tank "destroy<"tankone";then"tanktwo"> and so on until you have destroyed them all,put the tanks,10 maybe,on the other side of town,at some distance from the town and in a scattered formation.

Use the "Must be destroyed"trigger,HE round salvo,Scattered if using the drop-down meny.This way the rounds will either be fired off automatically

,if player shall enter a zone for attack to begin or a salvo will commence every time the player uses the drop-down meny.:cool:to make it fire at the same time the planes fly,you must make an other trigger<trigger;thistank3directhitbyartillery>and place a tank named whatever

you wish,to make them fire of HE-rounds Behind The Town (just for show),to

make it possible for planes to fly,place the guns To the SIDE of the city to be

able to make room for the planes.:cool:

Share this post


Link to post
Share on other sites
Yes I know how to do it, but thats with the SOM module, not pure scripting unless he made it by script which I doubt. I can show you how to do it, but I can right now since its almost 1 am and I have to get up at 6 am :(:(:(. I will post tomorrow when I get back.

I pity you bro :D

Actually I asked the user and he said:

ke, first read this page

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

On this site, you can find the information to set up an artillery strike

I have uploaded the mission file to rapidshare, you can download it here

http://rapidshare.com/files/403308816/art_movie_script.zip

Your need 4 things:

1 the artillery group/units

2 the artillery module

3 a game logic = target in the city

4 a trigger, beside the artillery units.

Look at the code and names that are used in these things

The most important line of code is located in the trigger onactivation field:

[Art12, 1000] call BIS_ARTY_F_SetDispersion; [group m12, getPosASL a1, ["IMMEDIATE", "HE", 1, 1000]] call BIS_ARTY_F_ExecuteTemplateMission;

I read the page and I do not understand it at all :confused:

@John1: Thank you very much, Iam going to try it out.

Share this post


Link to post
Share on other sites
There has to be an error in the original script:

_target = "target"; //Sets the name of the target

_strikePos = [_target select 0, _target select 1, _height];

When is _target an array? It isn't. The obvious fix was to to:

_target = getMarkerPos "target"; //Sets the name of the target

Now _target is an array.

As you said it is an array. And its actually working. Try it for yourself and you'll see.

Share this post


Link to post
Share on other sites
I pity you bro :D

Actually I asked the user and he said:

ke, first read this page

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

On this site, you can find the information to set up an artillery strike

I have uploaded the mission file to rapidshare, you can download it here

http://rapidshare.com/files/403308816/art_movie_script.zip

Your need 4 things:

1 the artillery group/units

2 the artillery module

3 a game logic = target in the city

4 a trigger, beside the artillery units.

Look at the code and names that are used in these things

The most important line of code is located in the trigger onactivation field:

[Art12, 1000] call BIS_ARTY_F_SetDispersion; [group m12, getPosASL a1, ["IMMEDIATE", "HE", 1, 1000]] call BIS_ARTY_F_ExecuteTemplateMission;

I read the page and I do not understand it at all :confused:

@John1: Thank you very much, Iam going to try it out.

Finally Im back but so freaking exhausted! :(. For what I see on the code he is making an attack 1000 shells with a delay of 1 second. Its pretty easy.

What you don't understand?

Share this post


Link to post
Share on other sites
Finally Im back but so freaking exhausted! :(. For what I see on the code he is making an attack 1000 shells with a delay of 1 second. Its pretty easy.

What you don't understand?

I do not know what I have got to save as a .sqf file

Share this post


Link to post
Share on other sites

You actually dont need a .sqf to do it. Let me explain what he means with these instructions.

1) Create any artillery unit you want. Then add some others of the SAME KIND and group them (F2)

2) Go to the Modules (F7) and add an Artillery Module and call it Battery1

3)This will be a target on top of the city. What I use for targets is a marker or an Invisible Helipad which is in Empty > Objects > H (Invisible) and call it a1

4) Create a trigger (radio or bluefor activated) and put this code inside the On Act. field

[battery1, true] call BIS_ARTY_F_SetShellSpawn; [battery1, 1000] call BIS_ARTY_F_SetDispersion;[battery1, (getPosASL a1), ["IMMEDIATE", "HE", 1, 15]] call BIS_ARTY_F_ExecuteTemplateMission;

5) Enjoy again!

So what does each thing do here?

[color="Orange"]// This will pass spawnMode as true to turn spawn mode on[/color]
[battery1, true] call BIS_ARTY_F_SetShellSpawn;

[color="Orange"]// This will set a dispersion value for the artillery battery passed in the function[/color]
[battery1, 1000] call BIS_ARTY_F_SetDispersion;

[color="Orange"]// This will execute the fire mission on your target, 15 rounds of High Explosives ordnance with a delay of 1 second between each shot[/color]
Battery1, (getPosASL a1), ["IMMEDIATE", "HE", 1, 15]] call BIS_ARTY_F_ExecuteTemplateMission;

I hope both codes can serve your needs. Let me know what happens and if you have any doubt just let me know too.

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  

×