Home   Help Search Login Register  

Author Topic: How to get a particle flame and smoke to die out slowly  (Read 1159 times)

0 Members and 1 Guest are viewing this topic.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
I know I know, the answer it not advanced but this is particles scripting so  :angel:

My searches came up empty with any burning scripts made with particles (for ArmA) so I have to ask someone to help me here.
I'm a complete maths retard so I was wondering if someone might help me with a 'formula' for getting a particle created flame and smoke to die out slowly instead of just ending abruptly (you know, like when you delete the particle source).
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: How to get a particle flame and smoke to die out slowly
« Reply #1 on: 04 Apr 2008, 10:30:20 »
Each particle has a life-time, number of seconds to wait before it vanishes. Along its life-time the particle might change its color and size, and for that purpose you setup to different arrays, the sizes array and the colors array. The particle will move from first size to last size along its life-time,same with colors. So, for example, you set the sizes smaller and smaller, and the alpha of last color set to 0.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: How to get a particle flame and smoke to die out slowly
« Reply #2 on: 04 Apr 2008, 10:53:44 »
Not exactly sure that we're on the same page :scratch:

I do know how to make a single particle 'fade away' (which I understood you were talking about ? ) but I was talking about slowly looping the particle parameters and they parameters such as lifetime and size (maybe weight etc. also to make it act like a real dying flame) would be subtracted a little from the previous loop.

The problem is that I have the loop I'm talking about, it works just fine but the actual maths part is crap; the result just looks abolutely horrible in-game but it's probably due to me trying to change too many parameters (and/or chaning them the wrong way) I guess:
Code: [Select]
_tickTocks = (_dieOut-(_dieOut/2));

for [{_tickTock=_tickTocks},{_tickTock>0},{_tickTock=_tickTock-0.8}]
 do {
{_x setParticleParams [["\Ca\Data\ParticleEffects\FireAndSmokeAnim\FireAnim.p3d", 8, 6, 8], "", "Billboard", 1, (1*((_tickTock/_tickTocks)/random 2)),
   [0, 0, 0], [0, 0, 0.75], 0, (11+((_tickTock/_tickTocks)/random 15)), 8, 0.075, [(1.2*(_tickTock/_tickTocks)),(2*(_tickTock/_tickTocks)),(1.5*(_tickTock/_tickTocks))],
   [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", ""];
}forEach _sour;

{_x setParticleParams [["\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", 8, 3, 8], "", "Billboard", 1, (2*((_tickTock/_tickTocks)/random 2)),
   [0, 0, 0], [0, 0, 0.75], 0, (10+((_tickTock/_tickTocks)/random 15)), 7.8, 0.075, [(0.2*(_tickTock/_tickTocks)),(0.5*(_tickTock/_tickTocks)),(0.8*(_tickTock/_tickTocks)),(0.7*(_tickTock/_tickTocks)),(0.8*(_tickTock/_tickTocks))],
   [[0.1, 0.1, 0.1, 0], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08, 0.03], 1, 0, "", "",""];
}forEach _sourS;

{_x setLightBrightness (0.04*(_tickTock/_tickTocks))} forEach _sourL;
sleep 0.5;
    };
Some explanations:
_dieOut = 120+(random 80)
_sour = array oif particlesources for fire
_sourS = array of particlesources for smoke
_sourL = array of lights
The initial parameters are set earlier in the script
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.