Jump to content
Sign in to follow this  
Ghosthawk

Delete Fire Effect

Recommended Posts

Hi,

I made a mission where a suv catches fire trough a trigger. I use this command:

wokka = "test_EmptyObjectForFireBig" createVehicle position suv1; wokka attachTo[suv1,[0,1.5,-1]];

Is there a way to delete this effect?

I don't want it to appear in the whole mission because of performance issues.

Share this post


Link to post
Share on other sites

If you want it to disappear just use suv1 setDamage 1 to blow it up instead of creating a smoke object. Or throw a blanket over it!

Share this post


Link to post
Share on other sites

I dont think he wants his suv to be destroyed, just slightly charred. ^^

That should suffice:

deleteVehicle wokka;

Share this post


Link to post
Share on other sites
If you want it to disappear just use suv1 setDamage 1 to blow it up instead of creating a smoke object. Or throw a blanket over it!

Thanks but that does not work. This (wokka = "test_EmptyObjectForFireBig" createVehicle position suv1; wokka attachTo[suv1,[0,1.5,-1]];) creates a fire at the suv.

In the mission I want that you can see that the vehicle is burning and when you drive close to it, it will blow up.

I managed to do all the things I want in the mission but I would like to delete the fire effect because of performance.

Even if i put "deleteVehicle suv1" the suv disappears but the fire is still there.

Consequently setDamage 1 will not work, too.

Do you know how i can delete this effect?

wokka = "test_EmptyObjectForFireBig" createVehicle position suv1; wokka attachTo[suv1,[0,1.5,-1]];

---------- Post added at 17:09 ---------- Previous post was at 17:08 ----------

I dont think he wants his suv to be destroyed, just slightly charred. ^^

That should suffice:

deleteVehicle wokka;

This doesnt work, too.

Share this post


Link to post
Share on other sites

The problem is that deleteVehicle doesn't work for the test smoke thing. :( The object returned is an empty p3d, not the fire/smoke effect. The effects are some <no shape> thing. I suppose you could search nearObjects for that and delete just those.

Share this post


Link to post
Share on other sites

Impossible to delete? oO

Didn't know that, however... why would you use such a thing in the first place?

I'd suggest using your own particle effect instead.

I know it can be a bit tricky for the first time, but you wont have to worry about undeletable objects that way.

-> https://community.bistudio.com/wiki/drop

Share this post


Link to post
Share on other sites

I can't manage to get kylania's tipp to work. Whats my mistake?

fireeffect = suv1 nearObjects 20; deleteVehicle fireeffect;

Tajin this might be a good suggestion but I'm new to scripting and don't have any idea how to do that ;D

Furthermore it maybe takes too much time to realize what i want.

Aren't there any scripts for this "drop" particle effect?

I was so happy to see the vehicle burn...

Maybe i should ignore the FPS issues?

Share this post


Link to post
Share on other sites

This works:

{if (typeOf _x == "#particlesource") then {deleteVehicle _x}} forEach (wokka nearObjects 5); 
deleteVehicle wokka;

Share this post


Link to post
Share on other sites
This works:

{if (typeOf _x == "#particlesource") then {deleteVehicle _x}} forEach (wokka nearObjects 5); 
deleteVehicle wokka;

Do I have to modify your script?

I don't get it to work. Maybe I am to dumb?

I placed a trigger with Radio Alpha and your scrpt into Activation but nothing happens when i use the Radio.

Share this post


Link to post
Share on other sites

You're certainly not too dumb. :)

My code should work from a radio trigger to "turn off" the smoke/fire.

Radio Alpha onAct to turn ON the fire:

wokka = "test_EmptyObjectForFireBig" createVehicle position suv1; wokka attachTo[suv1,[0,1.5,-1]];

Radio Bravo onAct to turn OFF the fire:

{if (typeOf _x == "#particlesource") then {deleteVehicle _x}} forEach (wokka nearObjects 5);   deleteVehicle wokka; 

Share this post


Link to post
Share on other sites
You're certainly not too dumb. :)

My code should work from a radio trigger to "turn off" the smoke/fire.

Radio Alpha onAct to turn ON the fire:

wokka = "test_EmptyObjectForFireBig" createVehicle position suv1; wokka attachTo[suv1,[0,1.5,-1]];

Radio Bravo onAct to turn OFF the fire:

{if (typeOf _x == "#particlesource") then {deleteVehicle _x}} forEach (wokka nearObjects 5);   deleteVehicle wokka; 

Maybe i did something wrong. Now it works. Awesome! Thank you!

Share this post


Link to post
Share on other sites

Hi,

I have added for better handling new variable into namespace of these objects. You can get an array with all attached emitters (and lights) via this code:

object getVariable "effects"

So in your case you need to use:

_emitterArray = wokka getVariable "effects";
{deleteVehicle _x} forEach _emitterArray;
deleteVehicle wokka;

It is in dev branch from today's update. If you want to use this in stable branch, then you need to wait for next stable update.

  • Like 1

Share this post


Link to post
Share on other sites
Hi,

I have added for better handling new variable into namespace of these objects. You can get an array with all attached emitters (and lights) via this code:

object getVariable "effects"

So in your case you need to use:

_emitterArray = wokka getVariable "effects";
{deleteVehicle _x} forEach _emitterArray;
deleteVehicle wokka;

It is in dev branch from today's update. If you want to use this in stable branch, then you need to wait for next stable update.

Suggest a BIS_ prefix to the getVariable name just for standardization sake (and preventing anyone who doesn't properly prefix their variables from having their code break).

Share this post


Link to post
Share on other sites
Hi,

I have added for better handling new variable into namespace of these objects.

Suggest a BIS_ prefix to the getVariable name just for standardization sake.

You both rock! :)

ps.: Someone should also mention this on the wiki, as soon as it is included.

Share this post


Link to post
Share on other sites
Hi,

I have added for better handling new variable into namespace of these objects. You can get an array with all attached emitters (and lights) via this code:

object getVariable "effects"

So in your case you need to use:

_emitterArray = wokka getVariable "effects";
{deleteVehicle _x} forEach _emitterArray;
deleteVehicle wokka;

It is in dev branch from today's update. If you want to use this in stable branch, then you need to wait for next stable update.

Thank you very much!

I'm going to wait until tomorrow and hope it will be in the stable ;D

Share this post


Link to post
Share on other sites

Thanks for the post, with "test_EmptyObjectForFireBig" works fine.

But i have tried all ways show on this thread and it doesn't works with "B_IRStrobe". I have to fix it using the command setpos [0,0,0] but I would like to know how to delete the effects.

EDIT: I have solved the problem using nearestobject :

	_obj = nearestObjects [_unit, ["all"], 2];
{if (typeOf _x == "NVG_TargetC") then {deleteVehicle _x}} forEach _obj;

object= b_irstrobe_f.p3d

object + lights = empty.p3d (typeof "NVG_TargetC")

:confused::confused:

Edited by Pescadorrr

Share this post


Link to post
Share on other sites

Hi.

I am currently working on my Helicopter Crash Script, where I also spawned some effects.

I tried every method listed in this thread, but not one of them works. (I am running Dev Branch)

I can only guess I am doing something wrong.

Here is my code (parts of it):

(...)

_smoke = "test_EmptyObjectForSmoke" createVehicle position _heli;
_smoke attachTo [_heli,[0,-5,0]]; 
_heli setVariable ["smoke",_smoke,true];

(...)

[[_heli], "CheckDist", true] call BIS_fnc_MP;

(...)

CheckDist ={
private ["_heli"];
_heli = _this select 0;
_smoke=_heli getVariable "smoke";

(...)

       _emitterArray = _smoke getVariable "effects";
{deleteVehicle _x} forEach _emitterArray;
deleteVehicle _smoke;  

Share this post


Link to post
Share on other sites

CAPTNCAPS cant see any obvious mistakes

At first glance i would suggest that the effects namespacevariable is only local to where the vehicle is spawned.

Due to the BIS_fnc_MP i presume you are spawning it on the server and then CheckDist is done client side.

Check your _emitterArray client side and see what it holds.

If its empty then you either need to pass "effects" along with your MP call or reapply the variable to the smoke to be global when you spawn it e.g

_smoke setVariable ["effects", _smoke getvariable "effects", true];

Just a guess though without testing

Share this post


Link to post
Share on other sites

Well, I am pretty bad at MP scripting. Actually, I don't even understand it :P

In my init.sqf I have

if (isDedicated) then {} else {
0 = execVM "Crash\check.sqf";
};

Which should mean that it only runs on client?

The MP function is there... because MP

My last try was: I called CheckDist without MP function, and with the code

{if (typeOf _x == "#particlesource") then {deleteVehicle _x}} forEach (_smoke nearObjects 5);   deleteVehicle _smoke;  

And that also did not work.

Anyway, I will try what you suggested :P

Share this post


Link to post
Share on other sites
On 17/10/2016 at 8:22 AM, cyborg111 said:

enablesimulation will swich fireeffects on off

Unfortunately, the fire burning effect (wounds) still remain. No flame, no smoke but injuries.

 

(similar problem: units can still speak even if enableSimulationGlobal false)

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
Sign in to follow this  

×