-
Notifications
You must be signed in to change notification settings - Fork 9
Custom Weapon Event Types
Valid event types used as the 3rd component of an event section header. See the events wiki for more info. See the Attribute Types wiki for explanations of the Type values.
Play a sound that everyone can hear. The sound is emitted from the player, which means other player sounds may be interrupted depending on the channel you pick.
If you don't configure anything except volume and a single sound path then the event data will be much smaller. The defaults are set up for local weapon sounds, and should be used when converting model animation events to config events. Converting model events is recommended so that other players can hear them, and you if in thirdperson mode. Plus, model events are buggy and sometimes trigger multiple times and overlap.
| Attribute | Type | Default | Description |
|---|---|---|---|
| flags | List of flags | Valid flags:chargeup_pitch = Sound pitch increases with attack charge progress |
|
| volume_for_ai | string | silent | How loud the sound is for NPC reactions. Valid values:silent = No NPC reactionsquiet = 200 units.normal = 600 units.loud = 1000 units.Units are rough estimates. Monsters can configure hearing sensitivity or react to more sounds if they choose. |
| channel | string | static | Valid values:auto = Automatically picks a free channel(?).weapon = Most weapon sounds use this.voice = Used for water transition sounds.item = Used for item pickups.body = Used for projectile impact sounds.static = Sounds played on this channel can be stacked without cancelling each other. |
| sound sound2 sound3 sound4 sound5 sound6 sound7 sound8 |
string | Path to the sound file to play. A sound is selected randomly from one of these 9 attributes. | |
| volume | float | 1.0 | sound volume (0.0 - 1.0). 1.0 = 100%. |
| attenuation | float | 2.0 | How quickly the volume fades with distance. Common values:0 = No volume fade.0.8 = Attack sounds.2.0 = Local sounds (reloading). |
| pitch_min | integer | 100 | Minimum value for pitch randomization. |
| pitch_max | integer | 100 | Maximum value for pitch randomization. |
| distant_sound | string | none | A muffled gunshot noise for players on the other side of the map. Valid values:none = No distant sound.distant_9mm = Light tapping noise.distant_357 = Deeper tap.distant_556 = Deep tap / small explosion.distant_boom = Big explosion. |
Eject a bullet casing.
| Attribute | Type | Default | Description |
|---|---|---|---|
| model | string | Path to a model to use as the shell. | |
| sound | string | shell | Sound effects to use for the shell. Valid values:none = No sounds.shell = Small bullet casingshotshell = Shotgun shell. |
| offset | vector | 0 0 0 | Offset from the player's head to eject the shell, given in forward, up, and right units. Don't use extreme values here because this affects both the third-person and first-person offsets. |
| velocity | vector | 25 125 50 | Velocity for the shell given in forward, up and right units. |
| direction_randomness | integer | ~20 | Amount to randomize direction (0-255). |
| speed_randomness | integer | ~20 | Amount to random speed to add (0-255). |
Rotate the player's view.
| Attribute | Type | Default | Description |
|---|---|---|---|
| flags | List of flags | See Recoil Flags for valid values. | |
| angles | vector | 0 0 0 | Degrees to rotate the player's view (vertical, horizontal, and tilt). |
| Flag | Description |
|---|---|
| set_angles | Set the player angles to the given offset from center. Does not stack recoil. No randomization. |
| add_angles | Add angles to current. Allows stacking recoil. No randomization. |
| no_recovery | Player's view does not return to center automatically (minigun behavior). |
| only_when_ducking | Apply this recoil only if ducking. |
| only_when_standing | Apply this recoil only if standing. |
If neither set_angles nor add_angles are enabled, then the recoil is set to a random value between the positive and negative values of each angle. For example: 2 0 0 would add a random vertical recoil between -2 and 2, and the recoil would not stack with previous recoil.
Change the weapon model body. Used in the M249 to shorten the belt as you run out of ammo.
| Attribute | Type | Default | Description |
|---|---|---|---|
| new_body | integer | 0 | Body value. |
Play a weapon animation.
| Attribute | Type | Default | Description |
|---|---|---|---|
| anims | List of integers | 0 | Animations to select from. Up to 8 indexes can be listed here. |
| flags | List of flags | 0 | Valid values:no_reset = Don't restart the animation if the desired anim is already playing.thirdperson_model = Animate the third-person weapon model, not the first-person one.play_in_order = Select from anims in order, not randomly. |
| hand | string | both | Hand to play the animation for, if in akimbo mode. Valid values:both = Both hands.left = Left hand.right = Right hand.trigger = Hand which triggered this event. |
Shoot bullets as a hitscan.
| Attribute | Type | Default | Description |
|---|---|---|---|
| count | integer | 0 | Number of bullets to fire (0-255). |
| burst_delay | time | 0ms | Delay between bullets when firing more than one. |
| damage | integer | 0 | Damage dealt by each bullet. |
| accuracy | float | 0.00 | Degrees of accuracy for each bullet. |
| tracer_color | string | default | Color of the bullet tracers. Valid values:white = Neon white.red = Neon red.green = Neon green.blue = Neon blue.blue2 = Pale purple-ish blue.default = Color set by tracerred/tracergreen/tracerblue client cvars.yellow = Similar to orange.orange = Most saturated orange.orange2 = Slightly pinkish.orange3 = Identical to orange2.orange4 = Slightly brighter.tan = Similar to orange. |
| tracer_frequency | integer | 0 | Draw a tracer for every N bullets fired. 0 = No tracers. |
| flash_size | string | none | How bright the muzzle flash is, for player illumination. Seems to be an unimplemented feature. Most stock weapons use normal or bright flashes. none disables the yellow light muzzle flash effect. |
| flags | List of flags | Valid flags:dynamic_spread = Accuracy widens while moving and tightens while crouching.no_decal = Don't apply impact decals.no_sound = Don't play impact sounds. |
Shoot a laser beam.
| Attribute | Type | Default | Description |
|---|---|---|---|
| flags | List of flags | Valid flags:spiral = Spiral beam effect (egon).opaque = Disable beam transparency.fade_in = Beam is more transparent near the weapon.fade_out = Beam is more transparent near the impact point. |
|
| attachment | integer | 0 | Model attachment to draw the beam from. This is used for both the first-person and third-person models. |
| sprite | string | Path to a sprite to draw the beam with. | |
| life | time | 0ms | How long to display the beam. 0 = Constant beam (egon behavior). |
| accuracy | float | 0.00 | Accuracy in degrees. |
| damage | integer | 0 | Damage dealt per impact. |
| distance | integer | 0 | Max range of the beam. |
| frequency | time | 0ms | How often to update the beam if in constant mode (life is 0). |
| id | integer | 0 | ID used to update the beam in future events, for constant beams. 0 = Always create a new beam. |
| animate | string | disabled | How to animate beam properties. Valid values:disabled = Don't animate nor use alternate properties.toggle = Instantly switch between properties.linear = Linear interpolation.linear_toggle = Linear interpolation to alternate properties, then instantly set original properties.ease_in_out = Smoothly accelerate/decelerate between properties. |
| animate_time | time | 0ms | Duration of the animation loop. |
| width | integer | 0 | Width of the beam (0-255). |
| noise | integer | 0 | Distortion of the beam (0-255). |
| scroll_rate | integer | 0 | Scroll rate of the beam sprite (0-255). |
| color | RGBA | 0 0 0 0 | Color of the beam. |
| width_alt | integer | 0 | Alternate width for animation. |
| noise_alt | integer | 0 | Alternate distortion for animation. |
| scroll_rate_alt | integer | 0 | Alternate scroll rate for animation. |
| color_alt | RGBA | 0 0 0 0 | Alternate color for animation. |
| impact_sprite | string | Path to a sprite to display at the impact point. | |
| impact_sprite_fps | integer | 0 | Framerate of the impact sprite (0-255). 10 = 1 FPS. |
| impact_sprite_scale | integer | 0 | Size of the impact sprite (0-255). 10 = 100%. |
| impact_sprite_color | RGBA | 0 0 0 0 | Color of the impact sprite. |
Shoot a slow-moving physics-based projectile. Not predicted by clients. This is here for the simple cases. You might want to code up something custom instead, and just use this event to spawn the projectile.
| Attribute | Type | Default | Description |
|---|---|---|---|
| type | string | Type of projectile to spawn. Valid values:ar_grenade = 9mmAR grenade.banana_bomb = Banana bomb from Sven Co-op. (unimplemented)crossbow_bolt = Crossbow bolt.displacer_portal = Displacer portal.hand_grenade = Hand grenade.Hornet = Alien hornet. (unimplemented)hvr = Apache rocket. (unimplemented)mortar = Mortar.rpg = Player rocket.shock_beam = Shock rifle beam. (unimplemented)weapon = Throw the active weapon. (unimplemented)tripmine = Place a tripmine. (unimplemented)other = Other entity, specified with entity_class.custom = Same as other but with more config options. |
|
| entity_class | string | classname of the entity to spawn. This can be a built-in entity or something new you've coded. | |
| flags | List of flags | Valid flags:no_bubbles = Don't create a bubble trail when moving through water.static_angles = Don't automatically orient the projectile to face the direction it's moving.is_hook = Projectile is a hook attached to the player (grapple weapon). Unimplemented. |
|
| accuracy | float | 0.00 | Accuracy of the projectile. |
| hit_world_action | string | impact | What to do when impacting the world. Valid values:impact = Destroy the projectile.bounce = Bounce away from the surface.attach = Stick to the surface. |
| hit_monster_action | string | impact | What to do when impacting a monster. See hit_world_action for valid values. |
| speed | integer | 0 | How fast the projectile moves when spawned. |
| life | time | 0ms | How long the projectile lives before despawning. 0 = infinite. |
| elasticity | float | 0.00 | How bouncy the the projectile is. 1 = No velocity lost when bouncing. 0.5 = Half velocity lost. |
| gravity | float | 0.00 | Percentage of gravity to apply to the projectile. 1 = 100%. |
| air_friction | float | 0.00 | How much velocity is lost per tick when traveling through air. |
| water_friction | float | 0.00 | How much velocity is lost per tick when traveling through water. |
| hull_size | float | 0.00 | How large the projectile hitbox is. 2 = 4x4x4 bounding box. |
| direction | vector | 0 0 1 | Direction of the projectile relative to aim direction, given in right, up, and forward units. |
| model | string | Path to the model to use as the projectile. | |
| move_sound | string | Path to the sound to play while the projectile is moving. | |
| damage | integer | 0 | Damage to apply when touching something. |
| damage_type | List of flags | Type of damage to apply. Valid flags:crush, bullet, slash, burn, freeze, blast, club, shock, sonic, energybeam, nevergib, alwaysgib, drown, paralyze, nervegas, poison, radiation, drownrecover, slowburn, slowfreeze, mortar, sniper, medkitheal, launch, shock_glowThese flags mirror the damage type macros. |
|
| sprite | string | Path to a sprite to attach to the model. | |
| sprite_color | RGBA | 0 0 0 0 | Color of the sprite attachment. |
| angles | vector | 0 0 0 | Initial orientation of the projectile, relative to aim angles. |
| angular_velocity | vector | 0 0 0 | Spin speed of the projectile (vertical, horizontal, tilt). |
| position | vector | 0 0 0 | Projectile offset relative to player head position, given in right, forward, and up units. |
| player_vel_inf | vector | 0 0 0 | How much player velocity is added to the projectile velocity, given in right, up, and forward percentage. 1.0 = 100%. |
| follow_mode | string | Unimplemented. | |
| follow_radius | float | 0 | Unimplemented. |
| follow_time | vector | 0 0 0 | Unimplemented. |
| trail_sprite | string | Path to sprite to use as a beam trail. | |
| trail_life | time | 0ms | Time before a trail section fades out, or the length of the trail. |
| trail_width | integer | 0 | Width of the trail beam (0-255). |
| trail_color | RGBA | 0 0 0 0 | Color of trail beam. |
Push the player around.
| Attribute | Type | Default | Description |
|---|---|---|---|
| push_force | integer | 0 | Amount of velocity added to the player. |
| percent_back | float | 0.00 | Percentage of push force added backwards from the aim direction (-1.0 - 1.0). 1.0 = 100%. |
| percent_right | float | 0.00 | Percentage of push force added to the right of the aim direction (-1.0 - 1.0). 1.0 = 100%. |
| percent_up | float | 0.00 | Percentage of push force added up from the aim direction (-1.0 - 1.0). 1.0 = 100%. |
| percent_global_up | float | 0.00 | Percentage of push force added towards the sky (-1.0 - 1.0). 1.0 = 100%. |
Toggle weapon states.
| Attribute | Type | Default | Description |
|---|---|---|---|
| toggle_mode | string | toggle | Toggle operation. Valid values:off = Toggle state(s) off.on = Toggle state(s) on.toggle = Toggle state(s) opposite of what they are now. |
| toggled_states | List of flags | States to toggle. Valid flags:primary_alt = Alternate primary fire settings.laser = Weapon laser.akimbo = Akimbo mode.can_akimbo = The ability to toggle akimbo. (e.g. off when not holding 2 of the same weapon). |
Toggle weapon scope, with up to 2 levels of zoom.
| Attribute | Type | Default | Description |
|---|---|---|---|
| zoom_fov | integer | 0 | Field of view for the 1st level of zoom. |
| zoom_fov2 | integer | 0 | Field of view for the 2nd level of zoom Disabled if set to 0. |
Cooldown weapon action(s).
| Attribute | Type | Default | Description |
|---|---|---|---|
| time | time | 0ms | How long to cooldown the action(s) for. |
| actions | List of flags | Which actions to cooldown. Valid flags:primary = Primary attack.secondary = Secondary attack.tertiary = Tertiary attack.idle = Idle animations. |
Change player gravity. Not yet predicted by clients.
| Attribute | Type | Default | Description |
|---|---|---|---|
| gravity | integer | 0 | Percentage of gravity to apply. 1000 = 100%. 0 = default. |
Light up the area around the player.
| Attribute | Type | Default | Description |
|---|---|---|---|
| color | RGB | 0 0 0 | Color of the light. |
| radius | integer | 0 | Max distance of the light (0-255). |
| life | integer | 0 | How long to display the light (0-255). 10 = 1 second. |
| decay_rate | integer | 0 | How fast to shrink the light (0-255). 0 = Light doesn't change size. |
light up the player with a yellow light coming from the weapon muzzle.
| Attribute | Type | Default | Description |
|---|---|---|---|
| flash_size | string | none | How bright the muzzle flash is, for player illumination. Seems to be an unimplemented feature. Most stock weapons use normal or bright flashes. none disables the yellow light muzzle flash effect. |
Hide the weapon laser temporarily.
| Attribute | Type | Default | Description |
|---|---|---|---|
| time | time | 0ms | How long to hide the laser. |
Sprite explosion effect created at the impact point of a bullet/projectile/beam.
| Attribute | Type | Default | Description |
|---|---|---|---|
| sprite | string | Path to the sprite to display for the effect. | |
| count | integer | 0 | Number of sprites to spawn (0-255). |
| scale | integer | 0 | Size of the sprites (0-255). 10 = 100%. |
| speed | integer | 0 | Intensity of the explosion (0-255). Sprites move away from the impact surface. |
| speed_randomness | integer | 0 | How much to randomize speed and direction of the sprites (0-255). |
Apply a decal to the impact surface of a bullet/projectile/beam.
| Attribute | Type | Default | Description |
|---|---|---|---|
| texture | string | Name of the texture to use for the decal (from decals.wad). | |
| flags | List of flags | Valid flags:particles = Display gunshot particles when creating the decal. |
A server-side event that you implement in your own code. This event merely passes parameters to your CustomServerEvent() override.
| Attribute | Type | Default | Description |
|---|---|---|---|
| type | integer | 0 | Type of event to create (0-255). An enum created by you. |
| iuser1 iuser2 iuser3 iuser4 |
integer | 0 | integer parameters. |
| fuser1 fuser2 fuser3 fuser4 |
float | 0 | float parameters. |
| vuser1 vuser2 vuser3 vuser4 |
vector | 0 0 0 | vector parameters. |
| suser1 suser2 suser3 suser4 |
string | string parameters. | |
| cuser1 cuser2 cuser3 cuser4 |
RGBA | 0 0 0 0 | color parameters. |
| euser1 euser2 euser3 euser4 |
integer | 0 | entity parameters. Not implemented. |