LZ clearing with napalm bombs

  • 3 Replies
  • 847 Views
LZ clearing with napalm bombs
« on: February 28, 2017, 08:00:38 PM »
Hey guys! I made a small script that allows you to clear LZs with 500lb and 750lb napalm bombs. This is primarily geared towards Zeus curated MP coop play, and I haven't tested it in SP.

create a functions.sqf and put this inside
Code: [Select]
/*******************************************
to use this you must put
#include "functions.sqf";
in your mission init.sqf

You also have to either place

this addEventHandler ["fired", {_this spawn fnc_Track_Napalm}];
in the init of preplaced vehicles that you want to be able to clear trees with napalm
or
this addEventHandler ["CuratorObjectPlaced", {_this remoteExec ["fnc_Zeus_AddNapalm",0];}];
in the init line of the gamemaster module. This method allows all zeus spawned vehicles with napalm bombs to clear trees.
********************************************/
fnc_Zeus_AddNapalm =
{
_napalmLauncher = ["Uns_NapalmLauncher_500","Uns_NapalmLauncher_750"];
_vicWeapons = weapons (_this select 1);
{
if ((_x) in _napalmLauncher ) then {_this select 1 addEventHandler ["fired", {_this spawn fnc_Track_Napalm}];} else {};
}
foreach _vicWeapons;
};

fnc_Track_Napalm =
{
_pos = [];
_bomb= _this select 6;
_napalmBomb = ["Uns_Napalm_500","Uns_Napalm_500_bis","Uns_Napalm_750","Uns_Napalm_750_bis"];
if ((_this select 4) in _napalmBomb) then
{
while {not (isnull _bomb)} do { _pos = getposASL _bomb; sleep .01;};
sleep 6;
[_pos] remoteExecCall ["fnc_Napalm_Burn",2];
};
};

fnc_Napalm_Burn =
{
_pos = _this select 0;
_size = 24; //size of area cleared by napalm

{_x hideObjectGlobal true;} foreach (nearestTerrainObjects [_pos,["TREE", "SMALL TREE", "BUSH"],_size, false, true]);
};

and follow the instructions in the comment block.
« Last Edit: February 28, 2017, 08:32:46 PM by ShinyThings »

Re: LZ clearing with napalm bombs
« Reply #1 on: March 03, 2017, 04:54:11 AM »
Hiya Shiny,
   Very studly. I've been dinkin' with mission making the past couple of days. I finally gave up with mine and
decided to add some stuff to a great one called " Da Krong Insurgency".
  Part of that was adding an earplug script I found in another mission. But then I had to make
a "stringtable.xml" file to go along with it. 8 attempts later, the script worked. It's voodoo and
beyond my ken!

Best, Odd

Re: LZ clearing with napalm bombs
« Reply #2 on: March 09, 2017, 10:50:55 AM »
looks good, we may build this into the mod thanks

Re: LZ clearing with napalm bombs
« Reply #3 on: March 09, 2017, 05:29:21 PM »
That would be awesome Eggbeast, and thanks for the praise Oddball, that's about where I was with scripting 6 months ago.