|
|
(39 intermediate revisions by 9 users not shown) |
Line 1: |
Line 1: |
| 這個教程會教大家製作一個基本的[[Left 4 Dead]]地圖。教程會教大家如何使用一些在必需[[Left 4 Dead]]地圖上必要的[[Entity]] , 例如Director,生成可用的武器和生成喪屍等等。還解釋一些地圖製作者常犯的錯。
| | {{lang|Your First Left 4 Dead Map}} |
|
| |
|
| 這個教程對象並不是入門級的地圖製作者,所以教程所用的技巧可能看不懂,建議先看[[Your_First_Map|Basic level construction]]。 | | 這個教程會教大家製作一個基本的{{L|Left 4 Dead}}地圖。教程會教大家如何使用一些在必需{{L|Left 4 Dead}}地圖上必要的{{L|Entity}} , 例如Director,生成可用的武器和生成喪屍等等。還解釋一些地圖製作者常犯的錯。 |
| | |
| | 這個教程對象並不是入門級的地圖製作者,所以教程所用的技巧可能看不懂,建議先看{{L|Your_First_Map|Basic level construction}}。 |
|
| |
|
| ---- | | ---- |
| <center>[[Image:Tut title.png]]</center> | | <center>[[File:Tut title.png]]</center> |
| | |
| [[Image:1st_l4d_map_1.gif|frame|right|The map layout.]]
| |
| For this tutorial we will be making a simple 2 level campaign that never ends. Sounds fun, right? Well, the purpose really isn't to create a full campaign, but to explain the basics of level construction in L4D.
| |
|
| |
|
| | [[File:1st_l4d_map_1.gif|frame|right|本教程地圖的布局。]] |
| | 這個教程會教大家製作一個一共包含兩個章地圖的戰役,但永遠玩不完,没有結局。Sounds fun, right? 這個教程目標不是完整的戰役,但會教大家如何製作一個基作的基本的L4D地圖。 |
| <br> | | <br> |
| First, lets cover what our L4D campaign will need to work right:
| | 首先,製作一個可玩的L4D地圖需要以下的東西: |
| * A director | | * A director (導演) |
| * A starting point | | * 生還者開始地點 |
| * 2 safe house doors | | * 兩道安全門 |
| * Some weapons, ammo, and health | | * 武器,彈藥和藥包 |
| * A rescue closet | | * 救出死去同伴的密室 |
| * A change-level | | * 轉換地圖 |
| * A fog controller (for the particle effects) | | * 雾的控制器 (粒子效果需要) |
| <br> | | <br> |
| The image on the right will be used for our map layout during this tutorial.{{clr}}
| | 以下教程會根據右面那張圖的布局。 |
| | 還有的是Hammer並没有中文版,所以一些功能上的字眼仍然使用英文。 |
| | {{clr}} |
| | == 生還者開始地點 == |
| | 首先在上圖最左邊(區域紅色1)里面增加一個Entity名叫<code>info_player_start</code>。之後,增加另外兩個Entity,<code>info_director</code>和<code>env_fog_controller</code>,這兩個Entity放在那裡都可以。為了方便,建議都放到區域1。 |
| | 之後確保<code>env_fog_controller</code>的「Properties」內,「Fog Enable」是「Yes」的。 |
|
| |
|
| == The Spawn Room ==
| | 在這里,我們可以新增加以下補給的Entity: |
| To start with will make the room on the far left (area 1) the initial spawn room by adding an <code>info_player_start</code> entity to it. Next, let's add an <code>info_director</code> and a <code>env_fog_controller</code>, make sure the fog_controller's "Fog Enable" property is set to "Yes".
| | * 四個藥包,<code>weapon_first_aid_kit_spawn</code> |
| | * 兩支槍; <code>weapon_smg_spawn</code> 和 <code>weapon_pumpshotgun_spawn</code> |
| | * 彈藥 <code>weapon_ammo_spawn</code> |
|
| |
|
| For a supplies area create a small brush to act as a table and add these entities on top:
| | 開始地點需要一道安全門,新增一個Entity叫<code>prop_door_rotating_checkpoint</code>。在「Properties」里,更改名稱(Name)為「checkpoint_exit」,「Spawn Position」設定成「Closed」,「world model」設成「models/props_doors/checkpoint_door_01.mdl」和確定「Flag」內的「Starts Open」没有被選取。還有確保安全門上「EXIT」的標誌是向內的。 |
| * health kits, 4 <code>weapon_first_aid_kit_spawn</code> entities
| |
| * 2 weapons; <code>weapon_smg_spawn</code> and <code>weapon_pumpshotgun_spawn</code>.
| |
| * an ammunition resupply, <code>weapon_ammo_spawn</code>
| |
|
| |
|
| Now for an exit add a "<code>prop_door_rotating_checkpoint</code>" entity. For it's properties, name it "checkpoint_exit", set its "body" property to "1", the "Spawn Position" to "Closed" (spawnpos keyvalue 0), the "world model" to "models/props_doors/checkpoint_door_01.mdl", and the make sure the "Starts Open" flag is unchecked. Make sure the side of the door with the EXIT sign in the center is facing the inside of the room.
| | 生還者開始地點大致上完成,最後增加一個Entity叫<code>info_landmark</code>,並命名為「landmark_a」,之後會解釋為什麼。 |
| {{note|If the prop_door_rotating_checkpoint set in anymore then 8 units from the wall outside the safehouse, the infected may try to climb over it.}}
| |
|
| |
|
| That should finish the starting point, but before we move on, lets add a <code>info_landmark</code> to the room as well, name it "landmark_a". Well go more into detail on this later.
| | == 救出死去同伴的密室 == |
| | 之後我們會製作兩個小密室(上圖區域2),救出死去同伴。在第一個小密室里,大家只需要增加四個Entity,包括三個<code>info_survivor_rescue</code>和一個<code>prop_door_rotating</code>。在第二個小密室里,同樣做法。 |
| | 我們需要一道闊54個單位,高104個單位的門,所以<code>prop_door_rotating</code>里的「world model」設成「models/props_doors/doormain01.mdl」。 |
|
| |
|
| == Rescue closets == | | == 安全室和轉換地圖 == |
| Next we'll make the two small rooms near the number 2 into places for dead players to respawn (referred to as a rescue closets). Rescue closets are fairly basic and only consist of 4 entities, 3 <code>info_survivor_rescue</code> entities and a <code>prop_door_rotating</code>. Add the 3 <code>info_survivor_rescue</code> entities to the inside of each room. Next up is the door. You will want a space with a width of 56 and height of 104 for the door to sit in, add the <code>prop_door_rotating</code> and set it's world model to "models/props_doors/doormain01.mdl".
| | 現在我們製作一個可以轉換到下一個地圖的安全室。安全室(區域3)門口位新增一個一道門<code>prop_door_rotating_checkpoint</code>,這里與之前的安全門有少許不相同,開它的「Properties」,並把它命名為「checkpoint_entrance」,「world model」設成「models/props_doors/checkpoint_door_02.mdl」,亦都確保「Flag」內的「Starts Open」是選取了的。還有安全門上「小屋圖示」是向外的。 |
|
| |
|
| == The safe house and changing levels ==
| | 我們要轉換地圖需要增加<code>info_landmark</code> 和 <code>trigger_changelevel</code>。首先我們在安全室的中間位置增加<code>info_landmark</code>,之後將其命名為「landmark_2」。現在我們在安全室內建立一個大型的方塊(Brush),方塊的大小要蓋著整個安全室,不可有空位,最低限度需要貼著牆邊,穿過牆都不要緊。之後開啟<code>trigger_changelevel</code>的「Properties」,「landmark name」設成「landmark_b」和「Next map」設成「1st_l4dmap_b」。 |
| Now to connect this map to another inside the campaign with a safe room. To start with, well add another "<code>prop_door_rotating_checkpoint</code>" entity to the entrance of area 3 for the safe houses door. This one is set up a bit different then the last one. Open its properties and set the name to "checkpoint_entrance", the "body" property to "0", the "Spawn Position" to "Open Forward" (spawnpos keyvalue 1), the "world model" to "models/props_doors/checkpoint_door_02.mdl", and the make sure the "Starts Open" flag is checked. You want the side of the door with the picture of the house facing outside.
| |
|
| |
|
| To finish setting up the transition from one map to the next we still need to add an <code>info_landmark</code> and a <code>trigger_changelevel</code>. First add the <code>info_landmark</code> to the center of the room near the ceiling, then open it's properties and name it "landmark_2". Now create a large brush to cover the floorspace inside the safehouse and tie it to the <code>trigger_changelevel</code> entity, make sure the brush comes in contact with the floorspace inside the room (doesn't necessarily have to overlap the floor space, but it does have to at least touch it). Open the changelevel's properties and set the landmark name to the one we just created, "landmark_b" and for the "next map" property, enter "lst_l4dmap_b".
| | == 製作路線(Nav) == |
| | | 要令電腦玩家懂得在你的地圖上走動,無論是生還者或感染者,你都需要為你的地圖製作一個路線圖(mapname.nav 檔案)。製作一個基本的路線圖,你需要編譯你的地圖,並進入遊戲,成功載入你的地圖。當地圖完全載入,你的準星要描著地上,開啟指令控制台(按~鍵),輸入以下指令: |
| == Building a navigation mesh ==
| |
| For the survivor bots and infected to be able to move, you will need to create a navigation mesh ("mapname.nav" file) for your map. To build a basic mesh you need to have the map already compiled and loaded. Once the map is running, aim your crosshairs at the floor space, open up the console in game, and then type the following:
| |
| : <code>sv_cheats 1</code> | | : <code>sv_cheats 1</code> |
| : <code>nav_edit 1</code> | | : <code>nav_edit 1</code> |
Line 49: |
Line 52: |
| : <code>nav_generate</code> | | : <code>nav_generate</code> |
|
| |
|
| The map will be reloaded after you type nav_generate, and if all goes well, we should no longer have the "NAV ERRORS - Map is unplayable!" message displayed on the screen when the map loads. This is because nav_generate assigned certain attributes to the nav mesh through a process known as "nav marking".
| | 當你選入了<code>nav_generate</code>,地圖會自動運算路線圖。如果你運氣好的話,當運算完畢時你不會再看見錯誤信息「NAV ERRORS - Map is unplayable!」,因為<code>nav_generate</code>亦都會為你的路線圖設定屬性(Attribute)。 |
|
| |
|
| You can see the changes using the "select_with_attribute A" command. What this console command does is select all the nav areas that have been "marked" with the attribute "A". For instance, by using "select_with_attribute CHECKPOINT", all the nav areas that have been marked with the "CHECKPOINT" attribute would be highlighted.
| | 用「select_with_attribute A」指令以看到一些屬性變化。選取了的區域(淡黃高亮)是所「Marked」的屬性。例子,現在我們想找CHECKPOINT的位置,使用「select_with_attribute CHECKPOINT」指令,選取了的區域(淡黃高亮)就是CHECKPOINT位置。 |
|
| |
|
| With "nav_edit 1" set, you would open the console and type:
| | 選入「nav_edit 1」指令,之後選入以下指令: |
| : select_with_attribute DOOR | | : select_with_attribute DOOR |
| :: 4 nav squares should be highlighted telling the bot AI there is a door in these locations. | | :: 有門的地方會被選取。 |
|
| |
|
| : select_with_attribute CHECKPOINT | | : select_with_attribute CHECKPOINT |
| :: The nav areas in the safehouse at the end of the level should be highlighted. | | :: 安全室會被選取。 |
|
| |
|
| : select_with_attribute RESCUE_CLOSET | | : select_with_attribute RESCUE_CLOSET |
| :: The two two rescue closets should have there nav squares highlighted | | :: 救同伴的密室會被選取。 |
|
| |
|
| : select_with_attribute ESCAPE_ROUTE | | : select_with_attribute ESCAPE_ROUTE |
| :: Now a lot of nav squares are highlighted forming a path from the player spawn to the nav areas marked "checkpoint" at the end of the level. | | :: 有很多區域會被選取,由生還者玩家開始地點到安全室。 |
| | |
| | [[File:L4d_select_door.jpg|200px|thumb|left|using select_with_attribute DOOR]] |
| | [[File:L4d_select_checkpoint.jpg|200px|thumb|left|using select_with_attribute CHECKPOINT]] |
| | [[File:L4d_select_rescuecloset.jpg|200px|thumb|left|using select_with_attribute RESCUE_CLOSET]] |
| | {{clr}} |
|
| |
|
| === NAV Marking === | | === NAV Marking === |
| In this case, nav_generate did a fairly good job at locating and assigning the final checkpoint, rescue closets, and other attributes to the nav mesh, but you may not always be so lucky. To manually assign attributes to nav squares, you will need use the MARK command via 'mark A', where A is the attribute you wish to mark the nav area with.
| | 在這個情況,「nav_generate」所生成的路線圖是十分完美的,所有相關的屬性都已經為我們設定好了。但是有時候運氣不是太好,需要手動設定一些屬性。你要用指令「mark A」,A是你想設定的屬於。 |
|
| |
|
| For example, before we can get our level working correctly, we will have to manually "mark" one additional location on the nav mesh that nav_generate missed, a starting checkpoint. To do this, we need to be in nav editing mode with:
| | 例如,「nav_generate」不能自動設定安全室的屬地,你需要以下指令: |
| sv_cheats 1 | | sv_cheats 1 |
| nav_edit 1 | | nav_edit 1 |
| Now inside the starting safe room we will label one nav square at a time by pointing the targeting reticule at them then typing this into the console:
| | 現在到安全室,準星向著安全室的地上,打開控制台,選入: |
| mark CHECKPOINT
| | * mark CHECKPOINT |
| Or, to speed things up, you can use the nav gui interface by opening up the console again and typing:
| | 有時候安全室內有多個區域需要設定成CHECKPOINT,我們可以用指令: |
| nav_gui
| | * nav_gui |
| With the nav gui enabled, you can now left click multiple meshes, and use the <code>mark CHECKPOINT</code> console command to set the attribute for all the selected areas.
| | [[File:L4d_select_checkpoint2.jpg|200px|thumb|right|the nav mesh now with both checkpoints marked]] |
| | 方便選取多個區域。選取後,同樣做法,在控制台,選入「mark CHECKPOINT」。 |
|
| |
|
| If you make a mistake, you can remove a single attribute from a selected nav area by using:
| | 如果你設定錯誤,可以用以下指令: |
| * <code>nav_clear_attribute A</code> | | * <code>nav_clear_attribute A</code> |
| ** where A is the attribute you wish to remove (eg: <code>nav_clear_attribute CHECKPOINT</code>) | | ** 你想移除某區域內屬性A (eg: <code>nav_clear_attribute CHECKPOINT</code>) |
| Or, if you wanted to remove all nav attributes from the selected area, you could use:
| | 或者你想移除整個地圖的屬性,可用以下指令: |
| * <code>wipe_attributes</code> | | * <code>wipe_attributes</code> |
|
| |
|
| Once you have finished with nav marking, be sure to save the changes to your map with <code>nav_save</code>, then re-analyze it with <code>nav_analyze</code>
| | 當你完成了設定屬性後,切記儲存,指令是「<code>nav_save</code>」。之後你需要用指令「<code>nav_analyze</code> |
| | 」分析一次你的地圖。 |
|
| |
|
| == Getting the infected to spawn == | | == 感染者出現在你的地圖 == |
| Now that the nav mesh is built, you should be able to get the infected to spawn by using the console commands:
| | 現在你的路線圖已經完成,你需要選入以下指令才會有喪屍生成: |
| : <code>director_stop</code> | | : <code>director_stop</code> |
| : <code>director_start</code> | | : <code>director_start</code> |
| You should only have to do this once inside the map, then every time you load the map after that the director should start on it's own.
| |
|
| |
| == Making the second chapter ==
| |
| With the first map out of the way, the second map can be made quite easily. Back in Hammer, with the map we just compiled still loaded, go up to the file menu and choose "Save As". Now type in "lst_l4dmap_b" to save the current map under a new name. Go up to the exit menu and hit "Select all", hit CTRL and M to bring up the translation tool and type 180 into the Z field and hit "Ok".
| |
|
| |
|
| Change the name of the <code>info_landmark</code> entities so that the one in the starting room is named "landmark_b" and the one in the ending safehouse is named "landmark_a". Remember "landmark_a" we created in the first map? We're going to link the changelevel in our new map to it, open the trigger_changelevel's properties and replace "landmark_b" with "landmark_a" and "lst_l4dmap_b" with "lst_l4dmap_a". After changing up the names, finish up by compiling the map and repeating the nav creation steps you used for the previous map, don't forget to mark the spawn room with the checkpoint attribute. If all goes well, you should now have a working 2 level campaign.
| | == 製作第二章地圖 == |
| | 如果你已經明白如何製作你第一個地圖,第二個圖基本上没有難度。 |
|
| |
|
| == Additional possibilities == | | == 附加事項 == |
| For spawn areas in later chapters of the campaign, you do not have to keep using the <code>weapon_smg_spawn</code> and <code>weapon_pumpshotgun_spawn</code> you used in the first map as most players will likely have already swapped these for other more powerful weapons they've found along the way. These more powerful weapons you can use in the spawn areas for the later chapters will usually consist of:
| | 還有很多武器可以使用,你不一定只用SMG或Pump-shotgun: |
| * a <code>weapon_rifle_spawn</code>, <code>weapon_autoshotgun_spawn</code>, and a <code>weapon_hunting_rifle_spawn</code>. | | * <code>weapon_rifle_spawn</code> |
| | * <code>weapon_autoshotgun_spawn</code> |
| | * <code>weapon_hunting_rifle_spawn</code> |
|
| |
|
| == See also == | | == 相關資料 == |
| * [[Left 4 Dead Level Creation]] | | * {{L|Left 4 Dead Level Creation}} |
| * [[Navigation Meshes]] | | * {{L|Navigation Meshes}} |
|
| |
|
| [[Category:Left 4 Dead]]
| | {{ACategory|Left 4 Dead}} |
這個教程會教大家製作一個基本的Left 4 Dead(en)地圖。教程會教大家如何使用一些在必需Left 4 Dead(en)地圖上必要的Entity(en) , 例如Director,生成可用的武器和生成喪屍等等。還解釋一些地圖製作者常犯的錯。
這個教程對象並不是入門級的地圖製作者,所以教程所用的技巧可能看不懂,建議先看Basic level construction(en)。
本教程地圖的布局。
這個教程會教大家製作一個一共包含兩個章地圖的戰役,但永遠玩不完,没有結局。Sounds fun, right? 這個教程目標不是完整的戰役,但會教大家如何製作一個基作的基本的L4D地圖。
首先,製作一個可玩的L4D地圖需要以下的東西:
- A director (導演)
- 生還者開始地點
- 兩道安全門
- 武器,彈藥和藥包
- 救出死去同伴的密室
- 轉換地圖
- 雾的控制器 (粒子效果需要)
以下教程會根據右面那張圖的布局。
還有的是Hammer並没有中文版,所以一些功能上的字眼仍然使用英文。
生還者開始地點
首先在上圖最左邊(區域紅色1)里面增加一個Entity名叫info_player_start
。之後,增加另外兩個Entity,info_director
和env_fog_controller
,這兩個Entity放在那裡都可以。為了方便,建議都放到區域1。
之後確保env_fog_controller
的「Properties」內,「Fog Enable」是「Yes」的。
在這里,我們可以新增加以下補給的Entity:
- 四個藥包,
weapon_first_aid_kit_spawn
- 兩支槍;
weapon_smg_spawn
和 weapon_pumpshotgun_spawn
- 彈藥
weapon_ammo_spawn
開始地點需要一道安全門,新增一個Entity叫prop_door_rotating_checkpoint
。在「Properties」里,更改名稱(Name)為「checkpoint_exit」,「Spawn Position」設定成「Closed」,「world model」設成「models/props_doors/checkpoint_door_01.mdl」和確定「Flag」內的「Starts Open」没有被選取。還有確保安全門上「EXIT」的標誌是向內的。
生還者開始地點大致上完成,最後增加一個Entity叫info_landmark
,並命名為「landmark_a」,之後會解釋為什麼。
救出死去同伴的密室
之後我們會製作兩個小密室(上圖區域2),救出死去同伴。在第一個小密室里,大家只需要增加四個Entity,包括三個info_survivor_rescue
和一個prop_door_rotating
。在第二個小密室里,同樣做法。
我們需要一道闊54個單位,高104個單位的門,所以prop_door_rotating
里的「world model」設成「models/props_doors/doormain01.mdl」。
安全室和轉換地圖
現在我們製作一個可以轉換到下一個地圖的安全室。安全室(區域3)門口位新增一個一道門prop_door_rotating_checkpoint
,這里與之前的安全門有少許不相同,開它的「Properties」,並把它命名為「checkpoint_entrance」,「world model」設成「models/props_doors/checkpoint_door_02.mdl」,亦都確保「Flag」內的「Starts Open」是選取了的。還有安全門上「小屋圖示」是向外的。
我們要轉換地圖需要增加info_landmark
和 trigger_changelevel
。首先我們在安全室的中間位置增加info_landmark
,之後將其命名為「landmark_2」。現在我們在安全室內建立一個大型的方塊(Brush),方塊的大小要蓋著整個安全室,不可有空位,最低限度需要貼著牆邊,穿過牆都不要緊。之後開啟trigger_changelevel
的「Properties」,「landmark name」設成「landmark_b」和「Next map」設成「1st_l4dmap_b」。
製作路線(Nav)
要令電腦玩家懂得在你的地圖上走動,無論是生還者或感染者,你都需要為你的地圖製作一個路線圖(mapname.nav 檔案)。製作一個基本的路線圖,你需要編譯你的地圖,並進入遊戲,成功載入你的地圖。當地圖完全載入,你的準星要描著地上,開啟指令控制台(按~鍵),輸入以下指令:
sv_cheats 1
nav_edit 1
nav_mark_walkable
nav_generate
當你選入了nav_generate
,地圖會自動運算路線圖。如果你運氣好的話,當運算完畢時你不會再看見錯誤信息「NAV ERRORS - Map is unplayable!」,因為nav_generate
亦都會為你的路線圖設定屬性(Attribute)。
用「select_with_attribute A」指令以看到一些屬性變化。選取了的區域(淡黃高亮)是所「Marked」的屬性。例子,現在我們想找CHECKPOINT的位置,使用「select_with_attribute CHECKPOINT」指令,選取了的區域(淡黃高亮)就是CHECKPOINT位置。
選入「nav_edit 1」指令,之後選入以下指令:
- select_with_attribute DOOR
- 有門的地方會被選取。
- select_with_attribute CHECKPOINT
- 安全室會被選取。
- select_with_attribute RESCUE_CLOSET
- 救同伴的密室會被選取。
- select_with_attribute ESCAPE_ROUTE
- 有很多區域會被選取,由生還者玩家開始地點到安全室。
using select_with_attribute DOOR
using select_with_attribute CHECKPOINT
using select_with_attribute RESCUE_CLOSET
NAV Marking
在這個情況,「nav_generate」所生成的路線圖是十分完美的,所有相關的屬性都已經為我們設定好了。但是有時候運氣不是太好,需要手動設定一些屬性。你要用指令「mark A」,A是你想設定的屬於。
例如,「nav_generate」不能自動設定安全室的屬地,你需要以下指令:
sv_cheats 1
nav_edit 1
現在到安全室,準星向著安全室的地上,打開控制台,選入:
有時候安全室內有多個區域需要設定成CHECKPOINT,我們可以用指令:
the nav mesh now with both checkpoints marked
方便選取多個區域。選取後,同樣做法,在控制台,選入「mark CHECKPOINT」。
如果你設定錯誤,可以用以下指令:
nav_clear_attribute A
- 你想移除某區域內屬性A (eg:
nav_clear_attribute CHECKPOINT
)
或者你想移除整個地圖的屬性,可用以下指令:
當你完成了設定屬性後,切記儲存,指令是「nav_save
」。之後你需要用指令「nav_analyze
」分析一次你的地圖。
感染者出現在你的地圖
現在你的路線圖已經完成,你需要選入以下指令才會有喪屍生成:
director_stop
director_start
製作第二章地圖
如果你已經明白如何製作你第一個地圖,第二個圖基本上没有難度。
附加事項
還有很多武器可以使用,你不一定只用SMG或Pump-shotgun:
weapon_rifle_spawn
weapon_autoshotgun_spawn
weapon_hunting_rifle_spawn
相關資料