====== Modding ====== ===== Prerequisites ===== * Install [[https://www.unrealengine.com/en-US/download|Unreal Engine]] 5.4.4 in the Epic Games Launcher. Make sure not to use any other version. {{pasted:20250603-162652.png?nolink&600}} * Install [[https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x86&rid=win-x86&os=win10&apphost_version=8.0.13|.NET 8.0 Runtime]]. The link should directly start the download. ===== Download the Modding SDK ==== * You can find the latest and older Modding SDK Versions on [[https://github.com/SimuverseInteractive/SubwaySim2-ModdingSDK|GitHub]]. ===== Creating a mod ===== * Go to ''Modding SDK\Plugins\SubwaySim_Extern'' in the downloaded SDK. * Rename the folder ''Simuverse_ModTemplate'' to ''YourName_YourMod'' and inside the folder rename the file ''Simuverse_ModTemplate.uplugin'' to ''YourName_YourMod.uplugin''. * Rename all occurences of ''Simuverse_ModTemplate'' to ''YourName_YourMod'' in ''YourName_YourMod.uplugin'' and ''Lua\mod.lua''. * Start the project by double clicking ''Modding SDK\SubwaySim2.uproject''. * Enable ''Show Plugin Content'' in the ''Settings'' of the ''Content Browser''. {{pasted:20250603-135837.png?nolink&600}} * If you plan to create a map mod, you need to make sure that "Update Navigation Automatically" is enabled in the Editor for the NavMesh: Edit -> Editor Preferences -> Level Editor -> Miscellaneous -> Editing". {{pasted:20250606-191208.png?nolink&600}} * Now you can use the content folder ''All > Plugins > YourName_YourMod Content'' for your mod content and the Lua folder ''Modding SDK\Plugins\SubwaySim_Extern\YourName_YourMod\Lua'' for your Lua scripts. * We provide assets for your mods to build upon in the ''SubwaySim2_Modding'' plugin but do not modify them as the changes will be ignored. ===== Building a mod ===== * Open the build script ''BuildMod.bat'' in a text editor to adjust the variables. * Set ''DLC_NAME'' to ''YourName_YourMod'', ''ENGINE_ROOT'' to your engine path and ''LEVEL_PATH'' to your level (leave empty if not applicable). Example usages: set DLC_NAME=Simuverse_SampleModMap set LEVEL_PATH=Level/SampleModMap set DLC_NAME=Simuverse_SampleModVehicle set LEVEL_PATH= * Run the build script by double clicking ''BuildMod.bat''. * If you filled out the level path you can type ''y'' when asked to build the NavMesh for your level. * Some errors and warnings are expected and can usually be ignored if the mod has been built successfully. * The mod will be built in ''Modding SDK\Output\YourName_YourMod.pak''. Subsequent build times will be much shorter. ===== Installing a mod ===== * Place the mod in ''%userprofile%\Documents\My Games\SubwaySim 2\Mods'' (create the folder if it does not exist). {{pasted:20250606-191859.png?nolink&300}} * The SampleModMap can be selected in the "Choose City" menu and the SampleModVehicle can be selected as a vehicle in Berlin. ===== Testing Lua scripts without rebuilding the mod ===== * Create an empty folder for your plugin ''%userprofile%\Documents\My Games\SubwaySim 2\Mods\YourName_YourMod\''. * Copy the Lua scripts from your Lua folder inside this folder maintaing the same folder structure. * The game will now use the Lua scripts from this folder if they exist, otherwise it falls back to the mod itself.