Jump to content
johnnyboy

JBOY Burning/Exploding Barrel script - released

Recommended Posts

:( having some issues.

Is the init.sqf really clean enough to copy?

I copied the init.sqf from your mission but removed the last bit which is spawning a code piece for barrels on truck.

When I shoot now a barrel it explodes but I get error line 96 of JBOY_barrel_boom.sqf "TRUCKBARRELS" undefined

 

If I do not remove the spawn part in init.sqf then I get another error and this time, line 14 of JBOY_load_barrels_on_truck.sqf "_flatbed" is undefined..

Share this post


Link to post
Share on other sites

In JBOY_barrel_boom.sqf, comment out or remove lines 96 through 108 if you aren't putting barrels on a truck.  These are the lines to remove:

	if (_obj in (TRUCKBARRELS select 1)) then 
	{
		{  // if near barrel attached, then unattached and bump it
			_brl = (TRUCKBARRELS select 1) select _x;
			if !(isNull attachedTo _brl) then
			{
				detach _brl; 
				[_brl, 0,45] call BIS_fnc_setPitchBank;
				_brl setVelocity [_speed/3 * sin(random 360), _speed/3 * cos(random 360), _zvel/6];
			};
		} 
		foreach [1,3,4];
	};

Its referencing a global array called TRUCKBARRELS which fails, because you're not using that piece.

Share this post


Link to post
Share on other sites

fucking awesome script. Adds a lot of carnage. But I'm confuised as in the demo mission there are many scripts differing in each barrel: 

 

[this, 0,90] call BIS_fnc_setPitchBank; this setmass 500; 

 

 

this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; this setdamage .0

[this, 0,90] call BIS_fnc_setPitchBank; this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}];  this setdamage .07;

 this setdamage .01;  this addeventhandler ["killed",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; _nul = [this, 2, 1] execVM "barrelRespawn.sqf"; this addRating 2000;

 this setdamage .01;  this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; _nul = [this, 2, 1] execVM "barrelRespawn.sqf";;

this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; _nul = [this, 2, 1] execVM "barrelRespawn.sqf"; this setdamage .01;

 

 

Should I use each? In my mission I can't get it to work.

 

 

Also do I need to call the barrels a certai nname in their variable? Ie barrel_99_01?

 

Also the truck? does it need a certain variable

 

 

Thanks for the awesome script

Share this post


Link to post
Share on other sites

@CHICKENLICKEN  This is all you have to put into the init of a barrel for it to be burnable/explodable:

this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}];

The script won't start barrel burning until the barrel's damage reaches 1 (on a scale of zero to 1), so it will take multiple shots in the above case before it burns. 

 

If you want it to burn with one shot then add the setDamage statement to the init:

this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; this setdamage .08;

With the above, the damage is initialized to .08, so one shot will start it to burn.  For the demo mission I varied the amount of initial damage per barrel just for fun.  Some start burning after 1 shot, some take a few shots.

 

The BIS_fnc_setPitchBank line below will place barrel on its side instead of standing upright, and the setMass helps it be heavy enough to roll down hill.  Use this if placing on a hill and you want them to roll.  You don't need these statements for regular barrels that stand upright.

[this, 0,90] call BIS_fnc_setPitchBank; this setmass 500;  

In the case below, there is additional call to another script that will respawn the barrel after it is destroyed after some wait period (some people wanted that feature):

this addeventhandler ["hit",{ [_this] execVM "JBOY\JBOY_barrel_boom.sqf";}]; 
_nul = [this, 2, 1] execVM "barrelRespawn.sqf"; 

Good luck and have fun with it!

  • Like 2

Share this post


Link to post
Share on other sites

Just played the demo mission, the showcase is setup perfectly for some awesome belly laugh action. Micheal Bay ain't got shit on this my friend!

I'd definitely like to try and apply these scripts to fuel canisters and gas tanks too. I'm looking for some inventive ways to blow up an objective...using this would be great. 

  • Like 1

Share this post


Link to post
Share on other sites
35 minutes ago, EO said:

I'm looking for some inventive ways to blow up an objective...using this would be great. 

 

Basically , johnnyboy you have done an amazing work here !

 

On how to use this EO , i would create a spawner for the objects and spawn them maybe inside houses ( building positions )  or to a residential area , which is always a point of interest and spawn the script to the objects !

  • Like 2

Share this post


Link to post
Share on other sites
37 minutes ago, EO said:

Just played the demo mission, the showcase is setup perfectly for some awesome belly laugh action. Micheal Bay ain't got shit on this my friend!

I'd definitely like to try and apply these scripts to fuel canisters and gas tanks too. I'm looking for some inventive ways to blow up an objective...using this would be great. 

Thanks buddy.   The script would definitely work on any object.  But you probably want to tweak the fire attach to location for larger or smaller objects.  Clustering many together (or on the truck) is the most fun, as then you get a crazy chain reaction.  🙂

  • Like 2

Share this post


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

Basically , johnnyboy you have done an amazing work here !

 

On how to use this EO , i would create a spawner for the objects and spawn them maybe inside houses ( building positions )  or to a residential area , which is always a point of interest and spawn the script to the objects !

Thanks George.  Goode ideas, but objects inside buildings might look funny when exploding, as the objects fly and would probably clip through the building.

Share this post


Link to post
Share on other sites
6 minutes ago, johnnyboy said:

as the objects fly

 

You are challenging Michael Bay !

Spoiler

 

 

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

I've added this script to my new SOG AI mod.  All fuel barrels detected near player (whether terrain objects built into map or objects placed by mission maker in editor) are detected and converted into explosive barrels.

 

 

 

  • Like 1
  • Thanks 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

×