MLO

From GTAMods Wiki
Jump to navigation Jump to search
MLO (IDE section)
Supported games:GTA IV
Brief description:Used to define interiors.
IDE Sections:
2DFX • AMAT • ANIM • CARS • HIER • HAND • MLO • OBJS
PATH • PEDS • TANM • TOBJ • TREE • TXDP • WEAP

MLO is a section in the item definition file in GTA IV. It is used to create interiors.

Format

mlo
# type 1
Name, Flags, NumRooms, NumPortals, NumObjects, LodDistance1, LodDistance2, LodDistance3
    # list of objects, rooms and portals.
mloend
# type 2
Name, Flags, NumRooms, NumPortals, NumObjects
    # list of objects, rooms and portals.
mloend

end

Type 1

GTA IV Identifier Type Description
A Name string Name of the MLO.
B Flags integer MLO Flags.
C NumRooms integer Number of rooms in the MLO.
D NumPortals integer Number of portals in the MLO.
E NumObjects integer Number of objects in the MLO.
F LodDistance1 float First LOD draw distance in units.
G LodDistance2 float Second LOD draw distance in units.
H LodDistance3 float Third LOD draw distance in units.

Type 2

GTA IV Identifier Type Description
A Name string Name of the MLO.
B Flags integer MLO Flags.
C NumRooms integer Number of rooms in the MLO.
D NumPortals integer Number of portals in the MLO.
E NumObjects integer Number of objects in the MLO.

Flags

Bits Dec Hex Name
8 256 0x100 SUBWAY
9 512 0x200 OFFICE
10 1024 0x400 ALLOWRUN
11 2048 0x800 CUTSCENE_ONLY

Object Format

# type 1
ModelName, PositionX, PositionY, PositionZ, RotationX, RotationY, RotationZ, RotationW, Flags, Unknown,
# type 2
ModelName, PositionX, PositionY, PositionZ, RotationX, RotationY, RotationZ, RotationW, Flags,
# type 3
ModelName, PositionX, PositionY, PositionZ, RotationX, RotationY, RotationZ, RotationW,

Object Type 1

GTA IV Identifier Type Description
A ModelName string Name of the .wdr model file without extension.
B, C, D PosX, PosY, PosZ float[3] Object position.
E, F, G, H RotX, RotY, RotZ, RotW float[4] Object rotation as quaternion.
I Flags integer Object flags. Can be 1 or 2.
J Unknown integer -

Object Type 2

GTA IV Identifier Type Description
A ModelName string Name of the .wdr model file without extension.
B, C, D PosX, PosY, PosZ float[3] Object position.
E, F, G, H RotX, RotY, RotZ, RotW float[4] Object rotation as quaternion.
I Flags integer Object flags. Can be 1 or 2.

Object Type 3

GTA IV Identifier Type Description
A ModelName string Name of the .wdr model file without extension.
B, C, D PosX, PosY, PosZ float[3] Object position.
E, F, G, H RotX, RotY, RotZ, RotW float[4] Object rotation as quaternion.

Room Format

mloroomstart
    RoomName, NumObjects, Unknown1, MinX, MinY, MinZ, MaxX, MaxY, MaxZ, Unknown2, TimeCycleModifierHash, Flags
    # list of object indices used in this room in the format N1, N2, N3,... must be equal to NumObjects. if less than a multiple of 16 objects are used, the last unused indices can be padded with -1s.
    roomend
GTA IV Identifier Type Description
A RoomName string Name of the room.
B NumObjects integer Number of objects in this room. Must be a multiple of 16.
C Unknown1 integer Unknown.
D,E,F MinX, MinY, MinZ float[3] Lower left corner of the bounding box for the room.
G,H,I MaxX, MaxY, MaxZ float[3] Upper right corner of the bounding box for the room.
J Unknown2 integer Unknown.
K TimeCycleModifierHash integer Hash of the timecycle modifier applied when the player is inside this room.
L Flags integer Room flags.

Room Flags

Bits Dec Hex Name
0 1 0x1 NO_DIR_LIGHT
1 2 0x2 FREEZEVEHICLES
2 4 0x4 FREEZEPEDS

Portal Format

mloportalstart
    # type 1
    FromRoom, ToRoom, Corner1X, Corner1Y, Corner1Z, Corner2X, Corner2Y, Corner2Z, Corner3X, Corner3Y, Corner3Z, Corner4X, Corner4Y, Corner4Z, AttachedObject1, AttachedObject2, AttachedObject3, AttachedObject4, Flags, Unknown1, Unknown2
    # type 2
    FromRoom, ToRoom, Corner1X, Corner1Y, Corner1Z, Corner2X, Corner2Y, Corner2Z, Corner3X, Corner3Y, Corner3Z, Corner4X, Corner4Y, Corner4Z, AttachedObject1, AttachedObject2, AttachedObject3, AttachedObject4, Flags, Unknown1
    # type 3
    FromRoom, ToRoom, Corner1X, Corner1Y, Corner1Z, Corner2X, Corner2Y, Corner2Z, Corner3X, Corner3Y, Corner3Z, Corner4X, Corner4Y, Corner4Z, AttachedObject1, Flags, Unknown1

Portal Type 1

GTA IV Identifier Type Description
A FromRoom integer Index of the room this portal leads from.
B ToRoom integer Index of the room this portal leads to.
C,D,E Corner1X, Corner1Y, Corner1Z float[3] Position of the first corner of the portal quad.
F,G,H Corner2X, Corner2Y, Corner2Z float[3] Position of the second corner of the portal quad.
I,J,K Corner3X, Corner3Y, Corner3Z float[3] Position of the third corner of the portal quad.
L,M,N Corner4X, Corner4Y, Corner4Z float[3] Position of the fourth corner of the portal quad.
O AttachedObject1 integer Index of the first object attached to this portal, or -1 if unused. Usually a door.
P AttachedObject2 integer Index of the second object attached to this portal, or -1 if unused. Usually a door.
Q AttachedObject3 integer Index of the third object attached to this portal, or -1 if unused. Usually a door.
R AttachedObject4 integer Index of the fourth object attached to this portal, or -1 if unused. Usually a door.
S Flags integer Portal flags.
T Unknown1 integer Unknown.
U Unknown2 integer Unknown.

Portal Type 2

GTA IV Identifier Type Description
A FromRoom integer Index of the room this portal leads from.
B ToRoom integer Index of the room this portal leads to.
C,D,E Corner1X, Corner1Y, Corner1Z float[3] Position of the first corner of the portal quad.
F,G,H Corner2X, Corner2Y, Corner2Z float[3] Position of the second corner of the portal quad.
I,J,K Corner3X, Corner3Y, Corner3Z float[3] Position of the third corner of the portal quad.
L,M,N Corner4X, Corner4Y, Corner4Z float[3] Position of the fourth corner of the portal quad.
O AttachedObject1 integer Index of the first object attached to this portal, or -1 if unused. Usually a door.
P AttachedObject2 integer Index of the second object attached to this portal, or -1 if unused. Usually a door.
Q AttachedObject3 integer Index of the third object attached to this portal, or -1 if unused. Usually a door.
R AttachedObject4 integer Index of the fourth object attached to this portal, or -1 if unused. Usually a door.
S Flags integer Portal flags.
T Unknown1 integer Unknown.

Portal Type 3

GTA IV Identifier Type Description
A FromRoom integer Index of the room this portal leads from.
B ToRoom integer Index of the room this portal leads to.
C,D,E Corner1X, Corner1Y, Corner1Z float[3] Position of the first corner of the portal quad.
F,G,H Corner2X, Corner2Y, Corner2Z float[3] Position of the second corner of the portal quad.
I,J,K Corner3X, Corner3Y, Corner3Z float[3] Position of the third corner of the portal quad.
L,M,N Corner4X, Corner4Y, Corner4Z float[3] Position of the fourth corner of the portal quad.
O AttachedObject1 integer Index of the object attached to this portal, or -1 if unused. Usually a door.
P Flags integer Portal flags.
Q Unknown1 integer Unknown.