How do you stream your custom models?

Hi everyone, :waving_hand:

I’ve been seeing more and more custom models on the horse servers lately, and it’s made me want to learn how to make my own as well :smiling_face_with_three_hearts:

Would anyone be willing to share how you stream the models you create? I totally understand if some people prefer to keep their methods private, but I think it would be really nice if more people could get into making their own creations. It would be great to see everyone’s different ideas and creativity. :writing_hand:

Thanks in advance!

1 Like

From my knowledge, unless things have changed recently;
To stream a drawable, you will be replacing an existing one - rename your file to the one you are looking to replace.

To add on new drawables, albedos, etc. by editing assets_drawables.ymt, assets_albedos.ymt then putting those files into %LOCALAPPDATA%\RedM\RedM.app\citizen\platform\packs\base\data\metapeds (if you’ve not done this before, you will need to create the folders to make this directory from your RedM folder), then your new drawables/albedos/etc. go into your resources stream folder. Of course, the downfall with this is it is a client modification and all players connecting to your server will need to make this change on their own systems.

With the rise of similar scripts with custom models, I am also curious if there’s something new that was discovered and if I happen to figure something else out, I will be sure to share! :blush:

ETA: this is assuming you mean entirely new horse models.

Thank you for your answer! Having every player install the models manually would definitely be quite restrictive. However, I’m fairly certain there must be a way to stream them directly to everyone who joins the server. :smiling_face_with_three_hearts:

I’ve noticed a significant increase in servers using entirely new models for horse equipment such as saddle pads, boots, bridles, and other tack. so I imagine adding custom horse models might rely on a similar process. I’ll keep looking into it, and of course, I’ll share anything I find!

Since then, I’ve done a bit more testing and I am a bit closer.
My findings this morning. All files converted with CodeX of course.

Place the asset you want to add into your resources stream folder.

Create an additive assets_drawable.ymt file, ensuring the asset you’re adding is the same name as the drawable you placed inside your stream folder.

Example additive assets_drawable.ymt
<?xml version="1.0" encoding="UTF-8"?>
<MetaPedAssetList>
 <drawableMale />
 <drawableFemale />
 <drawableTeen />
 <drawableAnimal itemType="MetaPedAsset">
  <Item>
   <slodMask value="0" />
   <slodMask1 value="0" />
   <slodMask2 value="0" />
   <guid>xbxvdoba_0xc647e149</guid>
   <guidHd />
   <propertyTags>
    <Item>p_c_horse_01</Item>
    <Item>grfdbenb_0xcef2fe70</Item>
    <Item>wgxauyqa_0x87c878d4</Item>
    <Item>vpwxhmqc_0x2454d0c0</Item>
    <Item>kqcbhsba_0xd033abb3</Item>
    <Item>horse_head</Item>
    <Item>gubcupjb_0xd5f7712c</Item>
    <Item>rwmxtdda_0x97468069</Item>
    <Item>jbpvskha_0xe4e083cf</Item>
   </propertyTags>
   <matchTags>
    <Item>xbxvdoba_0xc647e149</Item>
   </matchTags>
   <restrictions />
   <expressions />
   <expressionSet />
   <lodThresh0 value="10" />
   <lodThresh1 value="10" />
   <slodColor value="0" />
   <slodLayer value="0" />
   <shaderId value="1" />
   <useTintPalette value="False" />
  </Item>
 </drawableAnimal>
 <albedoMale />
 <albedoFemale />
 <albedoTeen />
 <albedoAnimal />
 <normalMale />
 <normalFemale />
 <normalTeen />
 <normalAnimal />
 <materialMale />
 <materialFemale />
 <materialTeen />
 <materialAnimal />
 <tints />
</MetaPedAssetList>

Save this to the root of your resource.

Then, in your fxmanifest:

Add this to your fxmanifest.lua

files { ‘assets_drawable.ymt’ }

data_file ‘METAPED_ASSETS’ ‘assets_drawable.ymt’

Now, this will load the new asset but it won’t rebuild the registry. You need to find a way to do this.
In my situation, I had a basic resource that had a valid, empty assets_drawable.ymt inside. When a player connected, it calls an event which stops the second basic resource and seemingly forced the server to rebuild that asset registry. Once this was completed, I was free to use the new asset as I pleased. This was done every time a connection was made.

Only ensure your main resource. Have a small script inside that will ensure the rebuild script then stop it.

I haven’t been able to really test this with other players, yet. (ETA: As suspected, this current method doesn’t really support late joiners, the script refresh causes them to crash. If a way to do this without crashing or only do it client sided…)

Just discovering these as I go, still trying to look into things deeper, but it is a step closer.
This also worked for additive textures.

Further update, after some more testing, I was able to connect multiple clients to my development server and confirm it works, building off of the base resource with a helper resource setup above.

The server uses a small Python HTTP/HTTPS proxy between the clients and FXServer. It forwards connection and resource download requests, but filters the resource list so only the joining client receives the registry refresh helper. The server then starts and stops that helper, triggering the refresh on that client while existing players remain unaffected.

2 Likes

Hi! I’m trying to use this method to create a completely new animal ped, and I’m currently stuck at the drawable registration part.

I successfully added a new ped called qilin through metapeds.ymt, using the Lion Mangy skeleton/animations as the base. The ped itself spawns correctly, has AI, collision, animations and can attack me, so the new ped hash is definitely being registered.

The problem is that my custom model remains invisible.

My custom YDD contains several drawables:

qilin_body
qilin_body_alt
qilin_eye
qilin_fur
qilin_horn

I also created an additive assets_drawable.ymt with matching GUIDs and mounted it using:

files {
    'assets_drawable.ymt'
}

data_file 'METAPED_ASSETS' 'assets_drawable.ymt'

I even tested by manually adding the entries to the full assets_drawable.ymt inside:

%LOCALAPPDATA%\RedM\RedM.app\citizen\platform\packs\base\data\metapeds

but the custom model was still invisible.

Could you clarify one thing about your working setup?

When you say “ensure the asset you’re adding is the same name as the drawable you placed inside your stream folder”, do you mean that each registered drawable must be its own streamed YDD file, for example:

stream/qilin_body.ydd

with:

<guid>qilin_body</guid>

Or can a single qilin.ydd Drawable Dictionary contain multiple registered drawables such as qilin_body, qilin_eye, etc.?

Also, did your custom ped require additive assets_albedo.ymt, assets_normal.ymt and assets_material.ymt as well, or was assets_drawable.ymt enough when reusing existing MetaPed materials/textures?

If possible, I’d also really appreciate a little more detail about the helper resource you used to force the MetaPed asset registry rebuild. I’m mainly trying to determine whether my invisible model is caused by the YDD structure or simply because the registry is not being rebuilt.

Thanks for sharing your findings — this is one of the few recent discussions I’ve found about truly additive MetaPed assets in RedM.

One more detail that may help narrow this down:

I was able to make the exact same custom model work correctly when I used it on top of the existing Lion Mangy registration.

In that setup, the custom model appeared in-game correctly, was visible, animated properly and behaved as expected.

So the YDD itself, the rig/skeleton and the model are working.

The problem only happens when I try to register the same model as a completely new additive MetaPed drawable/ped, using new GUIDs through assets_drawable.ymt.

That makes me think the issue is specifically related to the additive MetaPed asset registry / drawable registration rather than the model itself.

If your working setup required a specific registry refresh order, naming convention, or one YDD per drawable, that would probably point me in the right direction.