Advertisement
wigifer

MOHAA Automated Radiant Converter (MOHARC)

Oct 15th, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.70 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. REM If you're reading this online, usage is simple.
  4. REM 1) Create a new file in notepad.
  5. REM 2) Paste everything here, from the "@ECHO OFF" to the last "EXIT". All of it.
  6. REM 3) Change any variables below as required.
  7. REM 4) Click "Save As"
  8. REM 5) Change the "Save As Type" dropdown to all files
  9. REM 6) Save as "MOHARC.bat"
  10. REM 7) When you need it, run it! Just type in the filename (including the .map extension) of your map file, and away you go!
  11.  
  12. REM Note: You will still need to manually move yourmapname.bsp from the MoHAAMap directory below into MoHAA\main\Maps.
  13. REM       I didn't automate this, just in case you realise there's been a problem...
  14. REM       ALSO you may need to run this as an administrator for it to actively write the BSP, or it will just look like it did it and not do it.
  15.  
  16. REM [Set the below to your Medal of Honor Allied Assault directory.]
  17. SET "MoHAADir=c:\Program Files (x86)\EA Games\MOHAA"
  18.  
  19. REM [Set the below to your MoHRadiant Directory.]
  20. SET "MoHAARadiant=c:\Program Files (x86)\MOHAATools"
  21.  
  22. REM [Set the below to the location where you save your MoHRadiant maps to.]
  23. SET "MoHAAMap=c:\Program Files (x86)\EA Games\MOHAA\maps"
  24.  
  25. ECHO ---------------------------
  26. ECHO -                         -
  27. ECHO - MoHAA Automated Radiant -
  28. ECHO -       Converter         -
  29. ECHO -                         -
  30. ECHO ---------------------------
  31. ECHO -                         -
  32. ECHO -   Written by Wigifer    -
  33. ECHO -                         -
  34. ECHO ---------------------------
  35. ECHO.
  36. ECHO.
  37. ECHO This batch file will automate the map making process.
  38. ECHO Note that this file assumes your default directories are as follows:
  39. ECHO - Medal of Honor Allied Assault: %MoHAADir%
  40. ECHO - MoHRadiant: %MoHAARadiant%
  41. ECHO - Your MoHRadiant Saved Map Directory: %MoHAAMap%
  42. ECHO.
  43. ECHO If you need to change these settings, please edit this batch file directly.
  44. ECHO The variables can be found at the top of this batch file.
  45. ECHO.
  46. ECHO Checking for MoHRadiant tools...
  47. IF NOT EXIST "%MoHAARadiant%\q3map.exe" GOTO MissingQ3map
  48. IF NOT EXIST "%MoHAARadiant%\MOHlight.exe" GOTO MissingMOHLight
  49. ECHO MoHRadiant Tools found!
  50. ECHO.
  51.  
  52. :SelectMap
  53. SET /P "MapName=What is the name of the map file you wish to convert? "
  54. ECHO.
  55. ECHO Checking for "%MoHAAMap%\%MapName%"...
  56. IF NOT EXIST "%MoHAAMap%\%MapName%" GOTO DoNotConvert
  57. GOTO Convert
  58.  
  59. :Convert
  60. ECHO File found! Running tools...
  61. ECHO.
  62. ECHO [RUNNING Q3MAP BSP]
  63. CD "%MoHAARadiant%"
  64. q3map.exe -gamedir "%MoHAADir%" "%MoHAAMap%\%MapName%"
  65. ECHO.
  66. ECHO [RUNNING Q3MAP VIS]
  67. q3map.exe -vis -gamedir "%MoHAADir%" "%MoHAAMap%\%MapName%"
  68. ECHO.
  69. ECHO [RUNNING MOHLIGHT VIS]
  70. mohlight.exe -gamedir "%MoHAADir%" "%MoHAAMap%\%MapName%"
  71. ECHO.
  72. ECHO.
  73. ECHO [PROCESSES COMPLETE]
  74. ECHO.
  75. ECHO Thank you for using this conversion tool! Good luck in your map making!
  76. ECHO - Wigifer
  77. ECHO.
  78. ECHO Exiting application...
  79. PAUSE
  80. EXIT
  81.  
  82. :DoNotConvert
  83. ECHO [ERROR] Sorry, but %MoHAAMap%\%MapName% was not found.
  84. CHOICE /M "Do you want to input the file name again?"
  85. IF ERRORLEVEL 2 GOTO NoConvertQuit
  86. IF ERRORLEVEL 1 GOTO SelectMap
  87.  
  88. :NoConvertQuit
  89. ECHO Exiting application.
  90. PAUSE
  91. EXIT
  92.  
  93. :MissingQ3map
  94. IF NOT EXIST "%MoHAARadiant%\MOHlight.exe" GOTO MissingBoth
  95. ECHO [ERROR] You appear to be missing Q3Map.exe from %MoHAARadiant%.
  96. ECHO Please reinstall your map tools before using this batch file again.
  97. PAUSE
  98. EXIT
  99.  
  100. :MissingMOHLight
  101. ECHO [ERROR] You appear to be missing MOHlight.exe from %MoHAARadiant%.
  102. ECHO Please reinstall your map tools before using this batch file again.
  103. PAUSE
  104. EXIT
  105.  
  106. :MissingBoth
  107. ECHO [ERROR] You do not appear to have your tools installed in %MoHAARadiant%.
  108. ECHO Please edit this batch file with the correct path before continuing...
  109. PAUSE
  110. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement