Skip to Content
EffectsOverview

Effects

Effects allows you to add custom effects like colored muzzle flashes, tracers, and even animated sprites. It involves some texturing, and JSON work.

In the gun JSON, here’s an example of effects found near the bottom:

{ "name": "packname_gunname", "type": "Gun", "maxAmmoCapacity": 30, "compatibleAmmo": [ "ammocreative", "ammo556" ], "damage": 5, "fireSound": "gunsoundfilename", "fireModes": [ "AUTOMATIC" ], "rpm": 700, "gunRecoilInitialAmplitude": 0.2, "shakeRecoilAmplitude": 0.35, "shakeRecoilSpeed": 2, "viewRecoilAmplitude": 1.2, "phasedReloads": [ ], "effects": [ ], "drawAnimations": [ ] }

Inside "effects" you add sub code blocks with various effects.

Example for plasma muzzle from from the Plasma Rifle in the Doom pack:

"effects": [ { "phase": "firing", "name": "doom_plasma_flash" } ]

Here, one assigned effect to the gun is “doom_plasma_flash” which is a custom muzzle flash effect, playing during the “firing” phase (when the gun fires)

There are other effects, like impact effects (hitscan bullet hitting a surface) and tracers.

Here’s a complete code block with more effects:

"effects": [ { "phase": "hit_scan_acquired", "name": "doom_plasma_ball" }, { "phase": "hit_target", "name": "doom_plasma_hit" }, { "phase": "firing", "name": "doom_plasma_flash" } ]

Here, the first assigned effect to the gun is “doom_plasma_ball” during phase “hit_scan_acquired”. The bullets in VPB use hitscan, so the plasma ball effect applies to that.

The second effect is “doom_plasma_hit” during the phase “hit_target”—meaning ‘play effect doom_plasma_hit when the hitscan hits a surface/mob’.

The third effect is the same doom plasma flash as the last example.

Here’s an example of a realistic gun that uses a tracer:

"effects": [ { "phase": "hit_scan_acquired", "name": "tracer" } ]

Here, the effect “tracer” plays during “hit_scan_acquired”, same phase as “doom_plasma_ball”.

Note: you cannot add conditions to these effects.

Other Work

Aside from coding, you must also create new json files for your effects. Tutorials for this are handled in the next pages.

Last updated on