This article relates to the game "Half-Life: Alyx". Click here for more information.
This article relates to the workshop tools for "Half-Life: Alyx". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Half-Life: Alyx Workshop Tools/Level Design/Doors:zh-cn

From Valve Developer Community
Jump to: navigation, search

English (en)русский (ru)中文 (zh)
... Icon-Important.png

介绍

这个教程将会教您如何为以HL:A为基础的游戏创造门。这些门可以通过抓取门把手打开然后让它前后移动。

创建过程

创建两个高度至少为128单位且相距8个单位的房间。

HLA SDK Doors Img1.png

插入一个 prop_static实体,对于这篇教程,选择 models/architecture/doors_1/door_frame_basic_001.vmdl 这个模型。

HLA SDK Doors Img2.png

选择连接房间的两个面,并使用门框作为参照物切割它们并删除框架内的面。(小记:如果要防止以后细分时出现纹理对齐的问题,请选择要在其中切割孔的面,并按Alt+N键将其与房间的其余部分分开。然后,在切割时,沿整个面部长度和高度切割,而不是仅沿门框边缘切割。)

HLA SDK Doors Img3.png

插入一个 prop_door_rotating_physics实体,在这个教程中,我们将会选择 models/architecture/doors_1/door_1a_40_92.vmdl 模型。

HLA SDK Doors Img4.png

把网格大小调至2格并将门与门框对齐。 为了真实性,将属性 Open Direction(打开朝向)调到 Open Forward Only(只向前开)或 Open Backward Only(只向后开) ,因为在现实生活中门不能双向打开。

HLA SDK Doors Img5.png

完成

编译并运行您的地图然后您应该就有了一扇能工作的门。

您可在此下载示例地图 [[1]].

HLA SDK Doors Img6.png

损坏的细分与其成因

当您在后续开发过程中, (比如您想使用支持Blend Painting的贴图,) 如果面一开始没有被提取(extracted)就被切割, 您会发现贴图会有稍许变形。这是由于当切割时,额外的顶点被添加到了受影响的面,把它从一个有4个顶点的四边形变成了有5个或更多顶点的"n-gon"。您可以通过删除额外的顶点来修复这个问题。

一个带有细分的面的例子,左边的一面有正常的细分,而右边则有损坏的细分。注意,有坏细分的面的纹理是略微扭曲的。


选择有坏细分的面然后把它从房间上提取出来(点击侧边栏上的“Extract Faces”或者按 Alt + N)然后按 Ctrl + H 来隐藏除了选择的面的所有面。

HLA SDK Doors Subdivision Img2.png


Then, in the Vertices selection mode select and delete any vertices that aren't on the four corners.

HLA SDK Doors Subdivision Img3.png


Press U to unhide the rest of the room. In the Meshes selection mode select both the newly fixed face and the room with Shift+Left-click, then press M (Or click on the 'Merge Meshes' button on the sidebar to the left.)

HLA SDK Doors Subdivision Img4.png


Repeat the process with any other affected faces, and your textures should be aligned properly again.

HLA SDK Doors Subdivision Img5.png