Prop car alarm: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(-added class hierarchy)
(-added cvars, keeping only the most relevant kio)
Line 8: Line 8:


==Keyvalues==
==Keyvalues==
{{KV BasePropPhysics}}
{{KV Targetname}}
{{KV RenderFields}}
{{KV EnableDisable}}
{{KV EnableDisable}}


==Flags==
== Inputs ==
{{Fl BasePropPhysics}}
 
==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}}
{{IO|SurvivorStandingOnCar|Activates alarm. Automatically sent when survivor stands on the car}}


==Outputs==
==Outputs==
Line 29: Line 20:
{{IO|OnCarAlarmChirpStart|Warning chirp starts}}
{{IO|OnCarAlarmChirpStart|Warning chirp starts}}
{{IO|OnCarAlarmChirpEnd|Warning chirp stopped}}
{{IO|OnCarAlarmChirpEnd|Warning chirp stopped}}
{{O BasePropPhysics}}
 
== ConVars ==
<pre>
car_alarm_chirp_distance                : 350      : , "sv", "launcher" :
car_alarm_chirp_duration                : 1        : , "sv", "launcher" :
car_alarm_chirp_interval                : 3        : , "sv", "launcher" :
car_alarm_distance                      : 750      : , "sv", "launcher" :
car_alarm_duration                      : 15      : , "sv", "launcher" :
</pre>

Revision as of 18:12, 10 November 2022

C++ Class hierarchy
CCarProp
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity

prop_car_alarm is a point entity available in the 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 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

In Left 4 Dead 2 Left 4 Dead 2 there is a Prefab of this car, to be used as func_instance in "Left 4 Dead 2\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 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).

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 the car

Outputs

OnCarAlarmStart
Car alarm should go off
OnCarAlarmEnd
Car alarm has shut off
OnCarAlarmChirpStart
Warning chirp starts
OnCarAlarmChirpEnd
Warning chirp stopped

ConVars

car_alarm_chirp_distance                 : 350      : , "sv", "launcher" : 
car_alarm_chirp_duration                 : 1        : , "sv", "launcher" : 
car_alarm_chirp_interval                 : 3        : , "sv", "launcher" : 
car_alarm_distance                       : 750      : , "sv", "launcher" : 
car_alarm_duration                       : 15       : , "sv", "launcher" :