-
Notifications
You must be signed in to change notification settings - Fork 9
Custom Weapon Events
Events work similarly to animation events in weapon models. The difference is you have far more event types and trigger conditions available. There is a limit to how many events a weapon can have to keep network data small. Check the console for errors when picking up the weapon.
Below is the syntax for an event section header:
[
Example:
[event.primary_clip_is_1.weapon_anim]
This event would play a weapon animation when the primary clip equals 1 after an attack.
Conditions describe when the event will trigger.
| Condition | Description |
|---|---|
| primary_attack secondary_attack tertiary_attack primary_alt_attack |
Trigger when an attack begins, unless the attack fails (underwater, no ammo). |
priamry_clip_is_Xsecondary_clip_is_ X
|
Trigger when the clip is set to X after an attack. X = 0-31 |
| primary_clip_is_odd secondary_clip_is_odd |
Trigger when the clip is an odd number after an attack. |
| primary_clip_is_even secondary_clip_is_even |
Trigger when the clip is an even number after an attack. |
| primary_clip_is_not_empty secondary_clip_is_not_empty |
Trigger when the clip is not 0 after an attack. |
| primary_attack_charge secondary_attack_charge |
Trigger when the attack begins charging. Delayed events are cancelled when charging stops or fails. |
| primary_attack_overcharge secondary_attack_overcharge |
Trigger when the attack is overcharged. Overcharge time is configured in [primary_attack] / [secondary_attack] (link). |
| primary_attack_start secondary_attack_start |
Trigger once when an attack starts. Does not trigger again until the attack button is released and pressed again. |
| primary_attack_stop secondary_attack_stop |
Trigger when an attack finishes or fails. |
| primary_attack_fail secondary_attack_fail |
Trigger when the attack fails (underwater, no ammo). |
| reload | Trigger when a reload begins. |
| reload_empty | Trigger when a reload begins with an empty clip. |
| reload_not_empty | Trigger when a reload begins with a non-empty clip. |
| reload_finish | Trigger when a reload finishes. |
| deploy | Trigger when the weapon is deployed. |
| bullet_fired | Trigger after a bullet is fired. Can be used to ensure things like recoil events don't affect the bullet accuracy. |
| laser_on | Trigger when the laser is turned on. |
| laser_off | Trigger when the laser is turned off. |
| zoom_in | Trigger when activating the scope. |
| zoom_out | Trigger when deactivating the scope. |
| impact_primary_any impact_secondary_any impact_tertiary_any impact_primary_alt_any |
Trigger when a bullet/projectile/beam impacts anything. The event position is set to the point of impact. |
| impact_primary_world impact_secondary_world impact_tertiary_world impact_primary_alt_world |
Trigger when a bullet/projectile/beam impacts the world. The event position is set to the point of impact. |
| impact_primary_monster impact_secondary_monster impact_tertiary_monster impact_primary_alt_monster |
Trigger when a bullet/projectile/beam impacts a monster. The event position is set to the point of impact. |
All events share this attribute. It won't be included in the event type tables.
| Attribute | Type | Default | Description |
|---|---|---|---|
| delay | time | 0ms | Time to wait before triggering the event. |