Particles Tutorial: Difference between revisions
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "ASLtoAGL" to "ASLToAGL") |
||
Line 17: | Line 17: | ||
=== Create a particle source === | === Create a particle source === | ||
<sqf>private _particleSource = "#particlesource" createVehicleLocal | <sqf>private _particleSource = "#particlesource" createVehicleLocal ASLToAGL getPosASL player;</sqf> | ||
{{Feature | Informative | A particle source is '''[[Multiplayer Scripting#Locality|local]]''' (and all the particle commands take a local argument too), hence [[createVehicleLocal]] usage.}} | {{Feature | Informative | A particle source is '''[[Multiplayer Scripting#Locality|local]]''' (and all the particle commands take a local argument too), hence [[createVehicleLocal]] usage.}} |
Revision as of 17:58, 29 July 2022
Basics
A particle is a (to some extent, non-physical) 2D plane that always faces the camera, or (more rarely) a 3D model. It can be used to simulate ambient effects, such as dust, fire, water splash, wood splinters and even rock debris.
A particle source is a non-physical object that creates particles at a certain rate and position/velocity.
A particle (as well as a particle source) is local to the computer where the script has been called; one player could see smoke while another could see through without any issue.
How to
Create a particle source
Set source class
Set source parameters
See ParticleArray for details on the array format.
Set source drop interval
Set source drop circle
Set source random values
Set source fire properties
Delete source
Use the drop command
The drop command only drops one particle. If multiple ones are needed, a loop (for, while) must be used.
See ParticleArray for details on the array format.
Design Workflow
In order to determine one particle behaviour, a simple drop usage in the Debug Console can do; but seeing the complete end result can be another task at hand.
Using a Script
One way to design your effect is to have an SQF file, named e.g "particles.sqf", filled with your code:
and run with
This format deletes all previous effects and still allows you to use the Debug Console in order to adjust particle source settings thanks to the usage of global variables (here, ps1 and ps2)
Using a Mod
Emitter 3Ditor (a real-time WYSIWYG particle source editor) adds and uses particle and light emitters in your scenarios without any scripting nor mod dependency.
Steam page - Forums post
Full examples
Burning Vehicle Fire Look-Alike
Fire
Floating Orb
Heavy Oily Smoke (Small)
Heavy Oily Smoke (Medium)
Heavy Oily Smoke (Large)
Light Wood Smoke (Small)
Light Wood Smoke (Medium)
Light Wood Smoke (Large)
Mixed Smoke (Small)
Mixed Smoke (Medium)
Mixed Smoke (Large)
Rock Shower
See also
- Category:Particle System
- ParticleArray - particle array format