Prop car alarm: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added note about Enable/Disable and a tip on how to increase the alarm sounds length.)
 
(21 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{l4d series point|prop_car_alarm}} This class is the same as [[prop_physics]], but with special outputs used specifically for a car alarm, to be used with [[Prop_car_glass]] for its glass.<br>
{{CD|CCarProp}}
This entity can sense people firing their weapons next to it and has outputs for that event. It will call a panic event the moment it's assigned model is touched or damaged, but then it will stop functioning like a car alarm and will effectively just be a [[prop_physics]]
{{this is a|model entity|name=prop_car_alarm|series=Left 4 Dead}} This class is the same as [[prop_physics]], but with special outputs used specifically for a car alarm, to be used with [[prop_car_glass]] for its glass.
{{Note|The Enable/Disable inputs will disable or enable the ability to trigger alarms. However, the [[Prop_car_glass]] entity that goes along with this car will not be affected by this and needs to be disabled separately, by swapping it with a generic [[prop_dynamic]] using the generic class version for this car, which does not blink.}}
{{Tip|By default the alarm sounds for about 30 seconds, then fires the <code>OnCarAlarmEnd</code> Output. You can make this time longer by instead using an <code>OnCarAlarmStart</code> output which fires a relay after X amount of seconds, which will then fire whatever outputs <code>OnCarAlarmEnd</code> was firing.}}


== Keyvalues ==
This entity can sense people firing their weapons next to it and has outputs for that event. It will call a panic event the moment its assigned model is touched or damaged by Survivors, but then it will stop functioning like a car alarm and will effectively just be a [[prop_physics]].
{{KV BasePropPhysics}}
{{KV RenderFields}}
{{KV EnableDisable}}


== Flags ==
In {{L4d2|4}} there is a [[Prefab]] of this car, to be used as [[func_instance]], in {{file|sdk_content/mapsrc/instance/prop_car_alarm|vmf}}
{{Fl BasePropPhysics}}
{{note|The Enable/Disable inputs will disable or enable the ability to trigger alarms. However, the [[prop_car_glass]] entity that goes along with this car will not be affected by this and needs to be disabled separately, by swapping it with a generic [[prop_dynamic]] using the default glass version for this car, which does not blink.}}
{{tip|By default the alarm sounds for about 30 seconds, then fires the <code>OnCarAlarmEnd</code> Output. You can make this time longer by instead using an <code>OnCarAlarmStart</code> output which fires a relay after X amount of seconds, which will then fire whatever outputs <code>OnCarAlarmEnd</code> was firing.}}
 
==Keyvalues==
{{KV Targetname}}
{{KV StartDisabled}}
{{KV Model}}


== Inputs ==
== Inputs ==
{{IO|Ignite|Ignite, burst into flames.}}
{{IO|IgniteLifetime|<code>Ignite</code> with the given lifetime. {{todo|Before the flames extinguish, or before health reaches zero?}}|param=float}}
{{IO|IgniteNumHitboxFires|<code>Ignite</code> with the given number of hitbox fires.|param=integer}}
{{IO|IgniteHitboxFireScale|<code>Ignite</code> with the given hitbox fire scale.|param=float}}
{{I BasePropPhysics}}
{{I RenderFields}}
{{I EnableDisable}}
{{I EnableDisable}}
{{I|SurvivorStandingOnCar|Activates alarm. Automatically sent when Survivor stands on or damages the car}}
==Outputs==
{{O|OnCarAlarmStart|ac-is-this=1|Car alarm should go off}}
{{O|OnCarAlarmEnd|ac-is-this=1|Car alarm has shut off}}
{{O|OnCarAlarmChirpStart|ac-is-this=1|Warning chirp starts}}
{{O|OnCarAlarmChirpEnd|ac-is-this=1|Warning chirp stopped}}
== ConVars ==
{{varcom|start}}
{{varcom|car_alarm_chirp_distance|350||}}
{{varcom|car_alarm_chirp_duration|1||}}
{{varcom|car_alarm_chirp_interval|3||}}
{{varcom|car_alarm_distance|750||}}
{{varcom|car_alarm_duration|15||}}
{{varcom|end}}
== See also ==
* [[prop_physics]]


== Outputs ==
[[Category:Prop entities|car alarm]]
{{IO|OnCarAlarmStart|Car alarm should go off}}
{{IO|OnCarAlarmEnd|Car alarm has shut off}}
{{IO|OnCarAlarmChirpStart|Warning chirp starts}}
{{IO|OnCarAlarmChirpEnd|Warning chirp stopped}}
{{O BasePropPhysics}}

Latest revision as of 07:53, 4 June 2025

C++ Class hierarchy
CCarProp
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity

prop_car_alarm is a model entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. This class is the same as prop_physics, but with special outputs used specifically for a car alarm, to be used with prop_car_glass for its glass.

This entity can sense people firing their weapons next to it and has outputs for that event. It will call a panic event the moment its assigned model is touched or damaged by Survivors, but then it will stop functioning like a car alarm and will effectively just be a prop_physics.

In Left 4 Dead 2 Left 4 Dead 2 there is a Prefab of this car, to be used as func_instance, in 🖿sdk_content/mapsrc/instance/prop_car_alarm.vmf

Note.pngNote:The Enable/Disable inputs will disable or enable the ability to trigger alarms. However, the prop_car_glass entity that goes along with this car will not be affected by this and needs to be disabled separately, by swapping it with a generic prop_dynamic using the default glass version for this car, which does not blink.
Tip.pngTip:By default the alarm sounds for about 30 seconds, then fires the OnCarAlarmEnd Output. You can make this time longer by instead using an OnCarAlarmStart output which fires a relay after X amount of seconds, which will then fire whatever outputs OnCarAlarmEnd was firing.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
World Model (model) <model path>[ Edit ]
In-game 3D representation of the entity to display. This is the path to a MDL relative to the game's root directory. (128 character limit)

Inputs

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
SurvivorStandingOnCar
Activates alarm. Automatically sent when Survivor stands on or damages the car

Outputs

OnCarAlarmStart
!activator = !caller = this entity
Car alarm should go off
OnCarAlarmEnd
!activator = !caller = this entity
Car alarm has shut off
OnCarAlarmChirpStart
!activator = !caller = this entity
Warning chirp starts
OnCarAlarmChirpEnd
!activator = !caller = this entity
Warning chirp stopped

ConVars

Cvar/Command Parameters or default value Descriptor Effect
car_alarm_chirp_distance 350
car_alarm_chirp_duration 1
car_alarm_chirp_interval 3
car_alarm_distance 750
car_alarm_duration 15

See also