.#map


.#map in PC version of GTAV got extension .ymap wheres prefix y stands for win64pc/win64/x64/linux platform

By #maps you can place drawables, static cars, instanced grasses, occlusions or lod/distant lights
All can be done in two ways (at start of game or by script)
Heres example for interior (MLO) #map
Below i will explain main entries in #map what they do and what they are, based on my research:

<name>

Simply - its name of #map

<parent>

Its used in LOD parenting and lod/distant lights parenting.
under parent you define name of parent #map (more in LOD parenting)

<flags value="0"/>

Here theres 4 options:
<flags value="0"/> #map loads at start game, normal drawables
<flags value="1"/> #map load by script, normal drawables
<flags value="2"/> #map load at start game, LOD drawables
<flags value="3"/> #map load by script, LOD drawables

To load #map with flag 1 and/or 3 by menyoo add  below values to spooner xml map file:

<IPLsToLoad load_mp_maps="true" load_sp_maps="false">
<IPL>#map name with flag1 or 3 here<IPL>
<IPL>second #map name with flag 1 or 3<IPL>
add many #map names as you need to load
</IPLsToLoad>

<contentFlags value="0">

Its determines content of #map:
<contentFlags value="1"/> in #map drawables without collision
<contentFlags value="65"/> in #map at least one drawable with embedded collision
<contentFlags value="2"/> LOD
<contentFlags value="18"/> SLOD1 + LOD
<contentFlags value="20"/> SLOD2 + SLOD3
<contentFlags value="1088"/> instanced grass
<contentFlags value="256"/> distant lights
<contentFlags value="128"/> LOD lights
<contentFlags value="32"/> Occlusion
<contentFlags value="513"/> Critical


Flags can be autocalculated by CodeWalker:

<streamingExtentsMin/Max> and <entitiesExtentsMin/Max>

Its boundaries of #map.
entitiesExtentsMin/Max - contains min (lowest value from all props for x,y,z)
and max (highest value from all props for x,y,z)

streamingExtentsMin/Max - these values determines distance of visibility of props from that ymap

Too small values for above entries will make objects invisible or flickering on camera angle.

Boundaries can be autocalculated by CodeWalker:

<entities>

Contains placement of all props (CEntityDef)

<flags value="0">

Flag (for entities not main flag for ymap!) determines how object will affect in game.

<flags value="1572872"/> - for normal static props
<flags value="1572864"/> - for doors, ladders
<flags value="1572866"/> - security gates, radars, objects using clip dictionary
<flags value="68681728"/> - object from drawable dictionary
<flags value="68681728"/> - object in drawable dictionary (LOD)
<flags value="68681736"/> - - object in drawable dictionary (SLOD1)
<flags value="8"/> - emmisive

This section will be updated in future with more flags.

<guid value="0"/>

Its unique id used by scripts to indentify exact object. It can be generated by neos script in 3dsmax while exporting ymap.

<position x="0" y="0" z="0"/>

Its simply x,y,z position of object in game.

<rotation x="0" y="0" z="0" w="1"/>

Game uses quaternions for rotation (x,y,z,w) but when needed rotation in euler (x,y,z) for 3dsmax for example theres online converter https://quaternions.online/
IMPORTANT!
In conversion remember that rotation is mirrored (euler<->quaternion)
So converting euler x,y,z you need to mirror into quaternion -x,-y-z,w same as from quaternion to euler
(examples:
x,-y,z -> -x,y,-z,w
-x,y,-z -> x,-y,z,w)
This do not concerns interior rotation. In MLOs theres no mirrored rotations

<scaleXY> and <scaleZ>

Its used to rescale entity

<parentIndex value="-1"/>

Its used in LOD parenting.
Its uses numbers (indexes) to tag parent for object (starts from 0 to upper numbers)
-1 means it has no parent.
More in LOD parenting

<lodDist value="1000"/>

Number in this value means how far will be visible object in game. In this example object will be visible until 1000 unit coord on any axis (x,y,z) if you will be at distance more than 1000 unit (on any direction x,y,z) then object will dissapear.

<childLodDist value="1000"/>

Same as above but for child (in LOD parenting)

<lodLevel>

LODTYPES_DEPTH_ORPHANHD (objects without any LODs)
LODTYPES_DEPTH_HD (objects with embedded LODs or without it - base for external)
LODTYPES_DEPTH_LOD
LODTYPES_DEPTH_SLOD1
LODTYPES_DEPTH_SLOD2
LODTYPES_DEPTH_SLOD3
LODTYPES_DEPTH_SLOD4

More in LOD parenting.

<numChildren value="0"/>

Used in LOD parenting. Its definies how many childs are in chain for this object.