First of all, download modloader from here. Make sure to unzip the downloaded package into your resources directory of MTA. Now you must change the folder of the resource from to something like . You can change to whatever you want it to be, for example, for the ABCD server. We strongly recommend you to choose a unique name when doing this so that your users won’t have to download all your modifications again when they join a server with the same resource name.
After you’ve done that, you must give ModLoader access to the restartResource function. The easiest way to do this is by adding under the admin group in acl.xml. Just pop it underneath and you’ll be all set up.
❇ How it Works
Existing ModLoaders use the LD_PRELOAD option available on UNIX-like systems to inject a DLL into the memory space of the Bedrock Dedicated Server executable before it begins to run any code of its own. Since this option is unavailable on Windows, we instead provide an executable which launches the Bedrock Dedicated Server executable as a new process but suspends it on creation, i.e. before any actual code is executed. It then creates a thread in that newly created process which loads the ModLoader DLL while the rest of the process is still frozen. Only once the DLL loading thread has finished will the process actually resume. This ensures that the ModLoader DLL is injected into the executable’s memory space before it runs any code of its own.
The ModLoader itself contains a mapping of reverse-engineered function pointers to several interesting functions from the Bedrock Dedicated Server executable. These function pointers are retrieved by extracting address offsets from .PDB files shipping with the Bedrock Dedicated Server fully automatically (using a target named SymExtract). Using these functions and a runtime function hooking library allows the ModLoader to integrate with the Bedrock Dedicated Server executable and expose an interface to mods.
There are several limitations to this approach, the most stringent one being that any specific ModLoader DLL version is only compatible with exactly one specific Bedrock Dedicated Server executable. Whenever that executable changes the ModLoader DLL needs to be rebuilt since the address offsets to the required functions might have changed. Furthermore, since ModLoader is accessing internal functions in the Bedrock Dedicated Server their signatures could change at any time, requiring modifications in how ModLoader invokes them.
? How to Compile
On Windows, a recent version of the Microsoft Visual C++ compiler suite is required. Both a recent version of the compiler as well as a recent version of the Windows Kit (8.1 or 10) is required. The reason for this is that the SymExtract module which extract the required address offsets depends on the dbghelp library that ships with said Windows Kit versions. There are more dependencies which are nested as git submodules into this repository, so make sure to download them as well when cloning this repository.
git clone --recurse-submodules https://github.com/gomint/modloader.git or git pull --recurse-submodules
Lastly, the .pdb file that ships with the desired Bedrock Dedicated Server executable is required. When invoking CMake to build the ModLoader DLL, make sure to specify a CMake variable that specifies the full path to the .pdb file.
cmake -DMODLOADER_BEDROCK_PDB=<Path to PDB> --build ~/build --target ModLoader
One more note: when compiling for Win64 make sure to explicitly specify the amd64 architecture to MSVC. If you don’t the Preloader binary will not be able to inject the ModLoader DLL into the Bedrock Dedicated Server executable.
Frequently asked questions
We have put together a couple of questions that are asked all the time. If you have any further questions, please feel free to ask
us on our Discord server.
What’s the difference between the launcher and the mod loader?
The launcher is a handy piece of software that installs
the Raft Mod Loader for you. Using the launcher, your
mod loader installation is automatically kept up to date.The mod loader on the other hand modifies parts of the
code of Raft so that you can easily play with mods.
Something isn’t working! Who can help me?
If you encounter any bugs or run into problems while
installing or using our software, please feel free to
contact us on our Discord server.
The mod loader is managed by the launcher. This means that you don’t have to worry about being up-to-date with the mod loader.
However, this also means that it is impossible to install old
versions of the mod loader. This list is for documentation
purposes only and provides links to the changelogs.
|RML version||Raft version||Release date||Changelog|
After you’ve downloaded a mod, you’ll need to take the TXD and DFF and place them in the correct folder. These files must have the name of the GTA harcoded name. They cannot be capitalised at all — it must be completely lowercase. If modloader isn’t loading your mod, make sure it’s in the format of like — not — it’s the number one rule!
Vehicles usually come with a handling file, a TXD (texture) file and a DFF (model) file. ModLoader removes the requirement to understand how to code and lets you easily set up your first vehicle modification. Setting up the handling file needs a little understanding of creating files with custom extensions but setting up the textures and models — the things that make up a visual modification — is super easy.
- Copy the texture and model files into the vehicles folder.
- If your modification contains a handling configuration and you’d like to add it to your server, read the next section.
Installing handling configurations take a little bit of playing around, but it’s easy once you get the hang of it. My lamborghini modification for my infernus came with a README file containing the handling line. I won’t go into detail with how they work, but I’ll just teach you how to import them into modloader.
Your README file might contain something like this.
At the moment, MTA (and by extension, modloader), doesn’t support the feature to import the other files mentioned here, but it doesn’t mean that your modification wont work (albeit not as the author intended). But don’t worry. Just copy the handling contents into your clipboard.
You need to copy this to the same vehicles folder. To do this you need to create a file with the same name as your vehicle. In Notepad, just copy it over, and save the file as . It is really important you set the file types as so that the extension is properly set.
Once you’re done with saving it… that’s it. You’ve got your vehicle and handling file imported into modloader!
Skins and weapons
Replacing skins and weapons work pretty much the same way. In the future we may add the ability to change weapon properties which modifications may give you but at the moment we only support textures (TXD) and models (DFF). It’s simple if you’ve read through everything else above, just move the file into the folder!