Flashlight (script event)

Game class

This event operates on an instance of the game class type {{{gameclass}}}

Description

Enables/disables the muzzle flash of a weapon entity.

Usage

void flashlight( float enable )

Parameters

  • 1 or true - enable
  • 0 or otherwise false - disable

Examples

 none

Notes

In the case of weapon_flashlight , the “mtr_flashShader” key/value pair is set to “lights/flashlight5”. The reason for this is clear if you understand how the flashlight works.

Essentially it’s using the muzzle flash light inherent to all weapons as the flashlight’s bulb. And since the material shader used doesn’t make use of shader parms or time to determine the light’s duration as is done with other weapons, a script event (this event) is needed to toggle the light on and off.

The key point being that this event is useless unless you intend to toggle muzzle flashes off or give other weapons flashlights in which case you’ll need to edit the weapon’s entity declaration and more specifically the “mtr_flashShader” key/value pair.