Jump to content
Sign in to follow this  
Shpook

Shpook's Carpet Bombing Script[A3BETA]

Recommended Posts



http://www.whiskeysquad.com/VnYYU5E.jpg (436 kB)

Shpook's Carpet Bomb Script

by

Shpook

Description:

This is a small script I wrote to carpet bomb an area. It was written to be used with the CH-49 Mohawk, but it could probably be used with any helicopter.

Features:

Bombs. As many as you want. Each bomb has a 15m area of effect.

Download:

Shpook's Carpet Bombing Script v1.1

Installation:

Copy the \scripts folder into your mission folder.

Included files:

scripts\carpetBomb.sqf

scripts\carpetDrop.sqf

Usage:

Place this in the init section of the Mohawk:

nul = [this] execVM "scripts\carpetbomb.sqf";

You can also customize color, bomb count, and drop rate. The format is:

nul = [this, color, bombCount, dropRate] execVM "scripts\carpetbomb.sqf";

Textures are:

0 = Gray

1 = Black

2 = Default

So if you wanted a black Mohawk, to drop 30 bombs, with a 0.2 second delay between each bomb, this is how:

nul = [this, 1, 30, 0.2] execVM "scripts\carpetbomb.sqf";

To use the bombs, make sure you are the co-pilot, and select "Release Bombs" from the action menu.



Change log:

1.1 - Added ability to select helicopter color.

Moved explosion processing into function to allow better ground hit detection.

Cleaned up code.

1.0: Initial release.

Credits & Thanks:

Thanks to my fellow outfit mates of Test Outfit. Inspiration also came from Karel Moricky's destroyCity function.

Armaholic

Edited by Shpook

Share this post


Link to post
Share on other sites

Thanks. I always thought of functions as a means to easily reuse code blocks, so I honestly never bothered reading the functions section of the wiki. Thanks for the link, it really helps.

Share this post


Link to post
Share on other sites

Nice script.

I got some questions:

1. Why do you edit the texture of the vehicle?

2. How did you change the vehicle damage indicator position and the mission hint position?

Then one thing. If your _delay is set to high it's possible the bomb won't explode because the delay is making sure the "explosion" part isn't hit yust yet. You might wanna spawn it before sleeping between explosions.

Edited by mindstorm

Share this post


Link to post
Share on other sites
You seem to have missed the link to your release. :)

Oh man....that's what I get for trying to get stuff done before bed. Thanks. :)

Nice script.

I got some questions:

1. Why do you edit the texture of the vehicle?

2. How did you change the vehicle damage indicator position and the mission hint position?

Then one thing. If your _delay is set to high it's possible the bomb won't explode because the delay is making sure the "explosion" part isn't hit yust yet. You might wanna spawn it before sleeping between explosions.

Thanks mindstorm. I changed the texture to differentiate it from standard transports. I actually meant to make that optional, which I'll do in the next update.

You can also move the HUD elements around by going to Configure - Game - Layouts. I really enjoy having the radar in view, makes detecting lock-ons much easier.

And I honestly never had that problem. I tested up to a 5 second delay. It looks really odd, and takes forever. The bombs just sit on the ground, and ragdoll around from the other explosions. But the explosion sequence is kicked off by waiting until the first bomb dropped is within 2 meters of the ground, so it should start the sequence no matter what the delay is. (Although, now that I think about it, I may change that. If the first bomb lands on a taller structure, it may never initiate the sequence.)

Share this post


Link to post
Share on other sites

[...]

2. How did you change the vehicle damage indicator position and the mission hint position?

[...]

You can now edit/configure your HUD in the main menu. you can see it here, right at the beginning:

I think the menu is now called "Configure" instead of "Options".

Edit: Ninja'd :P

Edited by Schlonz75
close enough...

Share this post


Link to post
Share on other sites

Thx for the answers both of you.

To bad, i was hoping I could edit those menu's from my script (I know it's possible from mod) so I could change some layout parts in a mission.

Share this post


Link to post
Share on other sites

Shpook, how do you find out what settings to use with setobjecttexture to recolour the vehicles properly like you've done with the mohawk, is it just trial and error? Is it possible to use the same type of thing with altered values on other vehicles? I tried on another helicopter and a hunter but it made everything on the vehicle the same colour unlike on yours where wheels, rotors etc. are kept the correct colours.

Share this post


Link to post
Share on other sites

So, the code I use is:

_helo setObjectTexture [0,'#(argb,8,8,3)color(0.2,0.21,0.2,0.8)'];
_helo setObjectTexture [1,'#(argb,8,8,3)color(0.2,0.21,0.2,0.8)'];
_helo setObjectTexture [2,'#(argb,8,8,3)color(0.2,0.21,0.2,0.8)'];

You see how the only difference is the 0, 1, and 2? Those are different texture selections, which generally refer to different sections of the vehicle. If you search the config.bin of the vehicle for "hiddenselection", you'll see what textures, and how many they use. It takes a bit of probing to find the files.

Anyways, on the Mohawk, it works changing all three exterior textures because of how BI designed the textures. On other vehicles, it doesn't work so well, and procedural textures look odd. You may have to actually copy the texture and edit it in Photoshop to get good-looking results. It all depends on the vehicle and texture design.

In short, a little bit of file probing, a little bit or trial and error. :)

Share this post


Link to post
Share on other sites

Hi Mate, great script works really well. Just one question, how do you get the script to re-run after the helicopter has re-spawned? I use a re-spawn script in the init along with the carpet bomb script. But, the helicopter re-spawnes without the script being re-run. I have posted the script below. Any help in this matter would be greatly appreciated.

Thanks in advance

Rocky

veh = [this, 60, 1800, 0, FALSE, FALSE] execVM "vehicle.sqf"; nul = [this, 1, 30, 0.2] execVM "scripts\carpetbomb.sqf";

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  

×