- It can take the mod version and game version as second and third parameters. It assumes mod version 1.0 and game version 1.8 if nothing is specified.
- It just tells you whenever you forget to enter a mod name by accident rather than trying to run the mod builder anyway.
- It automatically compiles mod_l.xml so that mods will work in low detail.
- If the build process fails for some reason due to a critical error, it now stops and lets you know it failed rather than carrying on like nothing happened.
- It checks for a data/ini folder and copies it if found, so you no longer have to put your ini files straight in BuiltMods.
- It writes .SkuDef files automatically.
- It adds the mod version to the name of the .big file, making it easy to create 'incremented' mods.
- It allows you to set/change the default search directories for XML assets, so that you no longer have to stuff everything together into a single Art/Audio folder.
Remember to set the correct location of My Documents. Replace 'whereveryourmydocumentsfolderis' with the location of your my documents folder (Such as C:\Documents and Settings\CodeCat\My Documents) as it is in the original BuildMod.bat, or it won't work! Run it as:
BuildMod modname version gameversion
Thanks go to Slye_Fox and Daz for helping me with some of the features.
@echo off if "%1" == "" goto NoModError set modname=%1 set version=1.0 set gamever=1.7 if not "%2" == "" set version=%2 if not "%3" == "" set gamever=%3 echo Mod Name: %modname% version %version%, for game version %gamever% set mydocs=whereveryourmydocumentsfolderis set artpaths=".\Mods\%modname%\art;.\Art" set audiopaths=".\Mods\%modname%\audio;.\Audio" set datapaths=".\Mods\%modname%\data;.;.\Mods;.\Cnc3Xml" echo. echo *** Building Mod Data... *** echo. tools\binaryAssetBuilder.exe "%cd%\Mods\%modname%\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /DefaultDataPaths:%datapaths% /DefaultArtPaths:%artpaths% /DefaultAudioPaths:%audiopaths% /ls:true /gui:false /UsePrecompiled:true /vf:true if not errorlevel 0 goto CriticalErrorBuildingMod echo. echo *** Building Low LOD... *** echo. tools\binaryAssetBuilder.exe "%cd%\Mods\%modname%\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\%modname%\data\mod.manifest" if not errorlevel 0 goto CriticalErrorBuildingModL del "%cd%\BuiltMods\mods\%modname%\data\mod_l.version" echo. echo *** Copying ini files... *** echo. if exist "%cd%\BuiltMods\mods\%modname%\data\ini" rd /s /q "%cd%\BuiltMods\mods\%modname%\data\ini" if exist "%cd%\Mods\%modname%\data\ini" xcopy /s /i "%cd%\Mods\%modname%\data\ini\*.ini" "%cd%\BuiltMods\mods\%modname%\data\ini" echo. echo *** Copying scripts... *** echo. if exist "%cd%\BuiltMods\mods\%modname%\data\scripts" rd /s /q "%cd%\BuiltMods\mods\%modname%\data\scripts" if exist "%cd%\Mods\%modname%\data\scripts" xcopy /s /i "%cd%\Mods\%modname%\data\scripts" "%cd%\BuiltMods\mods\%modname%\data\scripts" echo. echo *** Copying str file if it exists... *** echo. if exist "%cd%\BuiltMods\mods\%modname%\data\mod.str" del /q "%cd%\BuiltMods\mods\%modname%\data\mod.str" if exist "%cd%\Mods\%modname%\data\mod.str" copy "%cd%\Mods\%modname%\data\mod.str" "%cd%\BuiltMods\mods\%modname%\data" echo. echo *** Copying Shaders... *** echo. if not exist "%cd%\BuiltMods\mods\%modname%\Shaders" md "%cd%\BuiltMods\mods\%modname%\Shaders" copy "%cd%\Shaders\*.fx" "%cd%\BuiltMods\mods\%modname%\Shaders" echo. echo *** Creating Mod Big File... *** echo. tools\MakeBig.exe -f "%cd%\BuiltMods\mods\%modname%" -x:*.asset -o:"%cd%\BuiltMods\mods\%modname%_%version%.big" if not errorlevel 0 goto CriticalErrorMakingBig echo. echo *** Copying built mod... *** echo. if not exist "%mydocs%\Command & Conquer 3 Tiberium Wars\mods" md "%mydocs%\Command & Conquer 3 Tiberium Wars\mods" if not exist "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%modname%" md "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%modname%" copy "builtmods\mods\%modname%_%version%.big" "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%modname%" echo. echo *** Creating SkuDef file... *** echo. echo mod-game %gamever% > "builtmods\mods\%modname%_%version%.SkuDef" echo add-big %modname%_%version%.big >> "builtmods\mods\%modname%_%version%.SkuDef" copy "builtmods\mods\%modname%_%version%.SkuDef" "%mydocs%\Command & Conquer 3 Tiberium Wars\mods\%modname%" echo. echo *** Build process completed successfully. *** goto End :NoModError echo *** ERROR: No mod name specified. *** goto end :CriticalErrorBuildingMod echo. echo *** ERROR: Compilation of 'mod.xml' failed, aborting build process. *** goto End :CriticalErrorBuildingModL echo. echo *** ERROR: Compilation of 'mod_l.xml' failed, aborting build process. *** goto End :CriticalErrorMakingBig echo. echo *** ERROR: Creation of BIG file failed, aborting build process. *** goto End :End echo. pause
And as an extra, here is an extra batch script that automatically builds a specific mod. This way you don't have to open a command prompt to enter the mod name, and you don't need to enter it each time you build your mod either (that can get repetitive). Of course, you'll need to adapt this file for your own use, but you can just copy it and have one script for each mod you have. Put the file in Mods\YourModName, like how mine is in Mods\CnCClassic. So NOT in the data folder!
@echo off set modname=CnCClassic set version=0.1 set gamever=1.8 cd ..\.. call BuildMod.bat %modname% %version% %gamever%
Edited by CodeCat, 23 August 2008 - 12:00.