Zh/Half-Life: Alyx Workshop Tools/Level Design/Doors
介绍
这个教程将会教您如何为以HL:A为基础的游戏创造门。这些门可以通过抓取门把手打开然后让它前后移动。
创建过程
创建两个高度至少为128单位且相距8个单位的房间。
插入一个 prop_static实体,对于这篇教程,选择 models/architecture/doors_1/door_frame_basic_001.vmdl 这个模型。
选择连接房间的两个面,并使用门框作为参照物切割它们并删除框架内的面。(小记:如果要防止以后细分时出现纹理对齐的问题,请选择要在其中切割孔的面,并按Alt+N键将其与房间的其余部分分开。然后,在切割时,沿整个面部长度和高度切割,而不是仅沿门框边缘切割。)
插入一个 prop_door_rotating_physics实体,在这个教程中,我们将会选择 models/architecture/doors_1/door_1a_40_92.vmdl 模型。
把网格大小调至2格并将门与门框对齐。 为了真实性,将属性 Open Direction(打开朝向)调到 Open Forward Only(只向前开)或 Open Backward Only(只向前开) ,因为在现实生活中门不能双向打开。
完成
编译并运行您的地图然后您应该就有了一扇能工作的门。
您可在此下载示例地图 [[1]].
Broken subdivisions and what causes them
When you subdivide faces later on in development, (For example, if you want to use a texture that supports Blend Painting,) if faces were cut without being extracted first, you'll notice that the textures will be warped slightly. This is caused by extra vertices added to the affected face during cutting, turning it from a quad with four vertices to an n-gon that has five or more. You can fix this by deleting the extra vertices.
Select the face with broken subdivisions and extract it from the room (Either with the 'Extract Faces' button on the sidebar or by pressing Alt+N,) then do Ctrl+H to hide everything but the selected face.
Then, in the Vertices selection mode select and delete any vertices that aren't on the four corners.
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.)
Repeat the process with any other affected faces, and your textures should be aligned properly again.