UPDATED: How to Convert FiveM MLO to SP

This has to be one of the most frequently asked questions we receive. While there are many YouTube tutorials out there, it's pretty clear that most of these don't have a clue what they're doing. One guy, who has thousands of subscribers thought a ytd file was a metafile. It's not, it contains textures.

The methodology below is proven and will work for most FiveM to SP conversions. Of course some FiveM MLOs are much more complex, particularly those with scripts and multiple streams, but this will get you started and allow you to understand what works and what doesn't.

Before we start

When doing these conversions you need to consider file types. In this case, we will deal with two large categories. Thankfully it's very easy to understand which is what:

1. Metadata files

These are essentially text files that you can view, as simple text, from OpenIV. There are 3 principal files that fall into this category: ymap, ytyp, and ymf.  Read more here: Common GTA 5 Files.

2. Model Files

We will call the 2nd group model files for lack of a better term. These include the 3D models, the associated textures, and collision files - the ones keeping you from clipping through walls or falling through the ground. These are: ybn (collisions), ydr (drawables, 3D models), and ytd (textures). These aren't text files and for that reason they can't be viewed as text from OpenIV.

Requirements

Unless you prefer to do it manually, we strongly recommend you use a mod called the DLC Pack Creator which can be downloaded here.  Just follow the simple directions, choose Map for an MLO conversion, you can name the folder whatever you want. Finally remember to add the dlc entry into dlclist.xml as you would for any other addon installation. 

Note: The method we're using is for the sake of keeping things organized. If you don't care, you can actually dump all the files in the same dlc.rpf and possibly have the solution work as well, it's your choice.

 

Final Steps

Once you've created the addon folder and placed it in your dlcpacks, navigate to:

\dlc.rpf\x64\levels\gta5 (for the folder you just created)

In our example this would be:

Mods\update\x64\dlcpacks\MyNewHouse\dlc.rpf\x64\levels\gta5

Here you'll see 2 folders:

1. One with your chosen folder name and the rpf extension. For example MyNewHouse.rpf. This file takes all the model files from your FiveM stream folder: ybn, ydr, and ytd.

2. The second one with your chosen folder name and _metadata.rpf. For example MyNewHouse_metadata.rpf. Here go the metadata files, ymap, ytyp, and ymf.

So it's easy if you remember that all the metadata files go in the metadata rpf. The model related files go in the other rpf. To install, just drag and drop the correct file types from the FiveM resource's stream folder into the correct rpf within OpenIV.

Tip: From Windows Explorer, in the stream folder of your MLO, set the view to Details and then click on the Type field. This will sort your filetypes so they can easily be grouped and installed.

Final notes: GTA 5 modders are notorious for not following standards. One of the most prolific MLO modders does exactly the opposite of what is recommended here. He puts all the model files in the meta file rpf and all the meta files in the rpf designed for the 3D files. Why do something this contrarian? No idea, perhaps he doesn't understand how files and folders are structured by Rockstar --but it works for him, so to each his own as they say.

And to conclude, FiveM is more forgiving than GTA 5 SP and will allow file names like MyNewHouse_manifest.ymf while SP wants to see _manifest.ymf. In those cases, just rename the file. If not, your MLO will not convert properly and won't load as expected. If you find multiple ymf files (manifest files) you can either try to combine them or split the FiveM MLO into separate DLCs, one for each manifest file.

Combining Multiple YMF Files

To combine ymf files it's suggested to export them to xml from OpenIV. This allows you to use your own favourite text editor. When you export to xml, the files will be renamed myfile.ymf.xml, just as an example. You can then edit that file in Notepad ++ or any text editor. When finished, just drag the xml back into OpenIV and it will be automatically converted to ymf.

So essentially this process consists of using one exported file as the master ymf. It should be renamed _manifest.ymf.xml. As explained just above, it will automatically be converted back to _manifest.ymf by dragging it back into OpenIV when you've combined the individual ymf files into that one master.

The combination itself involves copy pasting the item tag contents. Don't duplicate the headers. You can take a look at the ymf file structure by examining an SP MLO that has multiple ymaps, for example the Malibu Mansion mod for SP.

Using Code Walker for YMF

For those of you familiar and proficient with Code Walker, you can also use that tool to select your MLO and assets and then generate the ymf file. This is done from the Tools menu, under Project Window. From there you'll find a second Tools Menu with an option called Manifest Generator.

This process is used when you create MLOs with Code Walker, but obviously for FiveM conversions to SP simply editing text files is often the easiest and quickest method.

Converting FiveM Scripts

Unfortunately scripts from FiveM don't convert automatically to SP. You can read more about this in this article: Converting FiveM Scripts to SP.

Item Tags

As a side note you will notice that item names in GTA 5 SP are generally in clear plain English, while those in FiveM are in hex.  See examples below.

First the cryptic hex from FiveM:

<Item>
<imapName>0xFF510C1E</imapName>
<manifestFlags/>
<itypDepArray>
<Item>0x94707468</Item>
</itypDepArray>
</Item>

Now the plain English from an SP MLO:

<Item>
<imapName>malibu_mansion_mlo</imapName>
<manifestFlags/>
<itypDepArray>
<Item>malibu_mansion</Item>
</itypDepArray>
 </Item>

In the SP example above, the <imapName> tag has the same name value as you would find in the ymap which logically would be named malibu_mansion_mlo.ymap

and in that ymap itself, you would see this tag:   <name>malibu_mansion_mlo</name> 

Note also the <itypDepArray> tag corresponds to the ytyp file name (malibu_mansion.ytyp)

In summary, you can see from examining existing MLOs that the manifest file (ymf) includes references to both the ymap and ytyp files. Also note while there is only one ymf file in SP, there can be multiple ymap files and multiple ytyp files. 

Some MLOs have one corresponding ytyp file for each ymap file. Others can have fewer ytyp files grouping assets such as props. In contrast, FiveM MLOs often have multiple ymf manifest files and these can be named whatever the creator wants - however in SP MLOs you must have that single file named _manifest.ymf.

Pro Tip

As another side note, you can see the location of the MLO in the ymap file. You can then use those coordinates in the Teleport Custom Coordinates of Menyoo to go there.

<position x="-3223.09600000" y="793.04010000" z="7.50900800"/>

Further Reading

Documentation for manifest files.

The article linked above is an excellent resource explaining the different sections of the ymf files. In passing the Y, as in ymf, refers to the PC platform of GTA V.