Jump to content
SejtanPL

Burning trees, grass, houses, particleEffects

Recommended Posts

Hello, 

 

I know this is an old thread, but I need some help about those fire effects.

I'm working on a night mission where there are a lot of those fire particles, but not at the same places. So what I'm looking for is to stop the script from working and reactivate it later on the mission to optimize the number of light possible in the player area in order to not have light issues.

 

Unfortunately, I don't find any solutions to make it stop. Indeed, deleting the arrows, using the command "terminate" and even "enableSimulation" don't work at all.

I would like to know if one of you know how to make it stop.

 

So here is the script I use instead to spawn particles fire, which work properly:

[] 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"]
];
};

 

Share this post


Link to post
Share on other sites

Hi @WWThomahawkWW,

I'm actually also curious how to delete particle effects. I tried deleteVehicle as suggested in the BIKI article on particles (executed globally). I've also regressed and placed an Eden fire module (I think this one) , then deleteVehicle-ing that. Both keep burning. Looks like we are missing some basics on working with particle (emitters). Anyone have an idea?

Share this post


Link to post
Share on other sites

@Melody_Mike,
This script dynamically creates and removes fire/smoke effects,

all wrapped up in a demo mission so you can try it out.

Have fun!

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Oh my goodness. I had even *liked* your post when it came out. I should really bookmark things here....

  • Like 1

Share this post


Link to post
Share on other sites

@Melody_Mike,
You're on the right track. If you look at the script in the link above all that is happening is that the fire effects are pushed back to an array for later removal via deleteVehicle.

Share this post


Link to post
Share on other sites

I feel pretty dumb asking this, but I have to anyways:

I took all the necessary things, but: ooga booga no hot light.


Placed an invisible helipad obj on top of an oil well on Desert_Battlegrounds with an init of:

if (isServer) then {
 ["big","fire",this] remoteExecCall ["PAX_fnc_attachFireTo"];
 ["big","smoke",this] remoteExecCall ["PAX_fnc_attachFireTo"];
};

initPlayerLocal.sqf:

PAX_fnc_attachFireTo = compile preprocessFileLineNumbers "fncs\PAX_fnc_attachFireTo.sqf";

fncs/PAX_fnc_attachFireTo.sqf:

//"_size": "small", "medium", "big"
//"_type": "fire", "smoke"
//"_pos": object to set on fire
params [
	["_size", "", []],
	["_type", "", []],
	["_pos", objNull, []]
];
private _fireType= format ["%1Destruction%2", _size, _type];
private _emitter = "#particlesource" createVehicle (getPos _pos);
_emitter setParticleClass _fireType;
_emitter attachTo [_pos];

I click Play In Singleplayer.
No fire can be seen.

I click Play in Multiplayer.
No fire can be seen.

Sad and shivering cavemen noises.

Edited by PaxJaromeMalues
dumbo make wrong paste

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

×