Jump to content
Sign in to follow this  
PurpleGaga27

For modders who wanted to patch their own mods, read this (and correct me if I am wrong on some parts)

Recommended Posts

This was a very tough challenge for me and this time it will be difficult for me to explain to you modders how to patch a mod, just like how Bibber explained to another modder. The AptUI and the Misc BIG files work as individual files but must be mentioned in the skudef file to run any mod. For modding AptUI you need the C&C3 A New Experience source code which comes with instructions. The Misc files are automatically compiled independently from the static/global data of the mod thanks to Bibber's modified RA3 Mod Buildstudio program.

I don't know who created this Run.bat file, but I like to thank the modder for it because the coding of the compilation is mostly derived from Bibber's modified RA3 Mod Buildstudio for C&C3. The Run.bat file is highly recommended for patching a mod. You use that file after compiling the full mod from Bibber's modified RA3 Mod Buildstudio. Notice this parameter was added in the Building Mod Data section: /bps:"BuiltMods\mod.manifest". The compiled "mod.manifest" from your original mod needs to be copied to "C&C3 Mod SDK\BuildMods" in order to apply a mod patch. When you apply the Run.bat, type the name of the mod (based on the mod folder) and press enter.


@echo off
set /P modname=

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 /bps:"BuiltMods\mod.manifest"
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%\misc\data\ini" rd /s /q "%cd%\BuiltMods\mods\%modname%\misc\data\ini"
if exist "%cd%\Mods\%modname%\misc\data\ini" xcopy /s /i "%cd%\Mods\%modname%\misc\data\ini\*.ini" "%cd%\BuiltMods\mods\%modname%\misc\data\ini"

echo.
echo *** Copying scripts... ***
echo.
if exist "%cd%\BuiltMods\mods\%modname%\misc\data\scripts" rd /s /q "%cd%\BuiltMods\mods\%modname%\misc\data\scripts"
if exist "%cd%\Mods\%modname%\misc\data\scripts" xcopy /s /i "%cd%\Mods\%modname%\misc\data\scripts" "%cd%\BuiltMods\mods\%modname%\misc\data\scripts"

echo.
echo *** Copying movies... ***
echo.
if exist "%cd%\BuiltMods\mods\%modname%\misc\data\movies" rd /s /q "%cd%\BuiltMods\mods\%modname%\misc\data\movies"
if exist "%cd%\Mods\%modname%\misc\data\movies" xcopy /s /i "%cd%\Mods\%modname%\misc\data\movies" "%cd%\BuiltMods\mods\%modname%\misc\data\movies"

echo.
echo *** Copying maps... ***
echo.
if exist "%cd%\BuiltMods\mods\%modname%\misc\data\maps" rd /s /q "%cd%\BuiltMods\mods\%modname%\misc\data\maps"
if exist "%cd%\Mods\%modname%\misc\data\maps" xcopy /s /i "%cd%\Mods\%modname%\misc\data\maps" "%cd%\BuiltMods\mods\%modname%\misc\data\maps"

echo.
echo *** Copying str file if it exists... ***
echo.
if exist "%cd%\BuiltMods\mods\%modname%\misc\data\mod.str" del /q "%cd%\BuiltMods\mods\%modname%\misc\data\mod.str"
if exist "%cd%\Mods\%modname%\misc\data\mod.str" copy "%cd%\Mods\%modname%\misc\data\mod.str" "%cd%\BuiltMods\mods\%modname%\misc\data"

echo.
echo *** Copying Shaders... ***
echo.
if not exist "%cd%\BuiltMods\mods\%modname%\misc\data\Shaders" md "%cd%\BuiltMods\mods\%modname%\misc\data\Shaders"
copy "%cd%\misc\data\Shaders\*.fx" "%cd%\BuiltMods\mods\%modname%\misc\data\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 *** 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



You can also use /bps:"BuiltMods\worldbuilder.manifest" if you are patching and adding new and extra civilian assets. However the usage of compiling with Low LOD is not needed because Worldbuilder assets don't use Low LOD.


Here is what I know:

Bibber mentioned to create a new mod folder for a patch but it didn't work out for me. However for audio, sound or map files that must reference another file from the original mod folder (type instance or all), it cannot be done for a patch because that will lead to errors. The audio, sound or map files must be compiled in the original mod. For me, I sticked with the same original mod folder and created another mod.xml sort of file (such as mod_0.37.xml) because then files of mod_0.37.manifest, mod_0.37.bin, mod_0.37.relo, mod_0.37.imp and mod_0.37.version will be compiled that way. The patch should contain only your changes with the default references to static, global and audio. Also include the original mod.xml (type="all") of whatever version you started with the original. Note that you can also patch a patch with the same technique. However, the first time you compile a mod, the files from the "Buildmods\mods\your mod name" need to be moved to another folder so when you compile the patch it doesn't need the original mod files.

When I did a patch specifically for the civilian and most neutral asset files that work in Worldbuilder, the Low LOD parameters should not be mentioned and used in Run.bat and even BuildMod.bat. Worldbuilder asset files don't need Low LOD and not even Medium LOD.

When finished compiling a patch mod via Run.bat, a copy was made in the Buildmods folder while the original compiled mod is put into the mod folder inside Command & Conquer 3\Mods in your Documents folder (if you are in Windows Vista and above versions). You may have to rename the file with a version number (such as TacitusA_0.3.big instead of TacitusA_.big). You also have to mention that patched file in your mod skudef file.

Based on this example on a successful run of a mod with split files:
post-7612-0-87093400-1469485941_thumb.jpg

Bibber's modified RA3 Mod Buildstudio program doesn't have this option to include (ex. /bps:"BuiltMods\mod.manifest") or change mod.xml into another name like ModWB.xml because then you have edit the executable from either Visual Studio or MS Framework unless you have coding experience and the same goes to WrathEd and the RA3 Mod SDK.

I hope this helps out.

Edited by zocom7

Share this post


Link to post

Totally convoluted way of doing it but it basically works.

WrathEd already creates patches, it just patches the original game files, so patching a mod is nothing but creating a new one and pointing the -bps param to the old. Editing either build studios .cs file is super easy, even if you know nothing about C#, but hey I already established you only regurgitate what others have presented you on a silver platter.

Edited by Lauren

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×