Not logged inOpenClonk Forum
Up Topic [Particles] Fire

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Zapper

>Ah thanks I wasn't able to see the difference between PV_Random() and RandomX().


Random() draws a random number when you call it. PV_Random tells the particle system to draw random numbers (for every single particle) later, when the particles are created.
For example:
var random = RandomX(-10, 10);
for (var i = 0; i < 100; ++i)
    CreateParticle(..., random, ...);

This would create 100 particles with the same random number (for example the same speed). With var random = PV_Random(-10, 10); every particle would have a new random speed.

>Most of the particles have to change their size depending on the current value of GetCon()


True. If it only affects the size, you could set only the size in every timer call again (effect.yellowspark.Size = ...). But you are right: that only makes sense when the fire is finished :)

>On the other hand Fx*Start gets triggered quite often as well when I remember correctly


Fx*Start with temp = false is called exactly once when the effect starts. When effects with priorities are added and removed later, more Fx*Start calls can happen. They will always have temp = true, though.

That's why I wrote if (temp) return; in my example above!

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill