Jump to content
scottb613

Delete ModuleEffectsFire_F (C3_Fire)?

Recommended Posts

Hi Folks,


Quick Question - "deleteVehicle" doesn't seem to work with fire and smoke modules - such as "ModuleEffectsFire_F (C3_Fire)".

 

Can I delete this via script?

 

Thanks.


Creating a mission with random crash sites:

Spoiler



_activeCrash = selectRandom [1,2,3,4];

_crashArr1 = [C1_Wreck, C1_Fire, C1_Smoke, C1_Body1, C1_Body2, C1_Body3];
_crashArr2 = [C2_Wreck, C2_Fire, C2_Smoke, C2_Body1, C2_Body2, C2_Body3];
_crashArr3 = [C3_Wreck, C3_Fire, C3_Smoke, C3_Body1, C3_Body2, C3_Body3];
_crashArr4 = [C4_Wreck, C4_Fire, C4_Smoke, C4_Body1, C4_Body2, C4_Body3];


hint "_activeCrash";


if (_activeCrash == 1) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	{
		deleteVehicle _x;
	} forEach _crashArr3;
	{
		deleteVehicle _x;
	} forEach _crashArr4;
};

if (_activeCrash == 2) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr3;
	
	{
		deleteVehicle _x;
	} forEach _crashArr4;
};

if (_activeCrash == 3) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	
	{
		deleteVehicle _x;
	} forEach _crashArr4;
};

if (_activeCrash == 4) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	
	{
		deleteVehicle _x;
	} forEach _crashArr3;
};

 

Regards,

 


Scott

Share this post


Link to post
Share on other sites

Hi Folks,

 

Not a solution - but - a work around.

 

Added a Particle Effect as opposed to having to delete a Module:

Spoiler

private ["_posATL", "_activeCrash", "_crashArr1", "_crashArr2", "_crashArr3", "_crashArr4"];

_activeCrash = selectRandom [1,2,3,4];

_crashArr1 = [C1_Wreck, C1_Body1, C1_Body2, C1_Body3];
_crashArr2 = [C2_Wreck, C2_Body1, C2_Body2, C2_Body3];
_crashArr3 = [C3_Wreck, C3_Body1, C3_Body2, C3_Body3];
_crashArr4 = [C4_Wreck, C4_Body1, C4_Body2, C4_Body3];



if (_activeCrash == 1) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	{
		deleteVehicle _x;
	} forEach _crashArr3;
	{
		deleteVehicle _x;
	} forEach _crashArr4;
	
	_posATL = getPosATL C1_Wreck;
};

if (_activeCrash == 2) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr3;
	
	{
		deleteVehicle _x;
	} forEach _crashArr4;
	
	_posATL = getPosATL C2_Wreck;
};

if (_activeCrash == 3) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	
	{
		deleteVehicle _x;
	} forEach _crashArr4;
	
	_posATL = getPosATL C3_Wreck;
};

if (_activeCrash == 4) then
{
	{
		deleteVehicle _x;
	} forEach _crashArr1;
	
	{
		deleteVehicle _x;
	} forEach _crashArr2;
	
	{
		deleteVehicle _x;
	} forEach _crashArr3;
	
	_posATL = getPosATL C4_Wreck;
};


// Smoke

private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
	1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
	[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
	[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;

 

 

 

Regards,
Scott

Share this post


Link to post
Share on other sites
12 hours ago, scottb613 said:

Quick Question - "deleteVehicle" doesn't seem to work with fire and smoke modules - such as "ModuleEffectsFire_F (C3_Fire)".

Can I delete this via script?

 

 

Yes, name your fire module (class ModuleEffectsFire_F), say module1  (or use magic variable like _x in same scope) , then, when you don't want effects anymore:

deleteVehicle ((module1 getVariable "effectEmitter") select 0);
deleteVehicle ((module1 getVariable "effectLight") select 0);

For smoke module (ModuleEffectsSmoke_F), the first line (effectEmitter) is enough.

 

 

Btw, another way for scripting your goal:

 

private _crashArr1 = [C1_Wreck, C1_Body1, C1_Body2, C1_Body3];
private _crashArr2 = [C2_Wreck, C2_Body1, C2_Body2, C2_Body3];
private _crashArr3 = [C3_Wreck, C3_Body1, C3_Body2, C3_Body3];
private _crashArr4 = [C4_Wreck, C4_Body1, C4_Body2, C4_Body3];
private _allCrashes = [_crashArr1,_crashArr2,_crashArr3,_crashArr4];
private _activeCrash =  _allCrashes deleteAt floor random 4;
{deleteVehicle _x} forEach flatten _allCrashes;

 

What else?

  • Like 1

Share this post


Link to post
Share on other sites

Hi Pierre,

 

I drift in and out around here - but - always nice to see you posting.

 

Thanks for your help and I always appreciate seeing how I could code it better.

 

Time to look up a couple new commands I haven't used before.

😉

 

Regards,

Scott

  • 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

×