L4D关卡制作/救援(第二部分)

From Valve Developer Community
Jump to: navigation, search
English

译者:海天

创建一个逃生载具

现在,让我们制作逃生载具。 在求生之路,每个战役各有不同的逃生载具. 如:直升机,船,飞机,APC装甲车。 实际上任何都行.甚至是一个敞开门的房间。 在tutorial_standards map,则是一节地铁那么在这个关卡中 你能学会如何让物体移动。

选择地铁模型

放置一个 prop_dynamic

选择地铁汽车模型.

制作你自己的地铁逃生载具,首先得放置这个模型,不能用prop_static,得用prop_dynamic才能让它移动。 用Entity ToolObjects下拉菜单选择“prop_dynamic”。 打开它的属性并点击World model这一行 再点击右边的“Browse”按钮。 在过滤区输入 “subway”并选择模型“props_unique\subwaycar_all_onetexture.mdl”。 点击OK。关闭属性。 现在有了做为逃生载具的模型.现在我们需要一个刷子实体func_tracktrain来让模型移动。

建立一个 func_tracktrain

给地铁列车移动建立一个Brush.

选择 Block Tool.

Top 视图, 画一个大概和地铁列车一样大小的Brush然后按 Enter键建立。

SideFront 视图, 收缩brush以便它在地铁列车的地底下。

The tools/toolsnodraw 材质.

在Brush还被选择的时候, 点击 Browse 键在 Texture 栏.

输入 "nodraw" 在过滤器并选择材质 "tools/toolsnodraw".

双击它使它变为目前的材质.

点击 Apply current texture 工具去应用它已选的Brush.

The func_tracktrain 属性.

在Brush还被选择的时候, 按Ctrl+T.

  • Class 为 "func_tracktrain". 点击 Apply 会看到种类属性为 func_tracktrain.
  • 命名 Name 为 "train".
  • First Stop Target 为 "train_track01".
  • Max Speed 为 "25".
  • Height above track 为 "0"
func_tracktrain的Flag栏.

转到 Flags 栏.

  • 勾选 No User Control.
  • 勾选 Fixed Orientation.
  • 勾选 Is unblockable by player.

点击 Apply 然后关闭窗口.

添加 path_track 实体

The path_track 属性.

现在呢我们要做条路线让列车移动。

点击 Entity Tool 并选择 "path_track" 来自 Objects 的下拉菜单.

放置 path_trackCamera 视图 列车中央附近,用Alt+ Enter打开它的属性.

命名 Name 为 "train_track01".

Next Stop Target 为 "train_track02".

点击 Apply 后关掉属性窗口.

TopFront 视图, 挪动 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

The prop_dynamic 属性.

回到 prop_dynamic 地铁列车模型并打开它的属性.

Parent 为 "train". 这会父处理地铁列车模型到 func_tracktrain. 无论 func_tracktrain 何时移动, 列车会随着它移动.

现在, 我们需要 code>trigger_multiple</code> 检验所有幸存者是否能登上列车.

建立一个 trigger_multiple

Creating a brush for the 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.

The "tools/toolstrigger" texture.

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.

The trigger_multiple properties.

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".
Note:This trigger starts as disabled so that the survivors can't trigger it before the subway car picks them up. We will enable it later.
The Flags tab of the trigger_multiple.

Switch to the Flags tab.

Make sure the box for Clients is checked.

The Outputs tab of the trigger_multiple.

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.

The logic_relay properties for the train to continue.

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".

The Outputs tab for the 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

Placing the info_survivor_positions for the escape vehicle.

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.

The info_survivor_position properties for the escape vehicle.

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

The Outputs tab of the train_track02 path_track.

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.
Creating a logic_relay for the train to start.

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.

The Outputs tab for the train_start_relay.

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.

Adding an output to the trigger_finale.

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.

Creating a logic_relay for the train to escape.

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".

The Outputs tab for the 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.

The Outputs tab for the train_continue_relay.

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".

Updating the Nav

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.

The nav for the rescue vehicle.

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.

Note:Areas can be connected with one-way and two-way connections. A light blue line means it's a two-way connection. A dark blue line means it's a one-way connection.

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

Tip:If you want to make a one-way connection between areas, you select the first area and point (not select) to the second area and do a "nav_connect". This is used for things like one-way drops.)

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.



L4D Level Design Basics Tutorial
L4D Level Design/Finale Events Part 1
L4D Level Design/Finale Events Part 3