Jump to content
Sign in to follow this  
 EO

Smoking Civilians

Recommended Posts

I have an idea for a scenario which requires a smoke effect to emit from a civilian unit (like they have walked from a burning building/plane).

Can this be achieved or is it even possible with a script?

Share this post


Link to post
Share on other sites
I have an idea for a scenario which requires a smoke effect to emit from a civilian unit (like they have walked from a burning building/plane).

Can this be achieved or is it even possible with a script?

Have a look at TPW MODS. There's a breath fog routine that could easily be adapted to simulate smoke.

Share this post


Link to post
Share on other sites
Have a look at TPW MODS. There's a breath fog routine that could easily be adapted to simulate smoke.

Hi tpw, your mod already gets great use on just about every mission i make so thanks for that, and your right the fog breath on a larger scale would be awesome for what i need.

Trouble is i'm a user, not a creator of scripting!

Is there anything you could suggest to create that fog breath effect to emit from a person, rather than just the mouth.

Regards.

Share this post


Link to post
Share on other sites
Is there anything you could suggest to create that fog breath effect to emit from a person, rather than just the mouth.

Trial and error? What have you tried so far? Just because you aren't currently familiar with scripting doesn't mean you can't learn. :) Rip the code open, see how he did the mouth stuff, figure out where it's positioned and move that position.

Share this post


Link to post
Share on other sites
Trial and error? What have you tried so far? Just because you aren't currently familiar with scripting doesn't mean you can't learn. :) Rip the code open, see how he did the mouth stuff, figure out where it's positioned and move that position.

I'll certainly give it a go, but i fear i may come running back here with my tail between my legs:computer:

Share this post


Link to post
Share on other sites
Trial and error? What have you tried so far? Just because you aren't currently familiar with scripting doesn't mean you can't learn. :) Rip the code open, see how he did the mouth stuff, figure out where it's positioned and move that position.

Took your advice and opened up the code....I can see it....I can sort of understand the logic....but, no, outwith my grasp i'm afraid! C'est la vie.

// BREATH FUNCTION

tpw_fog_fnc_breathe =

{

private ["_unit","_int","_nextTime", "_source","_myParticleSource","_mylogic", "_fog","_nextbreath","_time","_factor"];

{

_unit = _x;

// Only bother if unit is alive, close to player and foggy conditions are met

if ((alive _unit) && {tpw_fog_flag} && {_unit distance player < tpw_fog_radius} && {_unit == vehicle _unit}) then

{

_nextTime = _unit getVariable ["myNextBreathTime", -1];

if(_nextTime == -1) then

{

_unit setVariable ["myNextBreathTime", diag_tickTime + (random 3)];

_source = "logic" createVehicleLocal (getpos _unit);

_unit setVariable ["myBreathingParticleLogic", _source];

if(_unit == player) then

{

_source attachto [_unit,[0,0.1,.04], "neck"];

}

else

{

_source attachto [_unit,[0,0.05,-0.08], "pilot"];

};

_unit setVariable ["myBreathingParticleSource", nil];

};

_myParticleSource = _unit getVariable ["myBreathingParticleSource", nil];

if(diag_tickTime >= _nextTime) then

{

if (isNil "_myParticleSource") then

{

_unit setVariable ["myNextBreathTime", diag_tickTime + 0.5];

_mylogic = _unit getVariable "myBreathingParticleLogic";

_fog = "#particlesource" createVehicleLocal (getpos _mylogic);

_fog setParticleParams [

["\a3\Data_f\ParticleEffects\Universal\Universal", 16, 12, 13,0],

"",

"Billboard",

0.5,

0.5,

[0,0,0],

[0,0.0,-0.3],

1,1.275,1,0.2,

[0,0.2,0],

[[1,1,1,0.02], [1,1,1,0.01], [1,1,1,0]],

[1000],

1,

0.04,

"",

"",

_mylogic

];

_fog setParticleRandom [0.5, [0, 0, 0], [0.25, 0.25, 0.25], 0, 0.5, [0, 0, 0, 0.1], 0, 0, 10];

_fog setDropInterval 0.01;

_unit setVariable ["myBreathingParticleSource", _fog];

}

else

{

// Next breath, shorter time for more fatigue

_time = 2 + (random 1);

_factor = _time - ((getfatigue _unit) * _time); // shorter breath when fatigued

_nextbreath = diag_ticktime + 0.5 + _factor;

_unit setVariable ["myNextBreathTime", _nextbreath];

deletevehicle (_unit getVariable "myBreathingParticleSource");

_unit setVariable ["myBreathingParticleSource", nil];

};

};

}

else

{

_unit setVariable ["myNextBreathTime", -1];

deletevehicle (_unit getVariable "myBreathingParticleLogic");

deletevehicle (_unit getVariable "myBreathingParticleSource");

};

} forEach allUnits;

};

Share this post


Link to post
Share on other sites

Hmm, that's far more complex than I'd imagined and has a tie in to CBA to run.

Share this post


Link to post
Share on other sites

That's strange:confused:

I know I posted in this thread with a couple of links provided where you could find A2 an OA mods that have already been made for smoking.

The purpose of me doing that was so you could download them, crack them open and give them a good looking over.

Not sure why someone would delete my post?:butbut:

Share this post


Link to post
Share on other sites
That's strange:confused:

I know I posted in this thread with a couple of links provided where you could find A2 an OA mods that have already been made for smoking.

The purpose of me doing that was so you could download them, crack them open and give them a good looking over.

Not sure why someone would delete my post?:butbut:

Thanks Kommiekat, I'll do some digging myself regarding those A2/OA mods. Cheers.

Share this post


Link to post
Share on other sites

If the FOG code is too much then you can also try just browsing through CfgCloudlets in the config browser in-game. If you see one you like you can test it out with something like this:

// Testing out CfgCloudlet "SecondarySmoke"

_ball = "sign_sphere25cm_F" createvehicle position player;

_fx = "#particlesource" createVehicleLocal [0,0,0];

_fx setParticleClass "SecondarySmoke";

_fx attachto [_ball,[0,0,0]];

This will spawn a red ball near the player and attach the particle effect to it. You can try various BIS particle effects, there's probably one close to what you're after.

Share this post


Link to post
Share on other sites
If the FOG code is too much then you can also try just browsing through CfgCloudlets in the config browser in-game. If you see one you like you can test it out with something like this:

This will spawn a red ball near the player and attach the particle effect to it. You can try various BIS particle effects, there's probably one close to what you're after.

Awesome input tpw! I will give this a go. Thanks.

Share this post


Link to post
Share on other sites
If the FOG code is too much then you can also try just browsing through CfgCloudlets in the config browser in-game. If you see one you like you can test it out with something like this:

// Testing out CfgCloudlet "SecondarySmoke"

_ball = "sign_sphere25cm_F" createvehicle position player;

_fx = "#particlesource" createVehicleLocal [0,0,0];

_fx setParticleClass "SecondarySmoke";

_fx attachto [_ball,[0,0,0]];

This will spawn a red ball near the player and attach the particle effect to it. You can try various BIS particle effects, there's probably one close to what you're after.

:headscratch: Noob Alert! where would i put these lines of code...player's init?

Thanks for your patience with a fool.

Edited by evil-organ

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  

×