diff --git a/win_build.bat b/win_build.bat index 25508f5b..154c91cf 100644 --- a/win_build.bat +++ b/win_build.bat @@ -6,6 +6,38 @@ set "UE_PATH=C:\Program Files\UE_5.5" set "PROJECT_PATH=%~dp0" set "UAT_PATH=%UE_PATH%\Engine\Build\BatchFiles\RunUAT.bat" + +:: Check if MuJoCo DLL exists in bin directory +if not exist "%MUJOCO_BIN_PATH%\mujoco.dll" ( + echo Error: MuJoCo DLL not found at %MUJOCO_BIN_PATH%\mujoco.dll + echo Please ensure the MuJoCo DLL is properly built and placed in the correct location. + pause + exit /b 1 +) + +:: Copy MuJoCo DLL to the plugin binaries directory if it doesn't exist there +if not exist "%MUJOCO_DLL_PATH%\mujoco.dll" ( + echo Copying MuJoCo DLL to plugin binaries directory... + copy "%MUJOCO_BIN_PATH%\mujoco.dll" "%MUJOCO_DLL_PATH%\" + if errorlevel 1 ( + echo Failed to copy MuJoCo DLL + pause + exit /b 1 + ) +) + +:: Add UE and MuJoCo paths to PATH environment variable +set "PATH=%UE_PATH%\Engine\Binaries\Win64;%MUJOCO_DLL_PATH%;%MUJOCO_BIN_PATH%;%PATH%" + +:: Set the DLL search path for the current process +set "PATH=%PATH%;%MUJOCO_DLL_PATH%;%MUJOCO_BIN_PATH%" + +:: Run the Unreal Editor +:: echo Starting Unreal Editor... +:: start "" "%UE_PATH%\Engine\Binaries\Win64\UnrealEditor.exe" "%PROJECT_PATH%LuckyWorldV2.uproject" + +endlocal + :: Build and package command "%UAT_PATH%" ^ -ScriptsForProject="%PROJECT_PATH%LuckyWorldV2.uproject" ^