User:Asuka-/BuildModIN
From TM-Modding-Wiki
Notes
Parameters: gui
BuildModIN
@echo off
- echo off ;)
@echo Read MyDocs Path...
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Personal') DO SET personal=%%B
if "%personal:~1,11%" == "USERPROFILE" FOR %%A in (%personal%) do set personal=%systemdrive:~0,2%%HOMEPATH%\%personal:~14%
set personal=%personal%\
- Saves the path to MyDocuments in a global variable.
set gui=%1 IF "%1"=="" set gui=false
- Checks if the gui parameter is set.
echo Type your Mod Name: SET /P modname=
- Prompts the user for the mod name.
echo Type your Version: SET /P version=
- Prompts the user for the mod version.
@echo Mod Name: %modname% %version%
- Echos the mod name and version... just a optical thing :)
@echo Building Mod Data... tools\binaryAssetBuilder.exe "%cd%\Mods\%modname%\Data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:%gui% /UsePrecompiled:true /vf:true @echo Building Low LOD... tools\binaryAssetBuilder.exe "%cd%\Mods\%modname%\data\mod.xml" /od:"%cd%\BuiltMods" /iod:"%cd%\BuiltMods" /ls:true /gui:false /UsePrecompiled:true /vf:true /bcn:LowLOD /bps:"%cd%\BuiltMods\mods\%modname%\data\mod.manifest" del "%cd%\Builtmods\mods\%modname%\data\mod_l.version"
- Builds the mod data... with the low LOD stream.
@echo Copying str file if it exists... IF EXIST "%cd%\Mods\%modname%\Data\mod.str" copy "%cd%\Mods\%modname%\Data\mod.str" "%cd%\BuiltMods\mods\%modname%\Data"
- Checks for the mod.str and copies it if available.
@echo Copying Shaders... IF NOT EXIST "%cd%\BuiltMods\mods\%modname%\Shaders" md "%cd%\BuiltMods\mods\%modname%\Shaders" xcopy "%cd%\Mods\%modname%\Shaders\*.*" "%cd%\BuiltMods\mods\%modname%\Shaders" /E
- Copies shaders. NOTE: the shader directory is changed to be in the mod folder.
@echo Copying INIs... IF NOT EXIST "%cd%\BuiltMods\mods\%modname%\Data\INI" md "%cd%\BuiltMods\mods\%modname%\Data\INI" xcopy "%cd%\Mods\%modname%\Data\INI\*.*" "%cd%\BuiltMods\mods\%modname%\Data\INI\" /E
- Same for inis.
@echo Creating Mod Big File... tools\MakeBig.exe -f "%cd%\BuiltMods\mods\%modname%" -x:*.asset -o:"%cd%\BuiltMods\mods\%modname%.big"
- Creates the big file.
@echo Copying built mod... IF NOT EXIST "%personal%Command & Conquer 3 Tiberium Wars\mods\%modname%\%version%" md "%personal%Command & Conquer 3 Tiberium Wars\mods\%modname%\%version%" copy "builtmods\mods\%modname%.big" "%personal%Command & Conquer 3 Tiberium Wars\mods\%modname%\%version%"
- Checks for the mod folder in the MyDocuments folder and creates it if not available. Then copies the big file. NOTE: The big file is stored in a sub directory named by the version. (Multiple Versions can be stored with this with a better overview)
@echo Creating SkuDef and Config... echo mod-game 1.9 >> builtmods\mods\%modname%_%version%.SkuDef echo add-config %version%\config.txt >> builtmods\mods\%modname%_%version%.SkuDef echo add-big %modname%.big >> builtmods\mods\config.txt copy "builtmods\mods\%modname%_%version%.SkuDef" "%personal%Command & Conquer 3 Tiberium Wars\mods\%modname%" copy "builtmods\mods\config.txt" "%personal%Command & Conquer 3 Tiberium Wars\mods\%modname%\%version%"
- Creates and copies the SkuDef files.
del "builtmods\mods\" /Q rd "builtmods\mods\%modname%\" /Q /S
- Deletes the built files, they are not needed anymore...
@echo Free Vars... set personal= set gui=
- Frees the variables.
pause
- Obligatory pause command for checking if all done correctly :)
