Skip to reading
Shaders, Effects & Layered Scenery

35. Trigger an explosion more than once

Edition 0.86.4.0

Revised 0.86.4.0 edition with new supplements; earlier 0.86.3.4 lessons and screenshot labels are retained within the supplied PDF.

Download PDFView PDF page

An Explosion is a visible burst. It can be combined with sound, a light flash, camera shake and gameplay consequences, but those are separate actions. The recipe’s smoke can last longer than the initial fireball.

1. Create a Particle object named Single Explosion, ID blast, and choose Explosion.

2. Leave One Shot on, Explosiveness at 1 and Preprocess at 0.

3. For a small impact, start Amount 50, Size 0.12, Velocity Max 2 and Lifetime 0.5.

4. Clear Emit In Game if the blast should wait for a trigger. Apply and save.

5. In that trigger’s action list, turn particle.enabled off and then on for blast.

6. Add Play Sound or a short Zoom Blur as separate steps. Restart Test Scene and trigger the event twice.

Code example
[
  {"type":"ChangeObjectProperty","entityId":"blast",
   "property":"particle.enabled","value":false},
  {"type":"ChangeObjectProperty","entityId":"blast",
   "property":"particle.enabled","value":true}
]

The smoke layer lasts roughly 1.6 times the selected Lifetime in the bundled recipe. Wait for the actual tail when deciding when to remove a prop, cut away or restore the scene.

Re-triggering restarts the effect; it does not create a separate independent blast instance each time. Use separately authored emitters when several overlapping blasts must continue independently.

Page 39 of 93Permalink
Go to page