L4D2 Custom Particle Effects Tutorial
Particle systems are stored in PCF files, where one PCF file typically contains multiple particle systems that relate to each other (for example, blood_fx.pcf). All PCF files must be registered in a manifest file in order to be recognized in-game. In L4D2, you can choose between two types of manifests:
Also consider the following:
- Official particle (PCF) files can be extracted from pak01_dir VPK and placed in the particles directory externally (outside of the VPK).
- The Particle Editor only reads PCF files stored externally. Hammer Particle Browser needs particles_manifest.txt in addition to PCF files to be stored externally.
- In game, PCF files are read externally if none exist within the official VPK and must always be registered with the manifest.
- particles\particles_manifest.txt needs to be packed and read via an add-on VPK or simply use a per-map manifest (maps\<map name>_particles.txt) without packing.
The goal is to create a simple custom particle effect that will appear in-game and while in Tools Mode (located in the Left 4 Dead 2 Authoring Tools menu). Central to the entire process is the Particle Editor. The Particle Editor is an interface found in Tools Mode that acts as a unified work space for particle effect authoring. Along with the Particle Editor, the Hammer Particle Browser and vpk.exe will also be used.
Particle preview in Hammer
Create a simple particle
Since the Particle Editor does not rely on any manifest, a new PCF file along with new particles can be created first. A good particle to start with is a particle that is known to appear in-game without any issues.
Please see the Particle System Overview for details on how to create a new particle that spews out white sprites radially from a single point.
If you do not want to create a particle from scratch, feel free to also try a modification of an official particle. Remember to save the PCF file with a different name. The PCF files is saved in the root of the particles folder by default.
Create the manifest
For the Particle Browser, edit the external particles\particles_manifest.txt in order to register the new PCF file name. Simply follow the entries as an example. Finally, make sure the text file is saved before refreshing the Particle Browser in Hammer.
To see the new particle in-game, create particles_manifest.txt as a simple VPK in the addons folder or create a per-map particle manifest maps\<map name>_particles.txt. Please see the L4D2 Campaign Add-on Tutorial for details on VPK authoring.
Add the particle to a map
Add an info_particle_system entity in a map, where the entity is pointing at a specific particle system. The entity properties window also conveniently provides access to the Particle Browser under the keyvalue Particle System Name.
In this case, choose a reliable test custom particle system, allow the entity to start active, and compile the map. The particle should show up in-game.
Now you're ready to work on your particle within the Particle Editor! Set cvar
sv_lan 1 and load the test map containing the custom particle system. Any changes to the custom particle should update within the map loaded. This allows authors to iterate on custom particles in a very efficient manner. Please see the troubleshooting section if there are any difficulties with the in-game preview.
Shipping the particle
When ready to ship the particle in a campaign add-on, simply pack the custom PCF file along with either the modified particles_manifest.txt or per-map manifest in their proper directories. Please see the L4D2 Campaign Add-on Tutorial for more details. See how the VPK holds up by itself, free of any externally stored assets. Congratulations on shipping!
- Official particles or custom particles do not show up as a choice in the Particle Browser.
- The preview window for a particular particle system does not appear to show any activity.
- It is difficult to dismiss the Map Unplayable! error while in tools mode.
- One quick way is to use the command
cl_drawhud 0. Please see Common L4D Mapping Problems for more details on the issue.
- Particle effect fails to update in the map.
- If a particle effect fails to update in-game despite there being a change in one of the components or properties, a series of console commands can reset the info_particle_system entities that exist in the world:
ent_fire info_particle_system stop;wait 120;ent_fire info_particle_system start
- Particle fails to show up in-game.
- There is more than one reason why it may not show up. Usually this is solved by eliminating a cause one by one. For instance, check if the particle needs to be started manually. Also see if a reliable custom particle, can even show up in-game.
- Category:Particle System
- Animated Particles
- Left 4 Dead 2 Level Creation
- List of L4D2 Particles
- Particle Editor