Prop door rotating checkpoint: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See also: clean up, replaced: See Also → See also)
No edit summary
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lang|prop_door_rotating_checkpoint}}
{{LanguageBar}}
{{CD|CPropDoorRotatingCheckpoint}}
{{This is a|model entity|name=prop_door_rotating_checkpoint|series=Left 4 Dead}} It is a special variant of {{ent|prop_door_rotating}} for checkpoint doors in the world.


{{this is a|point entity|name=prop_door_rotating_checkpoint|series=Left 4 Dead}} It is a special variant of [[prop_door_rotating]] for checkpoint doors in the world.
It's used by {{ent|info_changelevel}} to determine when to start the transition to the next map when all survivors stand inside. Usually only 1 door is used for ending checkpoint but it's possible to have multiple doors in which case all of them need to be closed. No doors is also possible but to achieve that the checkpoint must start with at least one door which is then killed afterwards via for example {{ent|logic_auto}}'s OnMapSpawn output. Having no doors this way might be useful in order to have saferoom activated by a button and utilizing Enable/Disable inputs of the info_changelevel entity or just have a saferoom that starts the transition immediately as all survivors touch it.
{{Note|From {{l4d}} onwards (and in {{GMOD}}), rotating doors can be destroyed if the model used was compiled with {{ent|$collisiontext}}.}}
{{bug|Using raw door sounds will cause the sound to play everywhere in the map, despite the distance. This can be ignored in singleplayer games, but may be a problem in multiplayer games, because all players will hear the door throughout the whole map. This can be fixed by using a [[soundscript]].}}
{{bug|Specifying a Custom <code>Hinge Axis</code> in Hammer is broken. A workaround is to simply modify the model and set the origin to the hinge location.}}


== Supported Models ==
In Versus mode, the starting checkpoint door cannot be closed after it's been opened and it opens automatically if it remains closed for the amount of seconds specified in <code>versus_force_start_time</code> {{↓|Convars|cvar}}.
Most newer games such as {{L4D2}} have a model folder called <code>props_doors</code>, which feature various door models (including static props that will not work for prop_door_rotating). For a door model to be compatible, it must be a physics prop and its model origin must be on the hinge side of the door, as doors rotate around its origin.


[[File:Prop door rotating.png|300px|right|thumb|Example of a compatible door (Green) and an incompatible door (Red)<br> Note the origin of the red door being in the bottom middle. That is where the door would rotate along.]]
{{Note|Notices and information how to set up doors on <code>prop_door_rotating</code> page also applies here}}
{{OtherKIO|prop_door_rotating|All}}
{{Note|The sound that plays for the metal bar being removed is hardcoded. It can only be changed by editing the level_sound script for each map. More info on how to do so can be found [[L4D Level Design/Checkpoints#"Last Stand" Saferoom Door|here]]}}


== Keyvalues ==
== Gallery ==
{{KV|Slave name|intn=slavename|targetname|Name of any door(s) that should open and close at the same time as this one. You could also give them all the same name.}}
Models used in official maps. 'Exit' and 'Dead End' signs should be usually facing inside of the saferoom. The models {{code|0x}} and {{code|-0x}} differ by having hinge on the opposite side. For each of these models there's also static version with {{code|_static}} at the end which are usable as {{ent|prop_static}}.
{{KV|Hardware Type|intn=hardware|choices|The type of mechanism used to open the door (handle, push bar, keypad). The mechanism only appears in the game, not in Hammer.
<gallery mode=nolines widths=400px heights=350px>
:* None
checkpoint_door_01.jpg|<code>models/props_doors/checkpoint_door_01.mdl</code> and <code>models/props_doors/checkpoint_door_-01.mdl</code>
:* Lever (i.e. door handle)
checkpoint_door_02.jpg|<code>models/props_doors/checkpoint_door_02.mdl</code> and <code>models/props_doors/checkpoint_door_-02.mdl</code>
:* Push bar
</gallery>
:* Keypad {{note| Keypad hardware only has a model in Half Life 2 EP1 & EP2.}}}}
{{KV|Spawn Position|intn=spawnpos|choices|State the door should begin in. Check the door's angles to see forward/backward orientation.
:* Closed
:* Open forward
:* Open back
:* Ajar}}
{{KV|Ajar Angles|intn=ajarangles|angle|If "Spawn Position" is "ajar", these are the angles to spawn at instead of being open or closed.}}
{{KV|Hinge Axis|intn=axis|axis|{{todo}}
{{note|Despite Hinge Axis values, the door can only rotate on the Z Axis}}}}
{{KV|Rotation Distance|intn=distance|float|Number of degrees that the door should open, both forward and backward.}}
{{KV|Speed|intn=speed|int|In degrees/second.}}
{{KV|Fully Open Sound|intn=soundopenoverride|string|Sound played when the door has finished opening.}}
{{KV|Fully Closed Sound|intn=soundcloseoverride|string|Sound played when the door has finished closing.}}
{{KV|Moving Sound|intn=soundmoveoverride|string|Sound played when the door starts to move.}}
{{KV|Locked Sound|intn=soundlockedoverride|string|Optional overrides to the sounds played by the door. Sound played when the player tries to open the door, and fails because it's locked.}}
{{KV|Unlocked Sound|intn=soundunlockedoverride|string|Optional overrides to the sounds played by the door. Sound played when the door is unlocked.}}
{{KV|Delay Before close|intn=returndelay|int|Number of seconds the door waits until closing by itself. -1 means never auto-close.}}
{{KV|Damage Inflicted When Blocked|intn=dmg|int|If an entity is blocking the door from moving, inflict this much damage ''per frame''.}}
{{KV|Can Damage Player|intn=candamageplayer|bool|If set, this door will kill the player blocking it. Used for the large blast doors in ''infra_c7_m2_bunker''.
:{{Note|This replaces the "Damage Inflicted When Blocked" keyvalue in {{game link|INFRA}}.}}|only=INFRA}}
{{KV|Force Closed|intn=forceclosed|bool|If set, this door will close no matter what. Useful for doors that have to close even if the player tries to block them with objects.}}
{{KV|Open Direction|intn=opendir|choices|
: Force the door to open only forwards or only backwards. It will normally try to swing away from the entity that opened it, unless it is being blocked on the other side.
:* Both directions
:* Forward only
:* Backward only}}
{{KV|Health|int|Health for the door.|deprecated=1}}
{{KV|Glow Distance|intn=glowdist|int|Default is 1024.
{{todo|Same as L4D2's Glow Range?}}|since=CSGO}}
{{KV|Does the prop glow by default?|intn=glowenabled|bool|Enables the door to glow. Default is set to off.|since=CSGO}}
{{KV|Glow Color|intn=glowcolor|color255|The color of the glow (if enabled).|since=CSGO}}
{{KV Glow}}
{{ScrollBox|
{{KV Studiomodel}}
{{ScrollBox|title=BaseFadeProp|
{{Note|These keyvalues may not be available in some [[FGD]]s. When used in a game before L4D, there is an abrupt render cut-off rather than an actual fade.}}
{{KV|Start Fade Dist (fademindist)|float|Distance at which the prop starts to fade.|since=L4D}}
{{KV|End Fade Dist (fademaxdist)|float|Max fade distance at which the prop is visible.|since=L4D}}
:* If start fade is <0, the prop will disappear instantly when end fade is hit.
:* If end fade is <0, the prop won't disappear at all. (This is the default behaviour.)
: The values will scale appropriately if the prop is in a [[3D Skybox]].
{{KV|Fade Scale (fadescale)|float|If you specify so in [[worldspawn]], or if the engine is running below DirectX 8 (DX7 in Ep1), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command [[$noforcedfade]].|since=L4D}}
}}
{{KV BaseEntity}}
}}


== Flags ==
== Convars ==
{{Fl|1|Starts Open}}
{{varcom|start}}
{{Fl|2048|Starts locked}}
{{varcom|z_checkpoint_debug|0|boolean|Shows detected checkpoints and checkpoint doors and areas associated with them.}}
{{Fl|4096|Door silent (No sound, and does not alert NPCs)}}
{{varcom|versus_force_start_time|90|seconds|Starts versus game after this amount of time, even if survivors are still inside the safe room}}
{{Fl|8192|Use closes}}
{{varcom|end}}
{{Fl|16384|Door silent to NPCs (Does not alert NPCs)}}
{{Fl|32768|Ignore player +USE}}
{{Fl|524288|Start Unbreakable|since={{l4d}}}}
{{fl|524288|Start Breakable|since={{Csgo}}|also={{gmod}}}}
 
== Inputs ==
 
{{IO|Open|Open the door.}}
{{IO|Close|Close the door.}}
{{IO|Toggle|Toggle the door between open and closed.}}
{{IO|OpenAwayFrom|param=targetname|Open the door away from the specified entity.}}
{{IO|Lock|Lock the door.
:{{note|In {{l4d}}, if spawnflag 8192 is active, you can lock the safe room door only after survivors open it.}}}}
{{IO|Unlock|Unlock the door.}}
{{IO|SetRotationDistance|param=float|Degrees of rotation that the door will open.}}
{{IO|MoveToRotationDistance|param=float|Sets the open distance (in degrees) and moves there.|since=P2|also=GMOD}}
{{IO|SetSpeed|param=float|Set the speed at which the door rotates.
:{{note|Default is 200 in L4D.}}}}
{{IO|SetUnbreakable|The door can't be broken.|since=L4D}}
{{IO|SetBreakable|The door can be broken.|since=L4D}}
{{IO|SetAnimation|param=string|Force the door to play an animation. The parameter should be the name of the animation.|only=INFRA}}
{{IO|SetAnimationNoReset|param=string|Force the door to play an animation unless the door is already playing the animation. The parameter should be the name of the animation.|only=INFRA}}
{{IO|SetGlowEnabled|Starts the glow.|since=CSGO}}
{{IO|SetGlowDisabled|Stops the glow.|since=CSGO}}
{{I Glow}}
{{I BaseAnimating}}
{{bug|The RenderField properties do not show up in hammer, but can be manually added by turning off SmartEdit and entering the key and appropriate values.}}
{{I BaseEntity}}
 
== Outputs ==
{{IO|OnRotationDone|Fired when the door arrives at its goal angle.|since=P2|also=GMOD}}
{{O Door}}
{{O Studiomodel}}
{{O BaseEntity|l4d=1}}
 
== Custom Door Models ==
 
# Create <code>ACT_IDLE</code>, <code>ACT_DOOR_LOCKED</code> and <code>ACT_DOOR_OPEN</code> [[activities]].
# Add a '''<code>door_options</code>''' {{ent|$keyvalues}} block:
 
<source>
$keyvalues
{
prop_data
{
blocklos 1
}
door_options
{
default // Fallbacks if something is missing elsewhere
{
open Doors.FullOpen1
close Doors.FullClose1
move Doors.Move1
locked DoorHandles.Locked1
unlocked DoorHandles.Unlocked1
}
hardware0 // First hardware type, by default a handle
{
locked DoorSound.Null
unlocked DoorSound.Null
}
hardware1 // Push bar
{
locked DoorHandles.Locked1
unlocked DoorHandles.Unlocked1
}
hardware2 // Keypad
{
locked DoorHandles.Locked2
unlocked DoorHandles.Unlocked2
}
 
skin0  // Skin-specific sounds, including a custom surfaceprop.
{
open Doors.FullOpen4
close Doors.FullClose4
move Doors.Move4
surfaceprop wood  // If no skin is specified, surfaceprop is always wood, no matter what's written elsewhere
}
}
}
</source>
 
==={{l4ds}} L4D Series Doors===
The Left 4 Dead series introduced a new set of doors that can be broken down by Infected.<br>
Those new doors make use of {{ent|$collisiontext}} and new "Pound" and "Damage" listings in <code>door_options</code>, highlighted below.<br>
Some doors in L4D2, which were ported from L4D, also have the following activities, although they do not seem to work: <code>ACT_DOOR_ANIMTOLOCK</code>, <code>ACT_DOOR_ANIMTOUNLOCK</code>, <code>ACT_DOOR_OPENFAIL</code>.
{{note|Animations with the activity <code>ACT_DOOR_LOCKED</code> do not seem to work. Only workaround seems to be manually adding I/O connections to the door in hammer, or play a specific sequence when used while locked.}}
<syntaxhighlight lang=text highlight=1-9,18,31-35>
$collisiontext
{
break
{
"model" "Props_downtown\door_interior_128_01_dm01_02" //Spawns a debris model.
"health" "100"
"fadetime" "10"
}
}
 
$keyvalues
{
prop_data
{
"base" "Door.Standard"
"allowstatic" "1"
"blocklos" "1"
"dmg.bullets" "0"  //Bullets will no longer damage this door. In L4D2 this is only used on the last damage model.
 
}
door_options
{
"defaults"
{
"open" "Doors.FullOpen1"
"close" "Doors.FullClose1"
"move" "Doors.Move1"
"locked" "DoorHandles.Locked1"
"unlocked" "DoorHandles.Unlocked1"
 
"pound" "Doors.Wood.Pound1" //Sound that plays when infected attack the door to break it down.
"surfaceprop" "wood" //Overwrites Surfaceprop.
"damage1" "props_downtown\door_interior_128_01_DM01_01" //What the first damage model is.
"damage2" "props_downtown\door_interior_128_01_DM02_01" //What the second damage model is.
"damage3" "props_downtown\door_interior_128_01_DM03_01" //What the third damage model is.
}
}
}
</syntaxhighlight>
The "Damage1", "Damage2" and "Damage3" lines determine what models will be used for the broken stages of this door model.<br>
{{note|The sound that plays for the metal bar being removed is hardcoded. It can only be changed by editing the level_sound script for each map. More info on how to do so can be found [[L4D_Level_Design/Checkpoints#.22Last_Stand.22_Saferoom_Door.|here]]}}
{{warning|All damage models need their own set of door options. Not having door options for the damaged models will cause those doors to be silent if you decide to immediately use a damaged door.}}


== See also ==
== See also ==
* {{ent|func_door}} (sliding, [[brush]]-based)
* {{ent|prop_door_rotating}}
* {{ent|func_door_rotating}} (brush-based)
* [[Door creation]]
* [[Door creation]]
* [[WiseDoor]] - example use and illustration of doors.
* [[WiseDoor]] - example use and illustration of doors.


[[Category:QC Keyvalues]]
[[Category:QC Keyvalues]]
[[Category:Prop entities|door rotating checkpoint]]

Latest revision as of 02:01, 11 June 2025

English (en)Translate (Translate)
C++ Class hierarchy
CPropDoorRotatingCheckpoint
CPropDoorRotating
CBasePropDoor
CDynamicProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity

prop_door_rotating_checkpoint is a model entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. It is a special variant of prop_door_rotating for checkpoint doors in the world.

It's used by info_changelevel to determine when to start the transition to the next map when all survivors stand inside. Usually only 1 door is used for ending checkpoint but it's possible to have multiple doors in which case all of them need to be closed. No doors is also possible but to achieve that the checkpoint must start with at least one door which is then killed afterwards via for example logic_auto's OnMapSpawn output. Having no doors this way might be useful in order to have saferoom activated by a button and utilizing Enable/Disable inputs of the info_changelevel entity or just have a saferoom that starts the transition immediately as all survivors touch it.

In Versus mode, the starting checkpoint door cannot be closed after it's been opened and it opens automatically if it remains closed for the amount of seconds specified in versus_force_start_time cvar ↓.

Note.pngNote:Notices and information how to set up doors on prop_door_rotating page also applies here
Note.pngNote:All Keyvalues / Inputs / Outputs are same as prop_door_rotating.
Note.pngNote:The sound that plays for the metal bar being removed is hardcoded. It can only be changed by editing the level_sound script for each map. More info on how to do so can be found here

Gallery

Models used in official maps. 'Exit' and 'Dead End' signs should be usually facing inside of the saferoom. The models 0x and -0x differ by having hinge on the opposite side. For each of these models there's also static version with _static at the end which are usable as prop_static.

Convars

Cvar/Command Parameters or default value Descriptor Effect
z_checkpoint_debug 0 boolean Shows detected checkpoints and checkpoint doors and areas associated with them.
versus_force_start_time 90 seconds Starts versus game after this amount of time, even if survivors are still inside the safe room

See also