Particle children

Particle systems, just like other entities, can have parent-child relationships. The entity info_particle_system can be parented to any entity, but particle systems within a .pcf file can also be parented to each other. To demonstrate this, let's create a quick smoke effect to add to the fire.

Modifying existing particle systems

Instead of creating a whole other smoke effect from scratch, we can just copy and modify the fire particle. In Particle Editor, select the particle system myfire01, and click on the Copy button. Type mysmoke01 for the new particle name and click on OK.

Modifying existing particle systems

Now we have an exact copy of our fire particle system with a new name. Select the new particle system and let's turn it into a smoke system.

The first thing we want to change is the material. In the main properties, browse for the material particle | smoke1 | smoke1_additive.vmt. You'll see the fire change to smoke. But we're not done quite yet. When there is a fire, smoke doesn't appear immediately; it forms gradually and fades out slowly. Let's recreate that.

In the operator tab, remove the alpha fade and decay operator properties, and add alpha fade in random and alpha fade out random. Set both the minimum values to 0.2, and set the maximum values to 0.5. Leave the rest of the settings at default. You should see the smoke fade in and out.

Modifying existing particle systems

We also know that smoke has the tendency to expand as it fades out. We can add a property that will dynamically change the radius of the particle. Add a radius scale property in the Operator tab, and change the following properties:

  • Start_time: 0.5
  • End_time: 1
  • Radius_start_scale: 1
  • Radius_end_scale: 2
  • Scale_bias: 0

The very last thing to do to our smoke sprite is to change the lifetime. The smoke will linger longer than the flames. So in the lifetime_random initializer, change lifetime_min to 2.75 and lifetime_max to 3. We now have a pretty good-looking smoke effect. Let's combine it with the fire.

Create a new particle system called myfire_and_smoke01. In the Children tab, add myfire01 and mysmoke01 to the list—that's it! You're done. Check the preview tab to see both your particle effects overlaid in a pretty convincing smoky fire.

Modifying existing particle systems
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.174.253