Shpook 10 Posted August 19, 2013 (edited) http://www.whiskeysquad.com/VnYYU5E.jpg (436 kB) Shpook's Carpet Bomb ScriptbyShpook 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 August 19, 2013 by Shpook Share this post Link to post Share on other sites
Tom_48_97 523 Posted August 19, 2013 Looks good (from the video). About your note: to process an array in the middle of processing an array. You meant, exec something inside an array without freezing the array processing (asynchronously)? If yes, take a look here: ​https://community.bistudio.com/wiki/Function Share this post Link to post Share on other sites
Shpook 10 Posted August 19, 2013 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
kylania 568 Posted August 19, 2013 You seem to have missed the link to your release. :) http://www.armaholic.com/page.php?id=22115 Share this post Link to post Share on other sites
mindstorm 8 Posted August 19, 2013 (edited) 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 August 19, 2013 by mindstorm Share this post Link to post Share on other sites
Shpook 10 Posted August 19, 2013 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
schlonz75 1 Posted August 19, 2013 (edited) [...] 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 August 19, 2013 by Schlonz75 close enough... Share this post Link to post Share on other sites
mindstorm 8 Posted August 19, 2013 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 10 Posted August 19, 2013 Updated. 1.1 - Added ability to select helicopter color. Moved explosion processing into function to allow better ground hit detection. Cleaned up code. Shpook's Carpet Bombing Script v1.1 Share this post Link to post Share on other sites
Guest Posted August 19, 2013 New version frontpaged on the Armaholic homepage. Shpook's Carpet Bomb Script [bETA] v1.1 Share this post Link to post Share on other sites
Shpook 10 Posted August 19, 2013 Thanks Foxhound. :) Share this post Link to post Share on other sites
clydefrog 3 Posted August 20, 2013 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
Shpook 10 Posted August 20, 2013 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
Rocky1960 10 Posted December 2, 2013 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