Jump to content
Sign in to follow this  
Terran4999

Bombing Run (without clicking)

Recommended Posts

hello

I know bombing run has been discussed a lot , but I can't find a normal bombing run script without clicking on the map for  target. For those who are familiar with scripting can you tell me please what to delete/add to for this to be a bombing run on a game logic as target

all thanks

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;we deactivate the onmapclick once you clicked or it will create problems

onMapSingleClick {}

player sidechat "Coordinates transmitted, waiting for airstrike"

_pos = _this select 0

; we create a plane at the game logic A10ENTRY location

; high enough so the AI pilot can have time prevent his plane to fall in the sea

; we remove the weapons of the plane as the A10 AI even careless will want to engage with its canon

strikePlane = "A10LGB" camCreate getpos A10ENTRY

strikePlane setPos [(getPos strikePlane select 0),(getPos strikePlane select 1),(getPos strikePlane select 2)+2000]

strikePlane setDir 0

removeallweapons strikePlane

;we create the pilot for the plane

"SoldierWPilot" createunit [getpos player,group player,"Dummy1=this",0]

[Dummy1] join grpnull

Dummy1 moveInDriver strikePlane

Dummy1 doMove _pos

~1

Dummy1 setbehaviour "CARELESS"

~3

Dummy1 sideChat "Airstrike 1 On the way"

@ unitReady Dummy1

Dummy1 sideChat "Bomb away."

;here is a simple bombing run script

_num = 4

_i = 0

#loop

_bomb = "laserGuidedBomb" camCreate [(getPos strikePlane select 0)+((random 10)-5),(getPos strikePlane select 1)+((random 10)-5),(getPos strikePlane select 2)-3]

_bomb setDir (getDir strikePlane)

_bomb setVelocity [(velocity strikePlane select 0)*0.2,(velocity strikePlane select 1)*0.2,(velocity strikePlane select 2)*0.2]

_i = _i + 1

~0.2

? _i < _num : goto "loop"

;once the bombing run is done

;the pilot move back to the game logic A10ENTRY

;it will be deleted there as we don't need it anymore

Dummy1 doMove getpos A10ENTRY

Dummy1 sideChat "Heading back to base."

@ unitReady strikePilot

deleteVehicle strikePlane

deleteVehicle Dummy1

exit

Share this post


Link to post
Share on other sites

So I read through other forums and found that to make the air strike target a game logic I would have to put

Quote[/b] ]Dummy1 doMove (getMarkerPos "target")

instead of

Quote[/b] ]Dummy1 doMove _pos

and name the game logic "target"

this didn't cause any serious problems but the airstrike never came

Share this post


Link to post
Share on other sites

here is an example of a bombing run without onmapclick in which an A10 once you use radio alpha will come and will bomb a game logic location.

Adapt it to your mission conditions instead of using the radio alpha to trigger the bombing run, but don't forget any of the game logic from the mission and do not forget the variables that are set to 0 or 1 in the trigger or in the game logic init line, they are important :

http://files.filefront.com/GLmapcl....fo.html

Share this post


Link to post
Share on other sites

Hi Sanctuary, excuse me for bothering you but I´m interested in this script.

I need a short bombing run over enemy tanks. Radio Alpha activation is good for me, but the example link is broken.

Thanks.

Share this post


Link to post
Share on other sites

Seems like filefront delete even very small files now :/

Anyways, i unfortunately don't have this example mission, but i build another one that i believe to be better, get it there :

http://sharebee.com/34d8f509

Ingame there is a T80 platoon , near you there is a pilot that is CARELESS and WHITE combat mode (so when it will fly it will never try to engage things by itself and ruin the script), press 0-0-1 (Radio Alpha) , it will trigger the script.

The script create an A10 in the sky at the position of the gamelogic somewhere in the southeast and will move the pilot into it.

The script will get the position of the enemy tank leader and will force the A10 to always orientate to this tank leader position, so it will always fly in the required direction, anywhere that tank leader can be.

When the A10 is at a specific distance of the enemy tank leader, it will cease to follow the script forced direction and several bombs will be created in the air, simulating a bombing run (you can use any planes, even a Cessna, there is no need of real bomb to be inside the plane)

If you don't understand some part of it, just ask here.

Edited by Sanctuary

Share this post


Link to post
Share on other sites

Hey Sancturary

Whats with the Sharebee links? I go there and it launches MS Office install, then when I stop that it runs one of thoses net virus/system scanners. I know it's free, but isn't there something else? ;)

Share this post


Link to post
Share on other sites

I don't see any of this, but with firefox+noscript+some extra it is very rare to see any kind of popups and other annoyances as it eliminates them.

If your browser launch the install of a program automatically when you visit a website, i suggest you to either change to another browser that is more secure (like Opera or Firefox) because it is not normal at all that a browser launch an installer without asking you first.

sharebee is one of those "mass uploaders" convenient website, it allows you to upload one file and once done they automatically send the file to multiple hosts like megaupload, rapidshare etc... without you having to do anything.

If such website require you to download anything, of course you just refuse.

The websites that sharebee sent my file to are :

http://www.megaupload.com/?d=8PE91G1M

http://www.zshare.net/download/6140925731644090/

http://rapidshare.com/files/244874829/bombrun2.Intro.rar.html

http://www.badongo.com/file/15479005

http://depositfiles.com/files/60d4r33xi

Before i used superuploader.net for multiple uploads without having to do it myself with my slow connection, it was even better as it provided even more download mirror but sadly it ceased to provide such neat service.

I only found sharebee as an alternative, the only ones i know out of superuploader and sharebee are :

http://www.gazup.com/

http://uploadbud.com/

http://qooy.com/

http://www.uploadjockey.com/

But i never used any of them.

Next time instead of providing the sharebee link itself i will just copy paste the mirrors links, this way those with insecure browser will not have installer launched without them requesting it.

Edited by Sanctuary

Share this post


Link to post
Share on other sites

The script runs perfect. I made an OPFOR version for testing several russian planes.

For some reason, all the Footmunch planes showed his landing gear down all the time.

The best results was the su22, su25 (retextured version) and su39. However, the last one never ends the run even if I killed all the remaining crew.

Some questions:

1. Is possible to use radio alpha after having served an objective (like destroy a vulcan/shillka or radar installation)?

2. About the trigger, is necessary that I "see" the enemys in order to use radio alpha?

3. The plane will only engage enemy vehicles?

Thanks again!

Share this post


Link to post
Share on other sites
Is possible to use radio alpha after having served an objective (like destroy a vulcan/shillka or radar installation)?

2. About the trigger, is necessary that I "see" the enemys in order to use radio alpha?

3. The plane will only engage enemy vehicles?

Update of the example mission, better script that give a bit of "push" to the starting A10 so you don't have to wait for it too much :

http://www.zshare.net/download/61447111dd4cc8f7/

http://depositfiles.com/files/eg2ayv8so

http://www.megaupload.com/?d=GAYGV7PY

http://rapidshare.com/files/245166287/bombrun3.Intro.rar.html

http://www.badongo.com/file/15493091

And for performance help as you don't need the A10 everytime on the sky, once the bombing run is done and the plane is far, it will delete the A10, put back the bomber pilot to its original location and will enable you to call it again in case a second bombing run on target is needed

1- i modifed the example mission to show you how to do it, on the path of the T80, there is a trigger detecting them moving here, and it only then give you the possibility to call the A10

2- not at all

3- the plane engage nothing, it is the script that create the bombs, all the plane is doing is flying in the direction of the target thanks to the script forced direction detection.

It means you can set whatever target you want in the radio alpha trigger, the syntax is

[nameoftheA10pilot,nameofthetarget,nameofthepilotbase] exec "nameofthescript.sqs"

For some reason, all the Footmunch planes showed his landing gear down all the time.

Some planes use a script for the gear for some reasons, instead of using the OFP gear animation, Footmunch planes must be using such method.

I don't remember what script you need to force such plane to get their gear up unfortunately.

Share this post


Link to post
Share on other sites

3- the plane engage nothing, it is the script that create the bombs, all the plane is doing is flying in the direction of the target thanks to the script forced direction detection.

It means you can set whatever target you want in the radio alpha trigger, the syntax is

[nameoftheA10pilot,nameofthetarget,nameofthepilotbase] exec "nameofthescript.sqs"

I got it. However, in this example the A10 only make the first run (with bombs) and then dissapear.

I can call for the bomb run repeatedly, but is not too accurate like first example (bombrun2).

For the mission purpose, I think example 1 fits better with to only doubt about the radio calling.

One of my goals is to make an anti-fool mission, preventing the call for the bombing run prematurely as I saw too many times in arma missions.

About the first example, I have a couple of questions:

1. What I need to do for porting the script to another island. :( I know, I´m a fool, but I copy/paste the editor elements form desert island to malden and put de bomb.sqs inside the new mission folder but even so the plane falls like a rock at the point of entering.

2. Can I place the pilot in every place?

Share this post


Link to post
Share on other sites
I got it. However, in this example the A10 only make the first run (with bombs) and then dissapear.

I can call for the bomb run repeatedly, but is not too accurate like first example (bombrun2).

For the mission purpose, I think example 1 fits better with to only doubt about the radio calling.

One of my goals is to make an anti-fool mission, preventing the call for the bombing run prematurely as I saw too many times in arma missions.

About the first example, I have a couple of questions:

1. What I need to do for porting the script to another island. :( I know, I´m a fool, but I copy/paste the editor elements form desert island to malden and put de bomb.sqs inside the new mission folder but even so the plane falls like a rock at the point of entering.

I just discovered that indeed on desert island it works nicely, but for some reason on other islands the plane do not try to move when setposed on the sky but fall like a rock with the stupid AI pilot not even trying to launch the reactor.

I made a workaround, get the mission , on Everon this time (so it should work on every island) , there :

http://rapidshare.com/files/245406677/bombrun3.Eden.rar.html

http://www.zshare.net/download/61475063b95b4112/

http://www.badongo.com/file/15504007

http://depositfiles.com/files/y9nbir3lk

http://www.megaupload.com/?d=UUUCTVW3

The important part now when porting the example mission on other island is to make sure the gamelogic "ENTERING" is in an area relatively flat without trees.

Because a part of the workaround is that the A10 this time will spawn and stay for a second or two on the ground, then it will be setposed in the sky.

Seems to work good enough this way.

I got it. However, in this example the A10 only make the first run (with bombs) and then dissapear.

I can call for the bomb run repeatedly, but is not too accurate like first example (bombrun2).

For the mission purpose, I think example 1 fits better with to only doubt about the radio calling.

One of my goals is to make an anti-fool mission, preventing the call for the bombing run prematurely as I saw too many times in arma missions.

I don't really understand what you are trying to do.

But the accuracy of the bombs will depend on :

-the start location

-the speed of the bomber

-the speed or lack of speed of the target

-where is the target, etc..

-the relief of the terrain

Many factors.. that can make the bombing run more or less precise.

You can then adjust the speed of the bomb fall, so they fall quicker, or not, move quicker ahead or not etc... by modifying this line of the script

_bomb setVelocity [(velocity _bomber select 0)*0.4,(velocity _bomber select 1)*0.4,(velocity _bomber select 2)*2]

the first and second multiplier are for the speed X/Y of the bomb according to the direction of the plane, the third multiplier is for the Z (the speed of falling).

Higher multipliers and the X, Y or Z speed will increase.

If Z speed increase the bombs will fall quicker, if X and Y increase the bombs will fly for longer time.

instead of

(velocity _bomber select 2)*2

you can put a number like 3 by example, as you don't really need the velocity of the Z axis of the bomber. so you would have

_bomb setVelocity [(velocity _bomber select 0)*0.4,(velocity _bomber select 1)*0.4,3]

This should help you to make the precision better or worse according to the location of the target in your mission

To prevent the player to have access to more bombing run, in the script just remove

BRAVAILABLE = 1
1 setRadioMsg "Call bombing run"

at the end of it and there will be only 1 bombing run available.

2. Can I place the pilot in every place?

Yes anywhere, just put him out of potential danger, as a dead pilot will not fly the bomber when called ;)

Edited by Sanctuary

Share this post


Link to post
Share on other sites

I tested this new example, but I still think that the first example (bombrun2) works better.

In bombrun2, the A10 behavior is more logical, first makes the drop bomb, after that makes another attack with AG missiles, another with rockets and the last one with the cannon.

When all the tanks are destroyed, the A10 left the place.

The only thing that bothers my is that I need the radio alpha action available under some circumstances, not at the beggining of the mission.

Sorry, but between my bad english and my lack of scripting skills It´s a little hard to understend how to make the changes myself.:o

Share this post


Link to post
Share on other sites

No bombrun2 does not work better because it will create the same problem as you observed : on most island for some reason half of the time the A10 will just fall on the ground the AI will refuse to automatically fly.

So use the fixed version of bombrun3.

Because it is easy with bombrun3 to prevent the current " The A10 making only 1 bombing run and disappear ".

Open the bomb.sqs and scroll down to the end.

Remove :

~20
_pilo setpos getpos _basepilo
deletevehicle _bomber

BRAVAILABLE = 1
1 setRadioMsg "Call bombing run"
exit

And instead add

~1
_bomber addweapon "MaverickLauncher"
_bomber setbehaviour "COMBAT"
_bomber setcombatmode "RED"

exit

This way once it has done the bombing run, the A10 will continue to attack with all it has what it is detecting.

Now you have no reason to not use bombrun3, the script will work everytime, something bombrun2 can't do.

And with bombrun3 you will be able to prevent the usage of the radio call in the beginning but only when you want it, by having after your objective is reached a trigger launching :

BRAVAILABLE=1; 1 setRadioMsg "Call bombing run"

Just remember to have

BRAVAILABLE=0

either in the init.sqs of your mission or in the init line of a soldier.

Share this post


Link to post
Share on other sites

i don't know if you guys ever heard of mediafire but im sure it would help you out alot.

Share this post


Link to post
Share on other sites

Sanctuary, now all works perfectly (probably because this time I understood your instructions:o).

Thanks.

Share this post


Link to post
Share on other sites

Don't hesitate to ask for precision if you don't understand some part of what i say, i am not an english speaker myself, so my english may not always be understandable.

Share this post


Link to post
Share on other sites

Ok.

Only one question:

Why do you set the distance view in soldier´s init line?

I have believed thats depend of my OFP video options settings....

Share this post


Link to post
Share on other sites

That's something i totally forgot to remove, it was done for testing the script with various view distance. Easier than having to go to the video options each time.

You can remove the setviewdistance very safely.

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  

×