Créateur de YTYP
Crée des entrées CBaseArchetypeDef pour tes props custom : nom, texture dictionary, distance de LOD, flags, physics dictionary et asset type. Dépose des fichiers XML .ydr de CodeWalker et la bounding box, le centre et le rayon de la sphère sont mesurés à partir du mesh. Importe n'importe quel ytyp du jeu comme point de départ.
Cet outil et ses notes sont en anglais pour l'instant.
Ytyp
Add archetypes
Bounds are taken in model space with GTA axes (Z up), exactly as the game archetype stores them: the model's own bounding box when it matches the high LOD mesh, otherwise the mesh itself. The sphere is the box centre and half its diagonal, like every game prop. Open each archetype for the notes.
Archetypes (1)
- 1ydr3.18x0.90x0.45
Export
<?xml version="1.0" encoding="UTF-8"?>
<CMapTypes>
<extensions />
<archetypes>
<Item type="CBaseArchetypeDef">
<lodDist value="60" />
<flags value="32" />
<specialAttribute value="0" />
<bbMin x="-1.5877" y="-0.4547" z="0.0047" />
<bbMax x="1.5877" y="0.4468" z="0.4543" />
<bsCentre x="0" y="-0.00395" z="0.2295" />
<bsRadius value="1.6656836" />
<hdTextureDist value="5" />
<name>my_bench</name>
<textureDictionary>my_bench</textureDictionary>
<clipDictionary />
<drawableDictionary />
<physicsDictionary>my_bench</physicsDictionary>
<assetType>ASSET_TYPE_DRAWABLE</assetType>
<assetName>my_bench</assetName>
<extensions />
</Item>
</archetypes>
<name>my_props</name>
<dependencies />
<compositeEntityTypes itemType="CCompositeEntityType" />
</CMapTypes>
CodeWalker XML, same layout as the game's own ytyps. The game needs the binary .ytyp: see Convert.
From a model to a spawnable prop
- In CodeWalker's RPF Explorer, right click your
.ydr(or.yft,.ydd) and its.ytd, Export XML. - Drop the XML files here. Each model becomes an archetype named after the file, with bounds measured and textureDictionary set to the matching .ytd.
- Pick flags and lodDist, fix anything the checks point out, then download
<name>.ytyp.xml. - Convert it in CodeWalker (RPF Explorer, File, Open Folder, Edit mode, Edit, Import XML) and put the
.ytypinstream/with your models. - Add
data_file 'DLC_ITYP_REQUEST' 'stream/<name>.ytyp'tofxmanifest.lua, ensure the resource and reconnect.
The model file, the archetype name and the name you spawn must all be the same. For a .ydr the game finds the model by the archetype name, not by assetName.
What each field does
| Field | Meaning |
|---|---|
name | The model name you spawn and place in ymaps. Same as the model file without extension. |
lodDist | Draw distance in metres. 100 is by far the most common game value (13,968 props), small clutter uses 20 to 40, landmarks 300 and up. |
hdTextureDist | Distance where +hi.ytd / +hidr.ytd HD textures stream in. 5 on 68% of game props. Keep it at or below lodDist. |
flags | Bit field of archetype behaviour (static, dynamic, shadows, cover, animation, doors). See the table below. |
specialAttribute | Marks special objects: 7 normal door, 5 garage door, 8 sliding door, 3 traffic light, 11/13 bushes, 30 clock, 32 street light. 0 for everything else. |
bbMin, bbMax | Axis aligned box in model space, Z up. Used for culling and returned by GetModelDimensions. |
bsCentre, bsRadius | Bounding sphere. In every one of the 33,071 game prop archetypes it is the box centre and half the box diagonal, so the tool calculates it the same way. |
textureDictionary | The .ytd with the textures, without extension. Embedded textures do not need it. |
physicsDictionary | Game props point at a shared physics dictionary. For a custom model with embedded collision use its own name (what Sollumz writes) or leave it empty. |
clipDictionary | The .ycd for animated props, together with flag 512 (anim) or 1024 (UV anim). |
drawableDictionary | Only for models inside a .ydd, with assetType ASSET_TYPE_DRAWABLEDICTIONARY. |
assetType | ASSET_TYPE_DRAWABLE for .ydr, ASSET_TYPE_FRAGMENT for .yft, ASSET_TYPE_DRAWABLEDICTIONARY for .ydd. |
assetName | Written as the name again, like every drawable and fragment prop in the game. |
timeFlags | Only on CTimeArchetypeDef: bit 0 to 23 are the hours the model is visible, bit 24 lets it switch while on screen. 32505919 is 20:00 to 06:00. |
Flag values you will see
| Value | Bits | Used by |
|---|---|---|
0 | none | 11,889 game props, mostly map furniture |
32 | static | Simple fixed custom props |
8192 | don't cast shadows | LOD models, emissive and light props (1,815) |
536870912 | use ambient scale | Interior decoration (2,685) |
537001984 | ambient scale + dynamic | The most common non-zero value (4,690) |
549584896 | ambient scale + dynamic + no AI cover + no player cover | Bins, cones, crates (1,665) |
549584928 | the same + static | prop_wait_bench_01 |
604110848 | ambient scale + door physics + dynamic | 419 doors, with specialAttribute 7 |
1024 | UV animation | Screens, water, scrolling signs |
Common pitfalls
- Prop is invisible. The ytyp is still XML, the
data_fileline is missing, or the archetype name does not match the model file name. - White or purple textures. textureDictionary does not match the
.ytdname, or the .ytd is not streamed. - Prop disappears at screen edges. Bounds too small. Drop the model XML again to measure them.
- Same name as a game prop. Your archetype replaces or duplicates the game one. Give custom props their own prefix.
- Changes do not show. Reconnect. Archetypes are registered when the resource starts.
Where the data comes from
- Default values of the 33,071 game props: the game's own prop ytyps.
- Flag names: CodeWalker archetype panel and Sollumz (special attribute values too).
DLC_ITYP_REQUEST: FiveM data file reference, where it is listed as the equivalent ofPERMANENT_ITYP_FILE.
Plus d'outils config & code
Générateur de server.cfg
Crée un server.cfg complet et fonctionnel : hostname, slots, OneSync, endpoints, tags, resources et permissions ACE.
Générateur de fxmanifest.lua
Génère un manifest de resource valide : fx_version, scripts, page NUI, files, lua54 et dépendances.
Éditeur de handling
Règle la masse, la force motrice, l'adhérence et la suspension depuis une interface, puis exporte en handling.meta ou en Lua.
