Опрос на сайте
Что вы делаете с GTA?

Популярные новости

Magic - TXD Builder 0.9.1

Magic - TXD Builder 0.9.1
Полезная программа для сборки TXD файлов, которая важные параметры, такие как mip map, DXT сжатие... Кроме того, программа

Vertex Alpha в Vice City

Vertex Alpha в Vice City
То, что некогда было доступно лишь в GTA: San Andreas и выше: Vertex Alpha, а потенциально - и физический бленд текстур в

Компактное меню

Компактное меню
Компактное меню для глобальных модов. Исключено все лишнее.

Main Menu Scene

Main Menu Scene
"Main Menu Scene" дает вам возможность создавать собственные сцены в "Главном Меню" игры с кастомными картой и скриптом, при

Rollerskates Mod

Rollerskates Mod
Модификация позволяет кататься на роликах, прямо как пляжные девушки.

09 март 2024

Adding a new interior to GTA 4


Russian version (link)

Introduction
In this article we will try to understand how the interior of the player's first safehouse was added, i.e. Roman's apartment and the adjacent entranceway. This will help you add your own interior to the game.

Which files will be edited
- Interior collision (wbd)
- Models for interiors (wdr/wft)
- The ide file to define the interior
- The wpl file to place the interior

What you'll need
- Text editor
- OpenIV
- 3ds Max with GIMS IV max script supported
- GIMS IV for 3ds Max

The interior of the safe house
Let's start with the ide text file, where the interior itself is initialized and configured.
This file is located here: pc\data\maps\interiors\generic\brownstones.ide
Open it and find the following line:
shitholesave, 0, 3, 2, 56, 100, -1, -1

This is where the definition of the interior itself is located. If we scroll down below, we realize that the interior definition is divided into three sections:
1. shitholesave, 0, 3, 2, 56, 100, -1, -1
2. mloroomstart
3. mloportalstart
Below mloportalstart is the line mloend, which tells us that this is the end of the interior definition.

After examining the sections of the game interiors, I have compiled the approximate parameters of each section. I will say right off the bat that "unk" is an unknown parameter to me.

The first section

collisionName, unk, numRooms, numPortals, numModels, unk, unk, unk
shitholesave,  0,   3,        2,          56,        100, -1,  -1

collisionName (shitholesave) - name of the collision whose model is located here: pc\data\maps\interiors\generic\brownstones.img\shitholesave.wbd\shitholesave
numRooms (3) - number of "rooms" defined in the mloroomstart section
numPortals (2) - number of "portals" defined in the mloportalstart section
numModels (56) - number of models defined in the contents of the first section (Actually, there are 57 models, because the report starts from zero, not one)


Now let's look at the contents of the first section. It sets the location of all models relative to the collision center shitholesave.
modelName, posX, posY, posZ, rotX, rotY, rotZ, rotW, unk, unk,

modelName - model name (wdr/wft)
posX, posY, posZ - position relative to the collision center
rotX, rotY, rotZ, rotW - rotation in quaternions relative to the collision center


Section mloroomstart

In this section the interior rooms are set up. There are three of them: limbo, shitholerm, shitstairoms.
Each game interior has a room called limbo. You can say that it is a common room for the whole interior.
I have depicted the boundaries of these rooms in the screenshots in the form of a blue cube:

Adding a new interior to GTA 4

Adding a new interior to GTA 4

Adding a new interior to GTA 4

Now let's look at the room parameters using the shitholerm example:
interiorName, numModels, numPortals, startX,  startY,  startZ,  endX,     endY,     endZ,       unk, flags,      unk
shitholerm,   41,        1,          4.48729, 6.88999, 4.42927, -10.1903, -5.46523, -0.0108841, 1,   2821791308, 111

interiorName - interiorName. It can be used in the function (native) SET_ROOM_FOR_CHAR_BY_NAME and similar functions
numModels - number of used models in this room from the first section
numPortals - number of used portals in this room from the mloportalstart section
startX, startY, startZ, endX, endY, endZ - start and end position of the imaginary cube that will mark the boundaries of the room


Section mloportalstart

In this section, interior portals are configured. When we cross such a portal, we move to the interior room or to the outside.
There are two of them here:
The first portal moves us between the shitholerm and shitstairoms rooms
The second portal moves us between the street and the shitstairoms room
The screenshot shows these portals as planes:

Adding a new interior to GTA 4

Now let's look at the portal parameters using the second portal as an example:
fromRoomID, toRoomID, posX1,   posY1,    posZ1,    posX2,   posY2,    posZ2,    posX3,   posY3,    posZ3,    posX4,   posY4,    posZ4,    modifierID, unk, unk, unk, unk, flags,     unk
2,          0,        2.92575, -7.98447, -4.37221, 2.92575, -7.98447, -1.67221, 2.92575, -9.68447, -1.67221, 2.92575, -9.68447, -4.37221, 55,	      -1,  -1,  -1,  64,  16777215,  1

fromRoomID, toRoomID - between which rooms we will move by crossing the portal. In this case ID 0 - street, ID 1 - shitholerm, ID 2 - shitstairoms
posX1-posZ4 - four positions of the imaginary plane, which will mark the boundaries of the portal
modifierID - ID of the timecycle modifier. These modifiers are located here: pc\data\timecyclemodifiers.dat. In this case it is the Diner (55) modifier


We are done with ide. Now let's look at the line responsible for placing the interior on the map. This line is located in this file: pc\data\maps\east\brook_s.img\brook_s_strbig0.wpl
This line looks like this:
893.109, -496.1509, 18.40247, 0, -1.867381E-008, 0, -1, shitholesave, 385, -1, 15, 500

Note! The collision model of the interior from shitholesave.wbd is specified here. The same model is specified in the first mlo section.

At the moment, this is all I know about the interiors of GTA IV.

Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.

Добавить свой комментарий

Полужирный Наклонный текст Подчёркнутый текст Зачёркнутый текст | Выравнивание по левому краю По центру Выравнивание по правому краю | Вставка смайликов Выбор цвета | Скрытый текст Вставка цитаты Преобразовать выбранный текст из транслитерации в кириллицу Вставка спойлера
Вопрос: Введите первые 3 (Русские) буквы сайта (заглавные).
Ответ:*
Другие материалы

Добавление нового интерьера в GTA 4

Добавление нового интерьера в GTA 4
[RU] В этой статье мы попробуем разобраться с тем, как был добавлен интерьер первого сейвхауса игрока. Это поможет вам

Adding street names for the game map in GTA 4

Adding street names for the game map in GTA 4
[EN] Street names have been added to GTA IV with names that are displayed on the screen. In this article we will understand

Добавляем имена улиц для игровой карты в GTA 4

Добавляем имена улиц для игровой карты в GTA 4
[RU] В GTA IV были добавлены имена улиц, названия которых отображаются на экране. В этой статье мы разберемся с тем, как

.WFT File Unlocker Script

.WFT File Unlocker Script
Скрипт для снятия блокировки ZModeler с .WFT файлов.
Ads

Группа GTA Builder