Objects and textures
Custom object packs use a YTYP to define the models available to GTA. After registration, create instances through scripts or place them in a map.
Place the assets
Section titled “Place the assets”With resources.pack.path = "client", a small object pack can use this layout:
client/└── assets/ └── harbor_props/ ├── content.xml └── stream/ ├── harbor_crate.ydr ├── harbor_crate.ytd └── harbor_props.ytyp| File | Purpose |
|---|---|
.ydr or .ydd |
Drawable models. Keep the model or drawable dictionary supplied by the export. |
.ytd |
Texture dictionary referenced by the model and its materials. |
.ytyp |
Archetype definitions that connect model names with their assets and dependencies. |
Keep any additional texture, collision and other dependencies supplied with the pack. The example shows a single model with its own texture dictionary. Packs can share dictionaries or use a different exported structure.
The folder containing content.xml forms the resource root. Paths in that file
resolve from assets/harbor_props/. For archived packs, see
RPF archives.
Register the archetypes
Section titled “Register the archetypes”Add this content.xml:
<?xml version="1.0" encoding="UTF-8"?><CDataFileMgr__ContentsOfDataFileXml> <dataFiles> <Item> <filename>stream/harbor_props.ytyp</filename> <fileType>DLC_ITYP_REQUEST</fileType> </Item> </dataFiles></CDataFileMgr__ContentsOfDataFileXml>DLC_ITYP_REQUEST loads the archetypes from the YTYP. Models and texture
dictionaries are discovered automatically. Declare each YTYP required by the pack.
Use the archetype name from the YTYP when creating the object. In this example,
the archetype is harbor_crate. Keep its drawable and texture dictionary
references consistent with the exported files. Choose unique names for custom
assets to avoid conflicts with other packs.
Create an object
Section titled “Create an object”Publish the resources, restart the server to select the release, then restart GTA through the helper for the new asset set.
This server example creates a shared crate near the beach in dimension 0:
// @ts-check/// <reference types="@revomp/types-server" />import * as revo from 'revo-server';
const crate = new revo.Object( 'harbor_crate', { x: -1220, y: -1765, z: 4.0 }, 0, true,);Run the example from a configured server entry point. Replace harbor_crate
with your archetype name and choose a suitable position. Set the height for the
model’s authored origin and the surface where it should appear.
The third argument is rotation, here a heading of 0 radians. The final
dynamic argument enables physics when true. Use false for an object that
should remain fixed.
Clients load the model as the object enters their stream. Use entityStreamIn
or ready for client work that needs the GTA instance. See
Streaming and readiness.
For a local preview, create a LocalObject in a client script with the model,
position, rotation and physics flag. Remove a shared object with crate.destroy()
on the server, or destroy a local preview from its creating client resource.
Textures and variations
Section titled “Textures and variations”Preserve the texture names referenced by the model’s materials and the texture dictionary references in its archetype. Include shared dictionaries required by the pack. Duplicate dictionary names can affect other models using that name, so keep custom asset names unique. See Names and loading order.
For models with authored tint variants, the server’s textureVariation
property selects a tint index. Texture files and their material references
remain part of the exported asset pack.
To update a texture, publish the changed YTD. Some replacements of existing models or texture dictionaries can apply on reconnect. Adding or removing assets, changing the YTYP, or changing collision files requires a GTA restart. Follow the restart rules.
Check the object
Section titled “Check the object”Inspect the model up close and from a distance, then walk into it to check its collision. For a dynamic object, check how it moves on contact and settles. With two clients, compare its appearance and movement, then leave streaming range and return.
| Symptom | Check |
|---|---|
| The object never appears | Check the archetype name, DLC_ITYP_REQUEST declaration and referenced drawable. Confirm the player is near the object and in the same dimension. |
| Textures are missing or incorrect | Check the material texture names, dictionary references and supplied YTD files. Look for duplicate dictionary names. |
| The object appears at the wrong height | Check the model’s origin and the spawn coordinates. |
| The object has no collision | Check the exported collision data and the object’s collisionEnabled setting. |
| A dynamic object behaves incorrectly | Check the model’s collision and physics setup, then verify it was created with dynamic set to true. |
| The model disappears at an unexpected distance | Check its authored bounds and LOD settings, along with entity streaming distance. |
Check the client logs
for failed to load data file or raw streaming registration failed messages.
Use the reported file path to locate the failing asset or declaration.
For runtime transforms, physics and local accessories, see Moving entities and attaching props.