Jump to content

Recommended Posts

This script enables shotguns to destroy small vegetation like ferns, bushes, thin palm trees and sugar cane.  This adds an exciting dimension to CQB in dense jungle or cane fields.

You can see this script in action in my new mission Last Tango in Tanoa: Razing Cane.  You can support my scripting efforts by subscribing on steam and giving this mission a thumbs up!  Give it a try, its fun! 

 

"Bush Cutter"...waiting for a smart-ass remark from someone on that.  You know who you are.

Last Tango in Tanoa: Razing Cane promo video shows this script in action also;

 

Dropbox link to demo mission.  Unzip this folder into your missions directory and open the mission in the Editor.   Then shoot some bushes, and run into cane field and RAZE some CANE!

 

Required Mods:   RHSUSAF, CBA3

 

Shotguns from these mods should also work:   CUP, Massi, KA

Other mod shotguns can be supported by adding in their magazine name into the script.

 

Limitation:  Only works on Tanoa currently, as I have only collected bush names to destroy for Tanoa.  If you want to destroy bushes on some other map, you need to collect the names of those bushes and put them into the _bushArray in the script.  A simple way to collect bush names is put cursorObject in one of your console watch variables.  Then look directly at a bush, and go back to console and you will see the bush .p3d name and can copy it.

 

The Scripts (bush cutter and flying leaf effects):

Spoiler

// JBOY_addBushCutterFiredEH.sqf
// **************************************************************
// This script destroys Tall Sugar Cane, ferns, some small bushes, and the small palm tree if shot by a shotgun.
// It works by adding a Fired eventHandler to a unit.  If that is shooting buckshot from a shotgun, then near plants
// in directly in front of shooter may be destroyed.
//
// Shotgun is detected by the magazine type of the fired weapon.  If the name of the magazine contains "buck" or "pellets",
// then the script considers this a shotgun firing buckshot, and will destroy near plants.
//
// Tested shotgun mods:  RHS, CUP, Massi, and KA shotguns should all work.  Other mod shotguns may work if their buckshot
// magazine names contain the string "buck" or "pellets".  You can modify that IF statement to look for specific magazine types
// for your favorite mod weapon.
//
// The plants in _bushArrary are Tanoa specific.  To make this work for other maps, you need to collect the
// names of bushes on that map and put them into _bushArray.  To find plant names, in-game you can look directly at plants
// and use cursorObject in the console to see name of plant you are loking at.
//
// Sample Calls:
//       {_d=[_x] execvm "JBOY\JBOY_addBushCutterFiredEH.sqf"} foreach units group this; 
//       _dmy = [dude] execvm "JBOY\JBOY_addBushCutterFiredEH.sqf";
// **************************************************************

params["_unit"];
_done = false;
_unit addEventHandler ["Fired", 
{
    params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_gunner"];
	//hint str ["fired",_this];

	_bushArray = ["b_sugarcane_mature_row_f.p3d","b_calochlaena_f.p3d","t_cyathea_f.p3d","b_cycas_f.p3d","b_leucaena_f.p3d","b_cestrum_f.p3d",
	              "b_colored_red_f.p3d","b_gardenia_f.p3d","b_gardenia_dec_01_f.p3d","b_colored_yellow_f.p3d","b_gardenia_dec_02_f.p3d"];
	// If magazine type of fired weapon contains string "buck" or "pellet" then this is a shotgun, so we look for close plants in front of shooter to destroy
    if ( toLower(str _magazine) find  "buck" >= 0 or toLower(str _magazine) find  "pellet" >= 0) then
    {
        { 
            if (getModelInfo _x select 0 in _bushArray) then 
            {
			if (damage _x < 1) then {nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";};
                _x setdamage 1;
            }
        } foreach nearestTerrainObjects [_unit modelToWorld [0,1.5,0], [], 1];  
 
		{ 
            if (getModelInfo _x select 0 in _bushArray) then 
            {
                if (damage _x < 1) then {nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";};
                _x setdamage 1;
             }
        } foreach nearestTerrainObjects [_unit modelToWorld [0,3,0], [], 1.0];  

        { 
            if (getModelInfo _x select 0 in _bushArray) then 
            {
                if (damage _x <= .5) then {nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";};
                _x setdamage 1;
            }
        } foreach nearestTerrainObjects [_unit modelToWorld [0,4,0], [], 1.0];
		
        { 
            if (getModelInfo _x select 0 in _bushArray) then 
            {
                if (damage _x <= .5) then {nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";};
                _x setdamage 1;
            }
        } foreach nearestTerrainObjects [_unit modelToWorld [0,5,0], [], 1.0];  
		
		// Drop small trees if cursor on them and they are close.  inocarpus can't be destroyed though...
		if !(isNull cursorObject) then
		{
			_tree = cursorObject;
			
			if (getModelInfo _tree select 0 in _bushArray and _unit distance _tree < 5.2) then 
			{
					if (damage _tree <= 9) then {nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";};
					_tree setdamage 1;
			};
		};
    };
	// Destroy cane and some bushes if near a grenade blast
    if ((str _projectile) find  "grenade" >= 0 or (str _projectile) find  "mini" >= 0) then
    {
        NADE = _projectile;
        //systemchat format ["_projectile=%1",_projectile];
        dmy=[_projectile,_bushArray] spawn 
        {
            params["_nade","_bushArray"];
            _pos =  getpos _nade;
            _explodePos = _pos;
            //hint format ["init _pos=%1",str _pos];
            while {alive _nade and (getpos _nade select 0) > 0} do
            {
               _explodePos = _pos;
               sleep .1;
               _pos = getpos  _nade;
            };
            sleep .1;
            //systemchat format ["_explodePos=%1",_explodePos];
            { 
                if (getModelInfo _x select 0 in _bushArray) then 
                {
                    _x setdamage 1;
                    _crater = createSimpleObject ["a3\data_f\krater.p3d", getpos _x]; 
                    _crater setpos _explodePos;

                }
            } foreach nearestTerrainObjects [_explodePos, [], 3.5];
        };
                //player setposatl _explodepos;
    };
}];

leafEffect.sqf script (called by cane cutter script to produce poof of flying leaves when cutting)

Spoiler


//////////////////////////////////////////////////////////
// leafEffect.sqf 
// Created by: johnnyboy
//
// Puff of leaves flies up in front of shooter/slasher when cutting bush
//
// nul = [shooter] execVM "JBOY\leafEffect.sqf";
//////////////////////////////////////////////////////////
// Execute this on all clients
params["_shooter","_projectile"];
Private["_effect"];
//hint "In leafEffect";


_heading = [getPosATL _shooter, _shooter modelToWorld [0,5,0]] call BIS_fnc_vectorFromXToY; 
//_heading = [getPosATL _shooter, getposATL _projectile] call BIS_fnc_vectorFromXToY; 
//_velocity = [_heading,11] call BIS_fnc_vectorMultiply; 
_velocity = [_heading,3] call BIS_fnc_vectorMultiply; 
_velocity = _velocity vectorAdd [0,0,5];

_effect = "#particlesource" createVehicleLocal [0,0,0]; //(getPos player);
/*  Find these here: configfile >> "CfgCloudlets"   INcludes water tracks, dust, etc 
particleShape = "\A3\Plants_F\_Leafs\leaf_damage_small_green.p3d"; ** Best for sugar cane
particleShape = "\A3\Plants_F\_Leafs\leaf_damage_big_green.p3d";
particleShape = "\A3\data_f\ParticleEffects\Universal\Universal";
particleShape = "\A3\Plants_F\_Leafs\leaf_NeriumOleander_D.p3d";
particleShape = "\A3\Plants_F\_Leafs\leaf_damage_bigLong_green_01.p3d";
particleShape = "\A3\Plants_F\_Leafs\leaf_damage_bigLong_green_01.p3d";
particleShape = "\A3\data_f\ParticleEffects\Universal\Meat_ca";
particleShape = "\A3\data_f\ParticleEffects\Universal\Meat_ca";
*/
_effect setParticleParams [["\A3\Plants_F\_Leafs\leaf_damage_small_green.p3d",  1, 0, 1],//sprite cl_feathers2, cl_leaf2
    "", // ?
       "SpaceObject", // Type
       0.4, //TimmerPer
       .5, //Lifetime 1
       [0, 0, 0], //position
       _velocity,  //[0, 0, 2], //MoveVelocity
       0, //Simulation rotationvel
       8, //Simulation weight
       4, //Simulation volumne
       0.075, // Simulation rubbing
       [1.4, 2, 4], //Scale
       [[0, 0.6, 0.3, 1], //Color [0.1, 0.1, 0.1, 1]=white [0, 0.6, 0.3, 1]=green
       [0.25, 0.25, 0.25, 0.5], 
       [1, 1, 1, 0]], //[0.5, 0.5, 0.5, 0]], //AnimSpeed?
       [0.08], //
       .1,//0.9, ////randDirPeriod
       0.6, //randDirIntensity
       "", "", ""];
_effect setParticleRandom [.6,//.5,  //LifeTime
                           [0.25, 0.25, 0], // Position
                           [0.1, 0.1, 0],  // MoveVelocity
                           0,               //RotationVel
                           .2, //0.1, // scale
                           [0, 0, 0, 0.1], //color
                           0,//1, //randDirPeriod
                           1];//1]; //randDirIntensity
_effect setParticleCircle [0, [0, 0, 0]];
_effect setDropInterval 0.02;  
//_effect attachTo [_shooter,eyePos _shooter vectorAdd [0,1.5,0]];
_zPos = (eyepos _shooter select 2) - (getposasl _shooter select 2) - .25;
//_effect attachTo [_shooter,[0,2.5,.8]];
_effect attachTo [_shooter,[0,2.5,_zPos]];
sleep .5;
deleteVehicle _effect;

 

 

 

  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

if you dont mind i d like to try my hands on this and add a version that checks for max melee weapons and does the same when i swing a fireaxe (of course in best case a machete) or so. seems quite possible, when reading your comments in the script.

 

Share this post


Link to post
Share on other sites
Just now, Vandeanson said:

love it!

 

Maybe just as well JBOY created this one....VD BushCutter sounds itchy and painful. 

  • Haha 2

Share this post


Link to post
Share on other sites
Just now, Vandeanson said:

if you dont mind i d like to try my hands on this and add a version that checks for max melee weapons and does the same when i swing a fireaxe (of course in best case a machete) or so. seems quite possible, when reading your comments in the script.

I've got that already, although its hard-coded to cane only right now.  See the first few seconds of the Last Tango in Tanoa: Razing Cane video in top post.  Its currently for AI only, but can be expanded on it.  I'll publish it next week after I clean it up.  If you're hot for it now, I'll post the current version.

 

Just now, EO said:

VD BushCutter sounds itchy and painful. 

:rofl:  It was only a matter of time before the VD handle boomeranged on him!!!

  • Haha 1

Share this post


Link to post
Share on other sites
Just now, Vandeanson said:

if you dont mind i d like to try my hands on this and add a version that checks for max melee weapons and does the same when i swing a fireaxe (of course in best case a machete) or so. seems quite possible, when reading your comments in the script.

Now that i re-read your post, you're  focusing on Max Melee weapons, so yeah, go for it.

Here's my axe cane cutter script.  Use anything you want from it.  This script also calls leafEffect.sqf, so I will add that script to the top post as well.

Spoiler

// _n = [[worker1, worker2, worker3]] call JBOY_CutCane;
//_dmy = [[worker1, worker2, worker3]] execVM "JBOY\JBOY_CutCane.sqf";

params ["_workers"];
JBOY_CutCane = true;
{
	_x setBehaviour "CARELESS";
	_x disableAI "ALL";
	_x setSpeaker "NoVoice";
	
	// credit to Phronk for attachto position and animations
	// Land_Axe_F
	_axe = "Land_Axe_F"  createVehicle [0,0,0];
	_axe attachTo[_x,[-0.01,0.12,0.005],"rightHandMiddle1"];
	_axe setDir 90;
	_axe setVectorUp[-12,-0.0,1];

    _n=[_x] spawn { 
        params["_worker"];
		_worker enableSimulation true;
        _pos = [];
        _dir = getdir _worker;
        _worker setBehaviour "CARELESS";
        _worker setSpeedMode "LIMITED";
        while {JBOY_CutCane} do 
        { 
           // 3 swings then 3 steps forward
          _worker setdir _dir;
           _worker switchmove "AwopPercMstpSgthWnonDnon_throw";
           sleep .7 + ((random 4)/10);
           nul = [_worker,"none"] execVM "JBOY\leafEffect.sqf";
           _worker setdir _dir;
           _worker switchmove "AwopPercMstpSgthWnonDnon_throw";
           nul = [_worker,"none"] execVM "JBOY\leafEffect.sqf";
           sleep .8;
           _worker setdir _dir;
           _worker switchmove "AwopPercMstpSgthWnonDnon_throw";
            { 
                if (getModelInfo _x select 0 in ["b_sugarcane_mature_row_f.p3d"]) then 
                {
                    if (damage _x < 1) then {nul = [_worker,"none"] execVM "JBOY\leafEffect.sqf";};
                    //nul = [_unit,_projectile] execVM "JBOY\leafEffect.sqf";
                    _x setdamage 1;
                }
            } foreach nearestTerrainObjects [_worker modelToWorld [0,1.5,0], [], 3.5];  
           sleep 2;
           _worker disableAI "ANIM";
           _worker playmove "amovpercmwlkslowwpstdf";
           sleep 5;
           _worker enableAI "ANIM";
           _worker switchMove "amovpercmstpslowwpstdnon";
         }; 
    };
} foreach _workers;

 

 

cutting-Cane.jpg

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Nice release! Can it do this:

AP2l.gif

:rofl::rofl:

Hehe

  • Thanks 1
  • Haha 4

Share this post


Link to post
Share on other sites

oh god, i did not realize:drinking:

ah well too late, gotta use the handle with pride now:slayer:

  • Haha 3

Share this post


Link to post
Share on other sites
Just now, HazJ said:

Nice release! Can it do this:

I like a challenge!  Making a pot of coffee now.  Ordering a pizza.  Loading the bong.  Check back tomorrow morning!

  • Haha 2

Share this post


Link to post
Share on other sites
Just now, Vandeanson said:

ah well too late, gotta use the handle with pride now:slayer:

Rock it like you own it!

  • Haha 1

Share this post


Link to post
Share on other sites
Just now, johnnyboy said:

See the first few seconds of the Last Tango in Tanoa:

yep noticed it there, thought that there was some script witchcraft behind it!

Share this post


Link to post
Share on other sites

ooouuukay i am not kidding here.. i ve been working on a script today and this is is a new variable ive been using: VD_Cured

 

:eh:

  • Haha 3

Share this post


Link to post
Share on other sites

 The question is why would you need to use that variable in an A3 script... :happy::rofl:

Share this post


Link to post
Share on other sites
Just now, HazJ said:

 The question is why would you need to use that variable in an A3 script... :happy::rofl:

 

it got worse.....

execvm "VD_Infection.sqf";

 

i have changed the handler now:down:

what has been seen can not be unseen!

  • Haha 3

Share this post


Link to post
Share on other sites

Very nice script johnnyboy !

It was a very nice idea mixing this with the shotguns and with Max's mod !

Share this post


Link to post
Share on other sites
Just now, GEORGE FLOROS GR said:

Very nice script johnnyboy !

It was a very nice idea mixing this with the shotguns and with Max's mod !

Thanks George.  I did the shotgun part, but mixing it with Max's mod is VD's idea.

  • Like 1

Share this post


Link to post
Share on other sites

I logged in to approve "Bush Cutter". Should be done as much as possible. :D

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
Just now, Valken said:

I logged in to approve "Bush Cutter". Should be done as much as possible. :D

Words to live by.  Thanks brutha!

  • Thanks 1

Share this post


Link to post
Share on other sites

# Since arma 3 was 5 years old ,

i thought that everything was close to an end ,

but instead of this , i think nowadays that i see a lot of cool stuff coming up !

 

# Keep playing arma !

kids-play-cod-teenagers-play-battlefield

  • Like 3

Share this post


Link to post
Share on other sites
Just now, GEORGE FLOROS GR said:

# Since arma 3 was 5 years old ,

i thought that everything was close to an end ,

but instead of this , i think nowadays that i see a lot of cool stuff coming up !

 

# Keep playing arma !

Who are you calling an adult?  I'm insulted.  I'm a 14 year old girl (but I self identify as a furry).   I built my first ARMA 1 mission when I was 2 years old.  And, no, I don't want go camping with any of you perverts. 

  • Haha 2

Share this post


Link to post
Share on other sites
Just now, johnnyboy said:

And, no I don't want go camping with any of perverts. 

 

 

  • Haha 1

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

×