Swarm Placing Doors: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed redundant doorframe information and seamlessly added keypad triggering into the first section.)
m (Unicodifying, replaced: [[Image: → [[File: (5))
 
(5 intermediate revisions by 2 users not shown)
Line 3: Line 3:
== Setting Up a Basic Door ==
== Setting Up a Basic Door ==


[[Image:Swarm_MappingDoor.jpg|thumb|The asw_door entity and its associated trigger brush.]]  
[[File:Swarm_MappingDoor.jpg|thumb|The asw_door entity and its associated trigger brush.]]  


For this example, our door will be represented by the stock ingame mesh - as it allows for alternate skins and animations to represent denting and damaging by the players or the Swarm. In addition, to allow the door to function properly ingame, the asw_door must be complemented by a trigger which allows it to open automatically when approached by a player. First, we will place the asw_door and set its visual appearance in the game. There are several door models within the game that have proper animations, but for our purposes we will be using doorleft.mdl.
For this example, our door will be represented by the stock ingame mesh - as it allows for alternate skins and animations to represent denting and damaging by the players or the Swarm. In addition, to allow the door to function properly ingame, the asw_door must be complemented by a trigger which allows it to open automatically when approached by a player. First, we will place the asw_door and set its visual appearance in the game. There are several door models within the game that have proper animations, but for our purposes we will be using doorleft.mdl.
Line 13: Line 13:
| Name || door_1
| Name || door_1
|-
|-
| World Model || models/props/doors/heatvy_doors/doorleft.mdl
| World Model || models/props/doors/heavy_doors/doorleft.mdl
|-
|-
|}
|}
Line 34: Line 34:


=== Adding a Keypad ===
=== Adding a Keypad ===
[[Image:Swarm_MappingDoorframe.jpg|thumb|The door from the previous section, accompanied by a dynamic keypad model.]]  
[[File:Swarm_MappingDoorframe.jpg|thumb|The door from the previous section, accompanied by a dynamic keypad model.]]  
You may have noticed that the majority of the doors in the original Valve campaign have a keypad embedded into the doorframe. These may serve as an added visual clue to approaching players as to whether or not a door is currently locked, and are regulated through a trigger_asw_button_area brush.
You may have noticed that the majority of the doors in the original Valve campaign have a keypad embedded into the doorframe. These may serve as an added visual clue to approaching players as to whether or not a door is currently locked, and are regulated through a trigger_asw_button_area brush.


Line 63: Line 63:
== Types of Doors ==
== Types of Doors ==


=== Auto Open ===
=== Locked ===
[[File:door_auto_open.png]]
 
Other doors players might come across in Alien Swarm are locked doors. In order to be opened, they require a tech to hack the panel next to them. Locked doors only require a few changes from the basic auto opening door.  
The standard type of door, which opens automatically when a player approaches it.
 
{{note|If it is required to enter a locked door to complete the level, an {{ent|asw_tech_marine_req}} should be placed in the level. This will require that at least one tech class to start the mission, and will end the mission if no tech players are alive.}}


These doors contain an asw_door, a trigger_asw_door_area, a prop_dynamic set to panel02.mdl, and a trigger_asw_button_area.  
First, we need to make the door not open. This effectively "locks" the door until we allow it to open again.


1) Specify the asw_door in the UseTarget field of the trigger_asw_door_area
*{{ent|asw_door}}
::{| class=standard-table
!Property Name || Value 
|-
| Auto Open || No
|-
|}


2) Specify the asw_door in the UseTarget field of the trigger_asw_button_area
Now we're going to make the panel locked. This will change its skin to red and make it hackable by tech marines.


3) Specify the prop_dynamic in the Panel Prop name field of the trigger_asw_button_area
*{{ent|trigger_asw_button_area}}
::{| class=standard-table
!Property Name || Value 
|-
| Locked || Yes
|-
|}


=== Locked ===
Currently, hacking the panel won't allow the door to be opened. To link them, we need to set up an output to enable auto opening again.


These doors are locked. They require a tech to unlock them by hacking the panel.
*{{ent|trigger_asw_button_area}}
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[File:Io11.png]] || OnButtonHackCompleted || asw_door || EnableAutoOpen || 0 || 0.00 || No
|}


To construct, these changes need to be made to the auto open door:
You now have a locked door. It won't open until a tech hacks the panel. After that it functions like a regular door.


1) In the asw_door properties, change the Auto Open field to no.
=== Sealed ===


2) In the trigger_asw_button_area, change Locked to yes.
Another door players might come across is an already welded door. They require the door welder to cut them open. After they are cut open they function as a regular door. Sealed doors are usually used for separate rooms with items and weapons inside.


3) Make an output from trigger_asw_button_area:
{{note|If it is required to pass through a welded door to complete the level, an {{ent| asw_pickup_welder}} should be placed near the door to allow players to get through the door, even if no one chose a door welder as a starting item.}}
OnButtonHackComplete>(asw_door name)>EnableAutoOpen


=== Sealed ===
These doors require only a few changes to the basic auto opening door. First off, to get a common mistake out of the way, you need to make sure the trigger around the door is a [[trigger_asw_door_area]], '''not''' a [[trigger_asw_button_area]] (a keypad isn't needed for this kind of door). Secondly, you need to change Total Seal Time. This controls the total time in seconds it takes to seal the door with a welder. The default is 10 seconds, but you may want to change that to be shorter or longer.


These doors are welded shut. They require a player with the door welder to unweld them.
*{{ent|asw_door}}
::{| class=standard-table
!Property Name || Value 
|-
| Total Seal Time || 10
|-
|}


To construct, these changes need to be made to the auto open door:
The next step is to change Current Seal Time. this controls how much of the door is already welded, in seconds. Set it to your current Total Seal Time value unless you want the door to be partially welded.


1) Change the Total Seal Time in the asw_door properties to an appropriate number of seconds. The default is 10 seconds.
*{{ent|asw_door}}
::{| class=standard-table
!Property Name || Value 
|-
| Current Seal Time || 10
|-
|}


2) Change Current Seal Time in the asw_door properties to a positive number that is less than or equal to your Total Seal Time.
You now have a sealed door. It won't open until a player with the door welder cuts it open. After that it functions like a regular door and can be welded again.


=== Slow Locked ===
=== Slow Locked ===
[[File:door_locked_slow.png]]
[[File:door_locked_slow.png|thumb|The slow door as seen in the Rydberg Reactor level.]]
 
One last door players might come across are slow locked doors. They require a tech to hack them, but it is more difficult, and the door does not open immediately after the tech completes his hack.
 
{{note|If it is required to enter a locked door to complete the level, an {{ent|asw_tech_marine_req}} should be placed in the level. This will require that at least one tech class to start the mission, and will end the mission if no tech players are alive.}}
 
These doors require a few modifications to the basic auto opening door. The first thing we will do is delete the asw_door and the trigger_asw_door_area. We do not want the trigger_asw_door_area because the door stays permanently open after being hacked. We will replace the door with a prop_dynamic and a func_brush.
 
*{{ent|prop_dynamic}}
::{| class=standard-table
!Property Name || Value 
|-
| Name || Door
|-
| World Model || models/props/doors/slow_heavy_door/slow_heavy_door.mdl
|}


These doors are just like locked doors, except they are harder to hack and take a longer time to open.
*{{ent|func_brush}}
::{| class=standard-table
!Property Name || Value 
|-
| Name || Door_brush
|}


To construct, these changes need to be made to the locked door:
Next the asw_trigger_button_area needs to be updated to open this prop_dynamic door.


1) In the trigger_asw_button_area, make it more difficult to hack by changing these properties:
*{{ent|trigger_asw_button_area}}
* Time to charge up: The door in example_map_1 has this set to 25
::{| class=standard-table
* Num Wires: This is how many wires the tech has to complete. The door in example_map_1 has this set to 3. The max is 4.
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
* Wire Columns: How many horizontal sections each wire has. The door in example_map_1 has this set to 6. The range is from 3 to 8
|-
* Wire Rows: How many vertical sections each wire has. The door in example_map_1 has this set to 3. The range is from 1 to 3.
| [[File:Io11.png]] || OnButtonHackCompleted || door || SetAnimation || open || 0.00 || No
|}


2) Remove the asw_door and trigger_asw_door_area. Replace it with a prop_dynamic set to slow_heavy_door.mdl, and a func_brush textured with clip.
However, the func_brush is still there. We want to disable it when the door is completely open.


3) Remove the previous door name from the UseTarget field of the trigger_asw_button_area.
*{{ent|prop_dynamic}}
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[File:Io11.png]] || OnAnimationDone || door_brush || disable || 0 || 0.00 || No
|}


4) Change the previous output from the trigger_asw_button_area to
The last optional step is to make the panel harder to hack. These are the settings found in example_map_1
OnButtonHackComplete>(prop_dynamic door name)>SetAnimation>open


5) Make a new output for the prop_dynamic door.
*{{ent|trigger_asw_button_area}}
OnAnimationDone>(func_brush name)>Disable
::{| class=standard-table
!Property Name || Value 
|-
| Time to charge up || 25
|-
| Num Wires || 3
|-
| Wire Columns || 6
|-
| Wire Rows || 3
|}


== Door Properties ==
== Door Properties ==

Latest revision as of 00:21, 7 January 2024

Doors in Alien Swarm are placed with the purpose of transitioning contrasts in atmosphere and/or gameplay across areas of a map. In the case of the Valve campaigns, they are also frequently employed as chokepoints during combat, both for the players and for the swarm. The need to destroy or unweld a locked door also serves as a miniature objective and "panic event" during maps, often triggering the appearance of parasites or a swarm of enemies whilst the players are occupied.

Setting Up a Basic Door

The asw_door entity and its associated trigger brush.

For this example, our door will be represented by the stock ingame mesh - as it allows for alternate skins and animations to represent denting and damaging by the players or the Swarm. In addition, to allow the door to function properly ingame, the asw_door must be complemented by a trigger which allows it to open automatically when approached by a player. First, we will place the asw_door and set its visual appearance in the game. There are several door models within the game that have proper animations, but for our purposes we will be using doorleft.mdl.

Property Name Value
Name door_1
World Model models/props/doors/heavy_doors/doorleft.mdl


Using the block tool, make a brush for the door area, covering both sides of the door. This brush must have the texture tools/toolstrigger. Once the brush is placed, select Tools -> Tie to Entity (shortcut Ctrl + T) and select the class trigger_asw_door_area.

Note.pngNote:It is recommended, that the brush extend far enough to ensure the door will be fully open by the time players reach it. This allows for smoother gameflow and lessens the chance of players becoming stuck at an inconvenient time.

The trigger brush must target your door in order for it to open it when a player steps within the brush. Unlike doors in other Source games, Alien Swarm doors have their inputs and outputs hardcoded, so all you need to do is specify the name of the asw_door entity to be triggered, as such.

Property Name Value
UseTarget door_1

That's the basics of a door. In-game your door will now open and slide to the side when a marine comes within range of the trigger brush. It can also be cut open and sealed with the welding tool.

Adding a Keypad

The door from the previous section, accompanied by a dynamic keypad model.

You may have noticed that the majority of the doors in the original Valve campaign have a keypad embedded into the doorframe. These may serve as an added visual clue to approaching players as to whether or not a door is currently locked, and are regulated through a trigger_asw_button_area brush.

First, the keypad itself - a prop_dynamic is used so that its skin may be readily changed.

Property Name Value
World Model models/props/techdeco/buttonpanel/panel02.md
Skin 2
Panel Prop name panel_1

The prop keypad may be named however you wish, just be sure that associated the trigger_asw_button_area targets both the proper asw_door and prop_dynamic.

Property Name Value
UseTarget door_1
Panel Prop name panel_1

Types of Doors

Locked

Other doors players might come across in Alien Swarm are locked doors. In order to be opened, they require a tech to hack the panel next to them. Locked doors only require a few changes from the basic auto opening door.

Note.pngNote:If it is required to enter a locked door to complete the level, an asw_tech_marine_req should be placed in the level. This will require that at least one tech class to start the mission, and will end the mission if no tech players are alive.

First, we need to make the door not open. This effectively "locks" the door until we allow it to open again.

Property Name Value
Auto Open No

Now we're going to make the panel locked. This will change its skin to red and make it hackable by tech marines.

Property Name Value
Locked Yes

Currently, hacking the panel won't allow the door to be opened. To link them, we need to set up an output to enable auto opening again.

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnButtonHackCompleted asw_door EnableAutoOpen 0 0.00 No

You now have a locked door. It won't open until a tech hacks the panel. After that it functions like a regular door.

Sealed

Another door players might come across is an already welded door. They require the door welder to cut them open. After they are cut open they function as a regular door. Sealed doors are usually used for separate rooms with items and weapons inside.

Note.pngNote:If it is required to pass through a welded door to complete the level, an asw_pickup_welder should be placed near the door to allow players to get through the door, even if no one chose a door welder as a starting item.

These doors require only a few changes to the basic auto opening door. First off, to get a common mistake out of the way, you need to make sure the trigger around the door is a trigger_asw_door_area, not a trigger_asw_button_area (a keypad isn't needed for this kind of door). Secondly, you need to change Total Seal Time. This controls the total time in seconds it takes to seal the door with a welder. The default is 10 seconds, but you may want to change that to be shorter or longer.

Property Name Value
Total Seal Time 10

The next step is to change Current Seal Time. this controls how much of the door is already welded, in seconds. Set it to your current Total Seal Time value unless you want the door to be partially welded.

Property Name Value
Current Seal Time 10

You now have a sealed door. It won't open until a player with the door welder cuts it open. After that it functions like a regular door and can be welded again.

Slow Locked

The slow door as seen in the Rydberg Reactor level.

One last door players might come across are slow locked doors. They require a tech to hack them, but it is more difficult, and the door does not open immediately after the tech completes his hack.

Note.pngNote:If it is required to enter a locked door to complete the level, an asw_tech_marine_req should be placed in the level. This will require that at least one tech class to start the mission, and will end the mission if no tech players are alive.

These doors require a few modifications to the basic auto opening door. The first thing we will do is delete the asw_door and the trigger_asw_door_area. We do not want the trigger_asw_door_area because the door stays permanently open after being hacked. We will replace the door with a prop_dynamic and a func_brush.

Property Name Value
Name Door
World Model models/props/doors/slow_heavy_door/slow_heavy_door.mdl
Property Name Value
Name Door_brush

Next the asw_trigger_button_area needs to be updated to open this prop_dynamic door.

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnButtonHackCompleted door SetAnimation open 0.00 No

However, the func_brush is still there. We want to disable it when the door is completely open.

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnAnimationDone door_brush disable 0 0.00 No

The last optional step is to make the panel harder to hack. These are the settings found in example_map_1

Property Name Value
Time to charge up 25
Num Wires 3
Wire Columns 6
Wire Rows 3

Door Properties

See the Asw door page for a list of door properties and their uses.

Door Area Flags

If you bring up the properties of your Trigger asw door area and go to the Flags tab, you can set which type of entity can trigger the Auto Open of the door. The two most relevant choices for AS:I are either "Marines and Aliens" or "Only Marines".

For consistency and background reasons, all but VERY high tech Auto Open doors should be left at the default ("Marines and Aliens").