Advertisement
Mjjstral

C&C3 Advanced Mod Builder Batch Script

Nov 13th, 2017
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. echo.
  4. echo *** You are using the Advanced Bat ***
  5.  
  6. set /P var="Please enter the mod name: "
  7.  
  8. if "%var%" == "" goto NoModError
  9.  
  10. set version=1.0
  11. set gamever=1.9
  12.  
  13. if not "%1" == "" set version=%1
  14. if not "%2" == "" set gamever=%2
  15.  
  16. echo.
  17. echo.
  18. echo Mod Name: %var% version %version%, for game version %gamever%
  19.  
  20. set mydocs=Your_MOD_is_Here_CopyToDocuments
  21.  
  22. set artpaths=".\Mods\%var%\art;.\Art"
  23. set audiopaths=".\Mods\%var%\audio;.\Audio"
  24. set datapaths=".\Mods\%var%\data;.;.\Mods;.\Cnc3Xml"
  25.  
  26. echo.
  27. echo *** Preparing To Start MOD Compiling Process ***
  28. echo NOTE: For maximum performance pause/close all other HDD and CPU hungry programs/games.
  29.  
  30. echo.
  31. echo *** Building Mod Data... ***
  32. echo.
  33. tools\binaryAssetBuilder.exe "%cd%\Mods\%var%\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /DefaultDataPaths:%datapaths% /DefaultArtPaths:%artpaths% /DefaultAudioPaths:%audiopaths% /ls:true /gui:false /UsePrecompiled:true /vf:true
  34. if not errorlevel 0 goto CriticalErrorBuildingMod
  35. echo --- MOD Data built successfully ...
  36.  
  37.  
  38. echo.
  39. echo *** Building Low LOD... ***
  40. echo.
  41. tools\binaryAssetBuilder.exe "%cd%\Mods\%var%\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /DefaultDataPaths:%datapaths% /DefaultArtPaths:%artpaths% /DefaultAudioPaths:%audiopaths% /ls:true /gui:false /UsePrecompiled:true /vf:true /bcn:LowLOD /bps:"%cd%\BuiltMods\mods\%var%\data\mod.manifest"
  42. echo ...Checking For Errors...
  43. if not errorlevel 0 goto CriticalErrorBuildingModL
  44. echo.
  45. del "%cd%\BuiltMods\mods\%var%\data\mod_l.version"
  46. if not errorlevel 0 goto CriticalErrorDelModL
  47. echo.
  48. echo --- MOD Data Low built successfully ...
  49.  
  50.  
  51. echo.
  52. echo *** Copying ini files... ***
  53. echo.
  54. if exist "%cd%\BuiltMods\mods\%var%\data\ini" rd /s /q "%cd%\BuiltMods\mods\%var%\data\ini"
  55. if exist "%cd%\Mods\%var%\data\ini" xcopy /s /i "%cd%\Mods\%var%\data\ini\*.ini" "%cd%\BuiltMods\mods\%var%\data\ini"
  56. echo ...Checking For Errors...
  57. if not errorlevel 0 goto CriticalErrorINI
  58. echo.
  59. echo --- INI Files copied successfully ...
  60.  
  61.  
  62. echo.
  63. echo *** Copying scripts... ***
  64. echo.
  65. if exist "%cd%\BuiltMods\mods\%var%\data\scripts" rd /s /q "%cd%\BuiltMods\mods\%var%\data\scripts"
  66. if exist "%cd%\Mods\%var%\data\scripts" xcopy /s /i "%cd%\Mods\%var%\data\scripts" "%cd%\BuiltMods\mods\%var%\data\scripts"
  67. echo ...Checking For Errors...
  68. if not errorlevel 0 goto CriticalErrorScript
  69. echo.
  70. echo --- Script Files copied successfully ...
  71.  
  72.  
  73. echo.
  74. echo *** Copying str file if it exists... ***
  75. echo.
  76. if exist "%cd%\BuiltMods\mods\%var%\data\mod.str" del /q "%cd%\BuiltMods\mods\%var%\data\mod.str"
  77. if exist "%cd%\Mods\%var%\data\mod.str" copy "%cd%\Mods\%var%\data\mod.str" "%cd%\BuiltMods\mods\%var%\data"
  78. echo ...Checking For Errors...
  79. if not errorlevel 0 goto CriticalErrorSTR
  80. echo.
  81. echo --- STR Files copied successfully ...
  82.  
  83.  
  84. echo.
  85. echo *** Copying Shaders... ***
  86. echo.
  87. if not exist "%cd%\BuiltMods\mods\%var%\Shaders" md "%cd%\BuiltMods\mods\%var%\Shaders"
  88. copy "%cd%\Shaders\*.fx" "%cd%\BuiltMods\mods\%var%\Shaders"
  89. echo ...Checking For Errors...
  90. if not errorlevel 0 goto CriticalErrorShaders
  91. echo.
  92. echo --- Shaders Copied successfully ....
  93.  
  94. echo.
  95. echo *** Copying Shaders... ***
  96. echo.
  97. if not exist "%cd%\BuiltMods\mods\%var%\CompiledShaders" md "%cd%\BuiltMods\mods\%var%\CompiledShaders"
  98. copy "%cd%\CompiledShaders\*.fxo" "%cd%\BuiltMods\mods\%var%\CompiledShaders"
  99. echo ...Checking For Errors...
  100. if not errorlevel 0 goto CriticalErrorShadersCompiled
  101. echo.
  102. echo --- Shaders Copied successfully ....
  103.  
  104.  
  105. echo.
  106. echo *** Fixing Manifest... ***
  107. echo.
  108. tools\FixManifest.exe "%cd%\BuiltMods\mods\%var%\data\mod.manifest" "%cd%\BuiltMods\mods\%var%\data\mod_L.manifest"
  109. echo ...Checking For Errors...
  110. if not errorlevel 0 goto CriticalErrorFixManifest
  111. echo --- Manifests Fixed ...
  112.  
  113. echo.
  114. echo *** Resolving Civ Assets ***
  115. echo.
  116. tools\AssetResolver.exe -m "%cd%\BuiltMods\mods\%var%\data\mod.manifest" -s mod
  117. echo ...Checking For Errors...
  118. if not errorlevel 0 goto CriticalErrorResolvingCivAssets
  119. echo.
  120. echo --- Civilian Assets Resolved Successfully ...
  121.  
  122.  
  123. echo.
  124. echo *** Creating Mod Big File... ***
  125. echo.
  126. tools\MakeBig.exe -f "%cd%\BuiltMods\mods\%var%" -x:*.asset -o:"%cd%\BuiltMods\mods\%var%_%version%.big"
  127. echo ...Checking For Errors...
  128. if not errorlevel 0 goto CriticalErrorMakingBig
  129. echo.
  130. echo --- Creation of Big Successful ...
  131.  
  132.  
  133. echo.
  134. echo *** Copying built mod... ***
  135. echo.
  136. if not exist "%mydocs%\Command & Conquer 3 Tiberium Wars\mods" md "%mydocs%\Command & Conquer 3 Tiberium Wars\mods
  137. if not exist "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%var%" md "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%var%
  138. copy "builtmods\mods\%var%_%version%.big" "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%var%"
  139. echo ...Checking For Errors...
  140. if not errorlevel 0 goto CriticalErrorCopyMod
  141. echo.
  142. echo --- Copying of build mod successful ...
  143.  
  144.  
  145. echo.
  146. echo *** Creating SkuDef file... ***
  147. echo.
  148. echo mod-game %gamever% > "builtmods\mods\%var%_%version%.SkuDef"
  149. echo add-big %var%_%version%.big >> "builtmods\mods\%var%_%version%.SkuDef"
  150. copy "builtmods\mods\%var%_%version%.SkuDef" "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%var%"
  151. echo ...Checking For Errors...
  152. if not errorlevel 0 goto CriticalErrorSkudef
  153.  
  154.  
  155. echo.
  156. echo *** ---- Build process completed successfully ---- ***
  157. echo --- Your compiled mod is in the same folder where the Bat-s are  ---
  158. echo --- Copy the MOD folder to your "documents/TiberiumWars*/mods" folder ---
  159. goto End
  160.  
  161. :NoModError
  162. echo *** ERROR: No mod name specified. ***
  163. goto end
  164.  
  165.  
  166. :CriticalErrorBuildingMod
  167. echo.
  168. echo *** ERROR: Compilation of 'mod.xml' failed, aborting build process. ***
  169. goto End
  170.  
  171.  
  172. :CriticalErrorBuildingModL
  173. echo.
  174. echo *** ERROR: Compilation of 'mod_l.xml' failed, aborting build process. ***
  175. goto End
  176.  
  177.  
  178. :CriticalErrorDelModL
  179. echo.
  180. echo *** ERROR: Deletion of 'mod_l.version' failed, aborting build process. ***
  181. goto End
  182.  
  183.  
  184. :CriticalErrorINI
  185. echo.
  186. echo *** ERROR: Copying of INI files failed, aborting build process. ***
  187. goto End
  188.  
  189.  
  190. :CriticalErrorScript
  191. echo.
  192. echo *** ERROR: Copying of Script files failed, aborting build process. ***
  193. goto End
  194.  
  195.  
  196. :CriticalErrorSTR
  197. echo.
  198. echo *** ERROR: Copying of STR files failed, aborting build process. ***
  199. goto End
  200.  
  201.  
  202. :CriticalErrorShaders
  203. echo.
  204. echo *** ERROR: Copying of Shader files failed, aborting build process. ***
  205. goto End
  206.  
  207.  
  208. :CriticalErrorShaderCompiled
  209. echo.
  210. echo *** ERROR: Copying of STR files failed, aborting build process. ***
  211. goto End
  212.  
  213.  
  214. :CriticalErrorFixManifest
  215. echo.
  216. echo *** ERROR: Fixing of Manifest files failed, aborting build process. ***
  217. goto End
  218.  
  219.  
  220. :CriticalErrorResolvingCivAssets
  221. echo.
  222. echo *** ERROR: Creation of Civ Assets failed, aborting build process ***
  223. goto End
  224.  
  225.  
  226. :CriticalErrorMakingBig
  227. echo.
  228. echo *** ERROR: Creation of BIG file failed, aborting build process. ***
  229. goto End
  230.  
  231.  
  232. :CriticalErrorCopyMod
  233. echo.
  234. echo *** ERROR: Copying of built mod failed, aborting build process. ***
  235. goto End
  236.  
  237.  
  238. :CriticalErrorSkudef
  239. echo.
  240. echo *** ERROR: Creation of Skudef File failed, aborting build process. ***
  241. goto End
  242.  
  243.  
  244.  
  245. :End
  246.  
  247. echo.
  248. pause
Advertisement
RAW Paste Data Copied
Advertisement