Jump to content
johnnyboy

JBOY Molotov Cocktail script [Beta release]

Recommended Posts

Here's my Molotov Cocktail script for Arma 3.

How it works:

  • Via a scripted action, a unit is forced to throw a purpleSmokeShell.
  • The shell is detected as a near object, and a bullet is spawned and given the same direction and velocity.
  • The smoke shell is deleted and a "bottle" object is attached to the bullet, and a fire is attached to the bullet.
  • At bullet impact point, a fire is created.
  • Bullet impact point is detected when it's height is near the ground, or when its dirTo direction changes significantly (a ricochet).
  • If bullet impacts a vehicle, fire is attached to the vehicle.
  • If bullet impacts on or near a man, fire is attached to man, man screams, and plays a panic move animation while burning.
  • Fires give damage to nearby units/vehicles.

Known Issues:

  • Not MP compatible.  Needs work to say3d sounds on all clients, to execute animations on all clients, etc.
  • Thrown bottle hooks to the right sometimes.
  • If bottle hits roof of building, fire is spawned a few meters above roof instead of at impact point.  Needs to be debugged. Fixed, thanks to Hallyg!
  • Vanilla Arma 3 does not have a good looking glass bottle object.  Plastic water bottles look bad, so I chose the metal canister.  Its moving fast, so you can't necessarily tell.  But a good glass bottle object from a mod would be better.

Not planning on supporting this

 

I'm too busy, so I'm not planning on taking this further and fixing the issues at this time.  I grant permission to anybody who wants to take this and improve on it (just give me a little credit somewhere!).

 

Link to zipped mission directory

 

Download this zip file, unzip the folder, and put it in you editor Missions directory.  You can then try it via the editor, and see all the scripts.

 

Editor mission zip file link

 

Good luck and enjoy!

  • Like 5

Share this post


Link to post
Share on other sites

Awesome fun johnnyboy, this will add a little spice to things. Thanks for sharing.

  • Like 1

Share this post


Link to post
Share on other sites
Known Issues:
  • If bottle hits roof of building, fire is spawned a few meters above roof instead of at impact point.  Needs to be debugged.

 

To fix the house fire spawning, in JBOY_molotov.sqf, change:

			if ((_prevpos select 2) > _maxHeight) then {
				_logic setPos [_prevpos select 0, _prevpos select 1, _maxHeight];
			};
		};
		_logic setPos _prevpos;

to

			if ((_prevpos select 2) > _maxHeight) then {
				_logic setPosATL [_prevpos select 0, _prevpos select 1, _maxHeight];
			};
		};
		_logic setPosATL _prevpos;

Nice script all the same, reminds me of your script for Armed Assault way back when :)

  • Like 1

Share this post


Link to post
Share on other sites

Awesome fun johnnyboy, this will add a little spice to things. Thanks for sharing.

Thanks EO.  I haven't been inspired with a good mission usage yet, but it may come to me.

 

 

 

To fix the house fire spawning, in JBOY_molotov.sqf, change to...

			if ((_prevpos select 2) > _maxHeight) then {
				_logic setPosATL [_prevpos select 0, _prevpos select 1, _maxHeight];
			};
		};
		_logic setPosATL _prevpos;

Nice script all the same, reminds me of your script for Armed Assault way back when :)

 

Hallyg, thanks much for reading the script and suggesting the fix.  I'll incorporate that change.  I should post all my work-in-progress to be crowd-sourced, so I don't have to do the hard work! :P

  • Like 2

Share this post


Link to post
Share on other sites

Thanks to Hallyg, I've fixed the problem where Molotov hits a roof, and fire spawned a few meters above the roof.  Now it spawns on the roof perfectly.

 

Link in original post is updated with this fix.

 

Goddammit Hallyg, I said I wasn't planning on supporting/fixing this script, and you shamed me into it! ;)

  • Like 2

Share this post


Link to post
Share on other sites

awesome stuff as always.

 

i have one suggestion though.

 

could you make it possible to tie your code to a certain ammo type? i feel like that would be a better solution than using the scroll action menu (i just personally hate it with a passion...so might be just me). that way you can handle the molotov cocktails like acctual inventory items and also throw them more easily.

 

i'm thinking like a "fired" EH and inputting a string of the ammo type into your function could do the trick. i personally then would use purple smoke or something. or maybe chemlights since they were rendered useless, unless i missed an update.

so it would just catch the right ammo type from the fired EH and then "convert" that projectile the way you already do. if it's not that ammo type, nothing happens. i did flashbangs
 like that before mission side and it worked nicely.

 

maybe make that an option or something since i'm sure you have your reasons to do it like you are.

 

just an idea.

  • Like 2

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

 

Many thanks  to the ever vigilant Foxhound!

 

 

awesome stuff as always.

 

i have one suggestion though.

 

could you make it possible to tie your code to a certain ammo type? i feel like that would be a better solution than using the scroll action menu (i just personally hate it with a passion...so might be just me). that way you can handle the molotov cocktails like acctual inventory items and also throw them more easily.

 

i'm thinking like a "fired" EH and inputting a string of the ammo type into your function could do the trick. i personally then would use purple smoke or something. or maybe chemlights since they were rendered useless, unless i missed an update.

so it would just catch the right ammo type from the fired EH and then "convert" that projectile the way you already do. if it's not that ammo type, nothing happens. i did flashbangs

 like that before mission side and it worked nicely.

Thanks BB.  Regarding your suggestion, that is how it works now.  The PurpleSmokeShell is working as the Molotov in my demo mission.  As player, if you switch active grenade to be PurpleSmokeShell and throw it, the Fired EH replaces the smoke shell with the molotov.  In the demo video I used the action menu, but I could have just thrown purple smokes the normal way also.

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

×