Powered by UE4SS lua scripts! This mod focuses primarily towards dedicated server. Some commands work on client-side, though results may vary depending on the game's replication system.
This mod uses a forked UE4SS release available here. If you have the experimental-latest from the base repository, just replace the included UE4SS.dll.
-
Download and extract the UE4SS release into the game
Binaries/Win64directory. -
Download the latest releases here. Extract its contents to
path/to/ue4ss/Mods/directory. The Lua static modules are also available in the relase asshared.zip. Download and extract the contents into thepath/to/ue4ss/Mods/shareddirectory. -
Add these game-specific UE4SS signatures into the
path/to/ue4ss/UE4SS_Signatures:-- FText_Constructor.lua function Register() return "40 53 57 48 83 EC 38 48 89 6C 24 58 48 8B FA" end function OnMatchFound(matchAddress) return matchAddress end
-- GUObjectArray.lua function Register() return "48 8D 0D ?? ?? ?? ?? 48 8B D7 89 5C 24 20 44 8D 4B ??" end function OnMatchFound(matchAddress) local displacement = DerefToInt32(matchAddress + 0x3) return matchAddress + 0x7 + displacement end
-
Clone this repository into your
ue4ss/Modsdirectory.git -C <path/to/ue4ss/Mods> clone https://github.com/drpsyko101/MotorTownMods.git
For a full functionality of the mod, download and extract luasocket to path/to/ue4ss/Mods/shared directory to use the HTTP server. For webhook functionality or any instability while using the REST API, build Luasec either from source or using Luarocks for Win64. Install lua-bcrypt to enable server API authentication with bcrypt hashing algorithm.
The C++ module are included in the release. Any changes to the C++ files need a recompile. These steps are similar to creating a C++ mod tutorial. Please read them before proceeding for a full understanding of the project structure.
-
Clone the RE-UE4SS into the
ue4ssdirectory.git -C <path/to/ue4ss> clone --recurse-submodules https://github.com/drpsyko101/RE-UE4SS.git
-
Create a
xmake.luafile atue4ss/directory with these contents:includes("RE-UE4SS") includes("MotorTownMods")
-
Configure the project with
xmake:xmake f -m "Game__Shipping__Win64" -y -
Generate the Visual Studio solution file:
xmake project -k vsxmake2022 -m "Game__Shipping__Win64" -y -
Open the generated solution in
vsxmake2022/*.sln, and right click on themods/MotorTownModsin the solution explorer and click Build. -
If the build is successfull, copy or create symlink the generated
ue4ss\Binaries\Game__Shipping__Win64\MotorTownMods\MotorTownMods.dlltoue4ss/MotorTownMods/dlls/main.dll.
Most of the server settings can be configured using environment variables:
| Variable name | Default value | Description |
|---|---|---|
MOD_MANAGEMENT_ADDRESS |
0.0.0.0 |
Management listen address. |
MOD_MANAGEMENT_PORT |
5000 |
Management port. Used for managing mods in the dedicated server |
MOD_SERVER_ADDRESS |
0.0.0.0 |
Lua HTTP listen address. This only applies if luasocket module is installed |
MOD_SERVER_PORT |
5001 |
Lua HTTP port. This only applies if luasocket module is installed |
MOD_SERVER_PROCESS_AMOUNT |
5 | The amount of cumulative connection to process. Higher number correspond to quicker response, in return slower event hook. |
MOD_SERVER_LOG_LEVEL |
2 | The server log level. 0=ERROR, 1=WARNING, 2=INFO, 3=VERBOSE, 4=DEBUG |
MOD_WEBHOOK_URL |
none | Webhook URL to send the events to. Requires luasec to function |
MOD_WEBHOOK_METHOD |
POST |
Webhook request method |
MOD_WEBHOOK_EXTRA_HEADERS |
none | Webhook extra headers in a JSON object |
MOD_WEBHOOK_ENABLE_EVENTS |
all |
Enable event hook individually. See webhook documentation for a complete list. |
MOD_SERVER_API_URL |
none | Server API to call from client side |
MOD_SERVER_PASSWORD |
none | Authenticate server request with Authorization: Basic header |
MOD_SERVER_SEND_PARTIAL |
none | Limit server response chunks to 40 bytes (Set to true for older luasocket compatibility) |
Due to the webserver being ran on a separate thread, a stop command must be issued before reloading the mods.
- Send POST
/stopto theMOD_SERVER_PORTserver. A messageWebserver stoppedwill show up in theUE4SS.logindicating the webserver has stopped. - Send POST
/mods/reloadto theMOD_MANAGEMENT_PORTserver. This will reload all the Lua mods including this mod.
More detailed instructions can be found in the docs.
More contributions are welcomed! Read how to contribute here.