L4D关卡制作/救援(第二部分)
译者:海天
Contents
创建一个逃生载具
现在,让我们制作逃生载具。 在求生之路,每个战役各有不同的逃生载具. 如:直升机,船,飞机,APC装甲车。 实际上任何都行.甚至是一个敞开门的房间。 在tutorial_standards map,则是一节地铁那么在这个关卡中 你能学会如何让物体移动。
放置一个 prop_dynamic
制作你自己的地铁逃生载具,首先得放置这个模型,不能用prop_static,得用prop_dynamic才能让它移动。 用Entity Tool从Objects下拉菜单选择“prop_dynamic”。 打开它的属性并点击World model这一行 再点击右边的“Browse”按钮。 在过滤区输入 “subway”并选择模型“props_unique\subwaycar_all_onetexture.mdl”。 点击OK。关闭属性。 现在有了做为逃生载具的模型.现在我们需要一个刷子实体func_tracktrain来让模型移动。
建立一个 func_tracktrain
选择 Block Tool.
在 Top 视图, 画一个大概和地铁列车一样大小的Brush然后按↵ Enter键建立。
在 Side 或 Front 视图, 收缩brush以便它在地铁列车的地底下。
在Brush还被选择的时候, 点击 Browse 键在 Texture 栏.
输入 "nodraw" 在过滤器并选择材质 "tools/toolsnodraw".
双击它使它变为目前的材质.
点击 Apply current texture 工具去应用它已选的Brush.
在Brush还被选择的时候, 按Ctrl+T.
- 改 Class 为 "func_tracktrain". 点击 Apply 会看到种类属性为 func_tracktrain.
- 命名 Name 为 "train".
- 改 First Stop Target 为 "train_track01".
- 改 Max Speed 为 "25".
- 改 Height above track 为 "0"
转到 Flags 栏.
- 勾选 No User Control.
- 勾选 Fixed Orientation.
- 勾选 Is unblockable by player.
点击 Apply 然后关闭窗口.
添加 path_track 实体
现在呢我们要做条路线让列车移动。
点击 Entity Tool 并选择 "path_track" 来自 Objects 的下拉菜单.
放置 path_track
在 Camera 视图 列车中央附近,用Alt+↵ Enter打开它的属性.
命名 Name 为 "train_track01".
改 Next Stop Target 为 "train_track02".
点击 Apply 后关掉属性窗口.
在 Top 和 Front 视图, 挪动 path_track 准确地到 func_tracktrain
brush 的中间. 点击func_tracktrain
你可以发现这个准确的位置并看到助手结点 (默认的,在中间). 你可以移动助手结点, 但确保你移动的这个 path_trac
是助手结点所在地.
回到 Entity Tool 并放置另外一个 path_track
到你想放的地方游戏电脑人能接应的。
打开它的属性命名 Name 为 "train_track02" 和 Next Stop Target 为 "train_track03".
回到 Entity Tool, 放置第三个 path_track
到列车上做最终救援成功的位置。
打开它的属性命名 Name 为 "train_track03".
父处理 the prop_dynamic 到 func_tracktrain
回到 prop_dynamic
地铁列车模型并打开它的属性.
改 Parent 为 "train". 这会父处理地铁列车模型到 func_tracktrain
. 无论 func_tracktrain
何时移动, 列车会随着它移动.
现在, 我们需要 code>trigger_multiple 检验所有幸存者是否能登上列车.
建立一个 trigger_multiple
Draw a brush with that Block Tool that is contained inside the subway car at the position where it picks up the Survivors.
Click on the Browse button in the Texture bar.
Type "trigger" in the filter and select the "tools/toolstrigger" texture.
Double-click on it to make it the current texture.
Apply the texture to the selected brush.
Press Ctrl+T to make it a brush entity.
Change the Class to "trigger_multiple" and click Apply to see the properties for a trigger_multiple
.
- Change the Name to "train_trigger".
- Change Start Disabled to "Yes".
- Change Entire Team Number to "Survivor".

Switch to the Flags tab.
Make sure the box for Clients is checked.
Switch to the Outputs tab.
Add an output with the following:
- My output named: "OnEntireTeamStartTouch"
- Targets entities named: "train_continue_relay"
- Via this input: "Trigger"
This trigger will now send a Trigger output to a logic_relay
called "train_continue_relay" when all the survivors are touching it.
Now, let's set up the logic_relay
of all the things that should happen when the survivors touch the trigger.
In the Entity Tool, select "logic_relay" from the Objects drop-down menu.
Place the logic_relay
in the Camera viewport near where the "train_trigger" is, and open up its properties.
Change the Name to "train_continue_relay".
Switch to the Outputs tab.
Add an output with the following:
- My output named: "OnTrigger"
- Targets entities named: "train"
- Via this input: "StartForward"
Add an output with the following:
- My output named: "OnTrigger"
- Targets entities named: "radio"
- Via this input: "FinaleEscapeForceSurvivorPositions"
This means that the train will continue to move forward when all the survivors who are alive and not incapacitated have touched the "train_trigger" and this logic_relay
will also teleport the Survivors to positions where they are safe from harm.
We'll need to place the Survivor positions where they will teleport to when the escape occurs.
Placing the info_survivor_positions
Go to the Entity Tool and select "info_survivor_position" from the Objects drop-down menu.
Place 4 of these in the Camera viewport where they can't be touched by the infected team.
This might require you to build a small container for them off the level as shown in tutorial_standards.vmf.
Open the properties for each one.
Change the Name of the first one to "train_survivor_pos1".
Change the Name of the second one to "train_survivor_pos2".
Change the Order of the second one to "2".
Change the Name of the third one to "train_survivor_pos3".
Change the Order of the third one to "3".
Change the Name of the fourth one to "train_survivor_pos4".
Change the Order of the fourth one to "4".
Completing the Escape Vehicle
Go back to "train_track02" and open up its properties.
Switch to the Outputs tab.
In the tutorial_standards map, there are other outputs hooked up for doors to open, infected to get killed if they get in the way, and survivors to get pushed out of the way. Ignore these for now and just add these outputs:
Add an output with the following:
- My output named: "OnPass"
- Targets entities named :"train"
- Via this input: "Stop"
This will stop the train when it gets to this path_track
where it will pick up the survivors.
Add an output with the following:
- My output named: "OnPass"
- Targets entities named: "train_trigger"
- Via this input: "Enable"
This is the output that will enable our trigger_multiple.
Add another output with the following:
- My output named: "OnPass"
- Targets entities named: "radio"
- Via this input: "FinaleEscapeVehicleReadyForSurvivors"
This will tell the survivor bots to get to the nav area marked with the "RESCUE_VEHICLE" attribute.
We still need something to send an input to the func_tracktrain
to start from its initial position to the survivor pick up position.
Go into the Entity Tool and select "logic_relay" from the Objects drop-down menu.
Place it near the "train_continue_relay" entity and open its properties.
Change the Name to "train_start_relay".
Switch to the Outputs tab.
Add an output with the following:
- My output named: "OnTrigger"
- Targets entities named: "train"
- Via this input: "StartForward"
Click Apply and close the properties window.
Now, go back to the trigger_finale
(the radio model) and open its properties again.
Add an output with the following:
- My output named: "FinaleEscapeStarted"
- Targets entities named: "train_start_relay"
- Via this input: "Trigger"
The trigger_finale
will now start the train when the escape phase of the finale starts.
We still need an output to the trigger_finale that will tell it that the escape is complete.
Go to the Entity Tool and select "logic_relay" from the Objects list.
Place it in the Camera viewport and open up its properties.
Change the Name to "train_end_relay".
Switch to the Outputs tab.
Add an output with the following:
- My output named: "OnTrigger"
- Targets entities named: "radio"
- Via this input: "FinaleEscapeFinished"
- After a delay in seconds: "2"
This will tell the trigger_finale
that the survivors have escaped 2 seconds after being triggered.
Go back to the "train_continue_relay" and open up its properties.
Switch to the Outputs tab.
Add an output with the following:
- My output named: "OnTrigger"
- Targets entities named: "train_end_relay"
- Via this input: "Trigger"
We could have put the FinaleEscapeFinished
output here but we're preparing to add other things for the "train_end_relay".
We will now need to update the nav to include the RESCUE_VEHICLE areas.
Save and compile the map with F9.
When the level loads, enter nav edit mode with Page_Down.
Use noclip
N to get to where the subway car picks up the survivors. You'll notice that the subway car is in its initial position. You don't have to play through the finale to get it to its pick up position.
Simply bring down the console and type "ent_fire train_start_relay trigger
" and press ↵ Enter.
Once the subway car is in position, you can place a nav_mark_walkable
M inside it and use nav_generate_incremental
B to build the nave mesh for it.
Make sure that the nav areas inside the subway car are connected to the rest of the level.
You should see a light blue (cyan) line connecting the areas.

If the areas are not connected, select both of the areas that you want to be connected and use nav_connect
Insert.

Select all the nav areas inside the subway car and use "mark RESCUE_VEHICLE
" in the console to mark them with that attribute.
These are all the things necessary for a finale to work properly. Now, we can add some of the optional components of the finale.