Jump to content
SejtanPL

Burning trees, grass, houses, particleEffects

Recommended Posts

Hi all :)

I think I found in the campaign files a script responsible for burning environment:

[] spawn
{
sleep 0.01;

private["_fn_createEffect"];

_fn_createEffect =
{
	private["_effect","_pos","_fire","_smoke"];
	private["_light","_brightness","_color","_ambient","_intensity","_attenuation"];

	//["[PARTICLE EFFECT CREATED]: %1",_this] call BIS_fnc_logFormat;

	_pos 	= _this select 0;
	_effect = _this select 1;

	_fire	= "";
	_smoke	= "";
	_light	= objNull;

	/*
	_color		= [1,0.85,0.6];
	_ambient	= [1,0.45,3];
	*/

	_color		= [1,0.85,0.6];
	_ambient	= [1,0.3,0];


	switch (_effect) do
	{
		case "FIRE_SMALL":
		{
			_fire 	= "SmallDestructionFire";
			_smoke 	= "SmallDestructionSmoke";
		};
		case "FIRE_MEDIUM":
		{
			_fire 	= "MediumDestructionFire";
			_smoke 	= "MediumDestructionSmoke";

			_brightness	= 1.0;
			//_color	= [1,0.85,0.6];
			//_ambient	= [1,0.3,0];
			_intensity	= 400;
			_attenuation	= [0,0,0,2];
		};
		case "FIRE_BIG":
		{
			_fire 	= "BigDestructionFire";
			_smoke 	= "BigDestructionSmoke";

			_brightness	= 1.0;
			//_color	= [1,0.85,0.6];
			//_ambient	= [1,0.45,3];
			_intensity	= 1600;
			_attenuation	= [0,0,0,1.6];
		};
		case "SMOKE_SMALL":
		{
			_smoke 	= "SmallDestructionSmoke";
		};
		case "SMOKE_MEDIUM":
		{
			_smoke 	= "MediumSmoke";
		};
		case "SMOKE_BIG":
		{
			_smoke 	= "BigDestructionSmoke";
		};
	};

	if (_fire != "") then
	{
		_eFire = "#particlesource" createVehicleLocal _pos;
		_eFire setParticleClass _fire;
		_eFire setPosATL _pos;
	};

	if (_smoke != "") then
	{
		_eSmoke = "#particlesource" createVehicleLocal _pos;
		_eSmoke setParticleClass _smoke;
		_eSmoke setPosATL _pos;
	};

	//create lightsource
	if (_effect in ["FIRE_BIG","FIRE_MEDIUM"]) then
	{
		_pos   = [_pos select 0,_pos select 1,(_pos select 2)+1];
		_light = createVehicle ["#lightpoint", _pos, [], 0, "CAN_COLLIDE"];
		_light setPosATL _pos;

		_light setLightBrightness _brightness;
		_light setLightColor _color;
		_light setLightAmbient _ambient;
		_light setLightIntensity _intensity;
		_light setLightAttenuation _attenuation;
		_light setLightDayLight false;
	};
};

#define FIRE_SMALL	"Sign_Pointer_Yellow_F"
#define FIRE_MEDIUM     "Sign_Arrow_Large_Cyan_F"
#define FIRE_BIG        "Sign_Arrow_Large_Pink_F"
#define SMOKE_SMALL     "Sign_Pointer_Green_F"
#define SMOKE_MEDIUM    "Sign_Pointer_Blue_F"
#define SMOKE_BIG	"Sign_Arrow_Large_Blue_F"

private["_helperClass","_effectType"];

{
	_helperClass 	= _x select 0;
	_effectType 	= _x select 1;

	{
		[getPosATL _x,_effectType] call _fn_createEffect;
	}
	forEach (allMissionObjects _helperClass);
}
forEach
[
	[FIRE_SMALL,"FIRE_SMALL"],
	[FIRE_MEDIUM,"FIRE_MEDIUM"],
	[FIRE_BIG,"FIRE_BIG"],
	[sMOKE_SMALL,"SMOKE_SMALL"],
	[sMOKE_MEDIUM,"SMOKE_MEDIUM"],
	[sMOKE_BIG,"SMOKE_BIG"]
];
};

How can I use it? Regular n = [pos1, "FIRE_BIG"] execVM "my_script.sqf" doesn't work.

Sorry for my poor english :icon_rolleyes:

:help:

Edited by Sejtan
remove spoilers

Share this post


Link to post
Share on other sites

thanks for the fucking spoilers. Appreciate that. :dance:

Edited by Iceman77

Share this post


Link to post
Share on other sites

Maybe now would be a great time to edit your post and take the spoiler(s) out?

Share this post


Link to post
Share on other sites
Maybe now would be a great time to edit your post and take the spoiler(s) out?

Done.

Share this post


Link to post
Share on other sites

Iceman77,,,it would equally be a good idea to Curb your language my friend before the Moderators have a word. Fair comment on what you meant to say but foul offensive language is not good.

Share this post


Link to post
Share on other sites
Iceman77,,,it would equally be a good idea to Curb your language my friend before the Moderators have a word. Fair comment on what you meant to say but foul offensive language is not good.

I was told by placebo himself there's nothing against swearing. In any case, you're right, I probably shouldn't swear, even though a part of the campaign has been spoiled for me.

Share this post


Link to post
Share on other sites

Yes Iceman... You're right, I made a mistake ... I told you almost the whole story :j: But now, as I have already apologized and removed the spoilers, please shut up if you have nothing to say on this topic.

Share this post


Link to post
Share on other sites
Yes Iceman... You're right, I made a mistake ... I told you almost the whole story :j: But now, as I have already apologized and removed the spoilers, please shut up if you have nothing to say on this topic.

I was just returning to this thread to post some snippets regarding the topic. Fuck that though. Instead...

No you didn't tell the whole story smartass. But what you did do was spoil a part of the campaign for me. Also, I was only saying that I shouldn't be swearing even though a part of the campaign has been ruined for me. You're making me want to swear alot more though. And you're right, you did make a mistake.

Share this post


Link to post
Share on other sites

So now that the tears are dried out ...

Anyone knows how to call this? I am kind of curious also.

Share this post


Link to post
Share on other sites

I've had a crack at the code to get it to work (un-tested though so let us know if it works)

1. Add this function to your init.sqf or your own function

BIS_fn_createFireEffect = {
private["_effect","_pos","_fire","_smoke"];
private["_light","_brightness","_color","_ambient","_intensity","_attenuation"];

_pos 	= _this select 0;
_effect = _this select 1;

_fire	= "";
_smoke	= "";
_light	= objNull;
_color		= [1,0.85,0.6];
_ambient	= [1,0.3,0];

switch (_effect) do {
	case "FIRE_SMALL" : {
		_fire 	= "SmallDestructionFire";
		_smoke 	= "SmallDestructionSmoke";
	};
	case "FIRE_MEDIUM" : {
		_fire 	= "MediumDestructionFire";
		_smoke 	= "MediumDestructionSmoke";
		_brightness	= 1.0;
		_intensity	= 400;
		_attenuation	= [0,0,0,2];
	};
	case "FIRE_BIG" : {
		_fire 	= "BigDestructionFire";
		_smoke 	= "BigDestructionSmoke";
		_brightness	= 1.0;
		_intensity	= 1600;
		_attenuation	= [0,0,0,1.6];
	};
	case "SMOKE_SMALL" : {
		_smoke 	= "SmallDestructionSmoke";
	};
	case "SMOKE_MEDIUM" : {
		_smoke 	= "MediumSmoke";
	};
	case "SMOKE_BIG" : {
		_smoke 	= "BigDestructionSmoke";
	};
};

if (_fire != "") then {
	_eFire = "#particlesource" createVehicleLocal _pos;
	_eFire setParticleClass _fire;
	_eFire setPosATL _pos;
};

if (_smoke != "") then {
	_eSmoke = "#particlesource" createVehicleLocal _pos;
	_eSmoke setParticleClass _smoke;
	_eSmoke setPosATL _pos;
};

//create lightsource
if (_effect in ["FIRE_BIG","FIRE_MEDIUM"]) then {
	_pos   = [_pos select 0,_pos select 1,(_pos select 2)+1];
	_light = createVehicle ["#lightpoint", _pos, [], 0, "CAN_COLLIDE"];
	_light setPosATL _pos;

	_light setLightBrightness _brightness;
	_light setLightColor _color;
	_light setLightAmbient _ambient;
	_light setLightIntensity _intensity;
	_light setLightAttenuation _attenuation;
	_light setLightDayLight false;
};
};

ADD an object ( object (helpers) ) to the map, call it something like FIREBUG and set it in a nearby tree

then run the function on FIREBUG by calling this:

[getPosATL FIREBUG,"FIRE_BIG"] call BIS_fn_createFireEffect;

Share this post


Link to post
Share on other sites
I was told by placebo himself there's nothing against swearing. In any case, you're right, I probably shouldn't swear, even though a part of the campaign has been spoiled for me.

No fucking swearing!

Share this post


Link to post
Share on other sites

Since the spoiler issue has apparently been cleared up, please return to the topic at hand.

Share this post


Link to post
Share on other sites

Thanks a lot. It works, but not perfectly. When I set "FIRE_BIG" on some height, smoke coming out from the ground, under the fire. Look the picture.

etu9.th.jpg

Smoke from FIRE_SMALL and FIRE_MEDIUM is ok.

Share this post


Link to post
Share on other sites

BIS, add simple fire source objects into the editor instead of this quirky code approach.

Share this post


Link to post
Share on other sites
Hi again :) I make some demo mission. I hope it will be helpful :)

Thx for the helpful sample mission. How would I call this from a trigger? Would I take your code directly from the Init.sqf and create a separate "burn.sqf" and simply paste the code? call it from a trigger "[] exec "burn.sqf"????

*EDIT*

It did work in a trigger and separate .sqf file. Thanks again for the sample mission!!

Edited by WarLord554

Share this post


Link to post
Share on other sites
Thx for the helpful sample mission. How would I call this from a trigger? Would I take your code directly from the Init.sqf and create a separate "burn.sqf" and simply paste the code? call it from a trigger "[] exec "burn.sqf"????

Leave this code in your init.sqf:

BIS_fn_createFireEffect = {
private["_effect","_pos","_fire","_smoke"];
private["_light","_brightness","_color","_ambient","_intensity","_attenuation"];

_pos 	= _this select 0;
_effect = _this select 1;

_fire	= "";
_smoke	= "";
_light	= objNull;
_color		= [1,0.85,0.6];
_ambient	= [1,0.3,0];

switch (_effect) do {
	case "FIRE_SMALL" : {
		_fire 	= "SmallDestructionFire";
		_smoke 	= "SmallDestructionSmoke";
	};
	case "FIRE_MEDIUM" : {
		_fire 	= "MediumDestructionFire";
		_smoke 	= "MediumDestructionSmoke";
		_brightness	= 1.0;
		_intensity	= 400;
		_attenuation	= [0,0,0,2];
	};
	case "FIRE_BIG" : {
		_fire 	= "BigDestructionFire";
		_smoke 	= "BigDestructionSmoke";
		_brightness	= 1.0;
		_intensity	= 1600;
		_attenuation	= [0,0,0,1.6];
	};
	case "SMOKE_SMALL" : {
		_smoke 	= "SmallDestructionSmoke";
	};
	case "SMOKE_MEDIUM" : {
		_smoke 	= "MediumSmoke";
	};
	case "SMOKE_BIG" : {
		_smoke 	= "BigDestructionSmoke";
	};
};

if (_fire != "") then {
	_eFire = "#particlesource" createVehicleLocal _pos;
	_eFire setParticleClass _fire;
	_eFire setPosATL _pos;
};

if (_smoke != "") then {
	_eSmoke = "#particlesource" createVehicleLocal _pos;
	_eSmoke setParticleClass _smoke;
	_eSmoke setPosATL _pos;
};

//create lightsource
if (_effect in ["FIRE_BIG","FIRE_MEDIUM"]) then {
	_pos   = [_pos select 0,_pos select 1,(_pos select 2)+1];
	_light = createVehicle ["#lightpoint", _pos, [], 0, "CAN_COLLIDE"];
	_light setPosATL _pos;

	_light setLightBrightness _brightness;
	_light setLightColor _color;
	_light setLightAmbient _ambient;
	_light setLightIntensity _intensity;
	_light setLightAttenuation _attenuation;
	_light setLightDayLight false;
};
};

and type this in the trigger in od act:

[getPos w1, "FIRE_BIG"] call BIS_fn_createFireEffect;

w1 - name of the object that you want to burn

"FIRE_BIG" - the type of fire or smoke

Share this post


Link to post
Share on other sites
Thanks a lot. It works, but not perfectly. When I set "FIRE_BIG" on some height, smoke coming out from the ground, under the fire. Look the picture.

http://imageshack.us/a/img10/7320/etu9.th.jpg

Smoke from FIRE_SMALL and FIRE_MEDIUM is ok.

These effects were supposed to be a part of the campaign only. That smoke placing on the ground is intended behaviour in this case.

Share this post


Link to post
Share on other sites

Is it possible to remove this fire again? I found solutions for old fire functions but not for this.

Share this post


Link to post
Share on other sites

Due to a recent change the particle effects should automatically be removed when deleting the fire object, worth mentioning even if you dug up a 2 year old thread.

 

Cheers

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

×