tsg onVehicleHonk
A script module for detecting vehicle honks or firing actions without causing unintended weapon side effects.
Last updated
A script module for detecting vehicle honks or firing actions without causing unintended weapon side effects.

tsg onVehicleHonk is a script module designed to detect when a vehicle driver honks or fires. This module provides a more reliable alternative to previous methods that required nullifying weapon damage, which could lead to unintended consequences for the driver.
The module avoids the side effects of traditional weapon-based detection by utilizing the Spawn Mode Object node's capabilities. Instead of providing a weapon that might accidentally deal damage, the system duplicates a pre-placed weapon that has been configured with a nearly empty magazine that actually fires no projectile, but still processes the On Weapon No Ammo node.
A specific weapon, such as a Plasma Cannon, is placed in the map with its Spare Energy set to 0.001. This configuration ensures the weapon has a single "blank" shot remaining. When the driver fires, the On Weapon No Ammo node is triggered, which the script uses to detect the action. The logic then filters these events to ensure the trigger is specifically linked to a weapon held by a vehicle. The script also handles the cleanup of this weapon if the vehicle is destroyed.
To use this module, it must be marked to apply the honk detection to a vehicle. During the application process, the script nulls out the existing weapon in the vehicle's inventory.
While the driver may still experience local visual and auditory feedback of the honk, the action is not visible or audible to other players. Users can adjust the delay between successive honk detections by utilizing the vehicleShotCadence variable.
By using a low-energy duplicate weapon instead of a damage-disabled weapon, drivers can maintain their full damage potential while still allowing for reliable honk detection.
Discord thread: tsg onVehicleHonk
Okom
Last updated