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.

Двери

From Valve Developer Community
Jump to: navigation, search

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

На этой обучающей странице вы узнаете, как создавать двери для модов на основе Half-Life: Alyx Half-Life: Alyx. Эти двери можно открыть, взяв дверную ручку и переместив её вперед или назад.


Настройка

Создайте две комнаты, высотой не менее 128 юнитов, отдаленных друг от друга 8 юнитами.

HLA SDK Doors Img1.png

Поставьте сущность prop_static на карту и, для этого руководства, выберите модель models/architecture/doors_1/door_frame_basic_001.vmdl.

HLA SDK Doors Img2.png

Выберите две грани, которые соединяют комнаты, и закрепите их, используя дверную раму в качестве ориентира. Удалите грани внутри рамки.

Note.pngNote:Если вы хотите предотвратить проблемы с выравниванием текстур при последующем разделении, выберите грани, на которых вы планируете прорезать отверстия, и отделите их от остальной части комнаты с помощью 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. В реальной жизни двери не открываются в обе стороны, поэтому не берите пример с cs:go, когда делаете одиночную игру!

HLA SDK Doors Img5.png

Завершение

Скомпилируйте и запустите вашу карту. Ваша дверь должна работать, если вы всё сделали правильно.

Вы можете скачать пример с дверью здесь.

HLA SDK Doors Img6.png

Сломанные подразделения и причины их возникновения

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.

An example of faces with subdivision, with correct subdivision on the left, vs broken on the right. Note how the face with broken subdivision has a slightly warped texture.


Select the face with broken subdivision, and extract it from the room (Either with the 'Extract Faces' button on the sidebar or by doing Alt+N,) then do Ctrl+H to hide everything but the selected face.

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, and, 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