Jump to content
combataz

Attaching fire effect to unit.

Recommended Posts

Hey all.

 

I'm trying to attach a fire effect to an infantry unit, so that it sticks to it as the unit walks around. I've tried using attachToRelative, which didn't work. I also tried the suggestions in this topic: 

 Which also did not work. Obviously the soldier needs to stay alive as this is what I'm going for: 

 

https://i.imgur.com/3MCDUsR.png

 

Any ideas?

Share this post


Link to post
Share on other sites

Hi,

This should work in SP or MP. Write this in the init field of the unit. You can also script in init.sqf, replacing <this> by some unit (variable).

 

0 = this spawn {
   private _emitter = "#particlesource" createVehicleLocal getpos _this;
   _emitter setParticleClass "ObjectDestructionFire1Tiny";
   _emitter setParticleFire [0,0,0];
   _emitter attachTo [_this,[0,0,0.2],"head"];
   waitUntil {uisleep 2; !alive _this};
   detach _emitter;
   deleteVehicle _emitter;
};

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, pierremgi said:

Hi,

This should work in SP or MP. Write this in the init field of the unit. You can also script in init.sqf, replacing <this> by some unit (variable).

 


0 = this spawn {
   private _emitter = "#particlesource" createVehicleLocal getpos _this;
   _emitter setParticleClass "ObjectDestructionFire1Tiny";
   _emitter setParticleFire [0,0,0];
   _emitter attachTo [_this,[0,0,0.2],"head"];
   waitUntil {uisleep 2; !alive _this};
   detach _emitter;
   deleteVehicle _emitter;
};

 

 

If I had any children left to give to strangers, you would be getting one. This is awesome, thank you.

 

And this is perfect and this is only asking because I'm curious, but is there anyway for that particle emitter to light up the area around it as well?

  • Haha 1

Share this post


Link to post
Share on other sites
0 = this spawn {

    private _light = "#lightpoint" createVehicleLocal getpos _this; 
    _light setLightDayLight true; 
    _light setLightColor [5, 2.5, 0]; 
    _light setLightBrightness 0.1; 
    _light setLightAmbient [5, 2.5, 0]; 
    _light lightAttachObject [_this, [0, 0, 0]]; 
    _light setLightAttenuation [3, 0, 0, 0.6]; 
	
    private _emitter = "#particlesource" createVehicleLocal getpos _this;
    _emitter setParticleClass "ObjectDestructionFire1Tiny";
    _emitter setParticleFire [0,0,0];
    _emitter attachTo [_this,[0,0,0.2],"head"];
    waitUntil {uisleep 2; !alive _this};
    lightDetachObject _light;
    deleteVehicle _light;
    detach _emitter;
    deleteVehicle _emitter;
};

Adapted from @bad benson's example in the topic linked above. Play around with the RGB values in setLightColor/Brightness/Ambient as desired.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, Harzach said:

0 = this spawn {

    private _light = "#lightpoint" createVehicleLocal getpos _this; 
    _light setLightDayLight true; 
    _light setLightColor [5, 2.5, 0]; 
    _light setLightBrightness 0.1; 
    _light setLightAmbient [5, 2.5, 0]; 
    _light lightAttachObject [_this, [0, 0, 0]]; 
    _light setLightAttenuation [3, 0, 0, 0.6]; 
	
    private _emitter = "#particlesource" createVehicleLocal getpos _this;
    _emitter setParticleClass "ObjectDestructionFire1Tiny";
    _emitter setParticleFire [0,0,0];
    _emitter attachTo [_this,[0,0,0.2],"head"];
    waitUntil {uisleep 2; !alive _this};
    lightDetachObject _light;
    deleteVehicle _light;
    detach _emitter;
    deleteVehicle _emitter;
};

Adapted from @bad benson's example in the topic linked above. Play around with the RGB values in setLightColor/Brightness/Ambient as desired.

Dude, Awesome! All we need is a working skeleton head model and Ghost Rider mod is a GO. Cool idea?

o boy, look it here. I'm doing it!

Edited by Twiznak
found it!
  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, Twiznak said:

Dude, Awesome! All we need is a working skeleton head model and Ghost Rider mod is a GO. Cool idea?

o boy, look it here. I'm doing it!

 

I discovered a bunch in Icebreakr's FAP pack. Whole plan is hell platoon over there to hunt me and the boys in the jungle. Relentlessly. At night.

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

×