C&C3 Beginner's guide - how to mod C&C3 (coding only).
Posted by feillyne on Dec 16th, 2009
Basic Client Side Coding.
Existing or required or created by game devs
User-created / to create or copy
II) The preparation for making a mod:
1. Update your C&C3 to the latest version.
3. Download additional tools, i.e. C&C3 Extras:
Copy the content of the archive to your C&C3 MOD SDK folder, you can find it in your main game folder, e.g. D:\Program Files\Electronic Arts\Command & Conquer 3\MOD SDK
If it asks you to overwrite some of the files, agree.
4. Preparing the mod folder:
1) go to Mods folder inside MOD SDK folder
2) create a folder called FirstMod
3) inside FirstMod create a folder data, go back to main Mods folder
4) then choose already existing SampleMod folder
5) go to data folder
6) copy files Mod.xml and mod.str to your data folder in FirstMod directory
III) Main modding:
1. Copying interesting files.
1) Go to MOD SDK main folder, then choose CnC3Xml
2) choose GDI folder
3) then Units folder
4) Copy GDIRifleSoldier.xml and GDIRifleSoldierSquad.xml to your FirstMod data folder (to DATA folder, not to main FirstMod folder)
5) select both of them, right-click them, choose Properties, uncheck Read-only if checked (otherwise you won't be able to save anything changed in these files)
2. Browsing files
1) open GDIRifleSoldier.xml with a text editor
2) scroll down to a code line id="GDIRifleSoldier"
(All other lines, which contain "include" at the beginning of them, are telling the mod creator to include these art files when compiling/creating a mod.)
3) id="GDIRifleSoldier" equals to UnitNameInsideTheGame=GDIRifleSoldier (one soldier only, not entire squad)
4) inheritFrom="BaseInfantry", the unit inherits various infantry properties from BaseInfantry.xml file & the set found in there.
These specify the portrait for the unit when A) selected and B) on GDI Barracks sidebar.
6) Side="GDI", pretty self-explanatory ;-)
World Builder sorting, e.g. "UNIT" or "STRUCTURE".
How much transport space the unit will take (change rather squad's TransportSlotCount)
The cost of the unit (as above, rather look at squad files).
Build time of the unit (0.5 half a second).
11) We skip some of the unit properties and look up these:
A) KindOf= specifies unit abilities (e.g. SELECTABLE CAN_ATTACK, it's selectable, can attack)
the unit can be found on the specific tab of units/structres (e.g. "INFANTRY", "AIRCRAFT", "MAIN_STRUCTURE" and so on)
World Builder name.
The full description of the unit.
The short description of the unit.
(between <DisplayName> </DisplayName> tags)
The name of the unit in-game.
Note: GDIRifleSoldierSquad as EditorName is different from GDIRiflemanSquad as the in-game name (Name:GDIRiflemanSquad)!
3. Editing files:
1) open GDIRifleSoldierSquad.xml
3) save and close the file.
If you can't save it, without closing the file, right-click the file, choose file properties, untick "read only" if left ticked.
Note: every file copied from CnC3Xml is read-only, and it should be made writable (by you), i.e. with the read-only option unticked!
4. Editing text/lang files:
1) open mod.str
// String file for Command & Conquer 3
// comment: DO NOT TRANSLATE
"Sample Modded AI"
"Cheap Riflemen Squad"
"Super Advanced Infantry. Strong vs. Everything"
"Ultra cheap GDI infantry"
"Abilities: \n »None"
"The ultra cheap infantry of GDI, you can spam the entire map with them! These basic infantry squads really enjoy taking civilian buidings, haha!"
Note: \n makes a break between lines.
5. Editing main Mod.xml file
1) open file Mod.xml
<!--UI Mod--> <Include type="reference" source="DATA:SampleMod/Data/AptUI/MainMenu.xml" /> <Include type="reference" source="DATA:SampleMod/Data/AptUI/TacticalHUD.xml" /> <Include type="all" source="DATA:SampleMod/Data/SoundMod.xml" /> <!--Artwork include for Elven Warriors Portrait--> <Include type="all" source="ART:Images/SampleUpdatedPackedImages.xml" /> <!--Sample AI--> <Include type="all" source="DATA:SampleMod/Data/AI/SampleNodOpeningMoves.xml" /> <Include type="all" source="DATA:SampleMod/Data/AI/SampleNodPersonality.xml" /> <Include type="all" source="DATA:SampleMod/Data/AI/SampleNodStates.xml" /> <Include type="all" source="DATA:SampleMod/Data/AI/SampleAITargetHeuristics.xml" /> <!--Files for Elven Warrior Addition--> <Include type="all" source="DATA:SampleMod/Data/SampleUpdatedWeapons.xml" /> <Include type="all" source="DATA:SampleMod/Data/SampleUpdatedArmor.xml" /> <Include type="all" source="DATA:SampleMod/Data/SampleUpdatedLogicCommand.xml" /> <Include type="all" source="DATA:SampleMod/Data/SampleUpdatedLogicCommandSet.xml" /> <Include type="all" source="DATA:SampleMod/Data/GDIElfWarrior.xml"/>
3) Add between Includes tags:
Include type="reference" source="DATA:static.xml"
Include type="reference" source="DATA:global.xml")
<Include type="all" source="DATA:FirstMod/Data/GDIRifleSoldier"/> <Include type="all" source="DATA:FirstMod/Data/GDIRifleSoldierSquad"/>
4) Notice the important changes:
<Include type="all" source="DATA:FirstMod/Data/GDIRifleSoldier.xml"/> <Include type="all" source="DATA:FirstMod/Data/GDIRifleSoldierSquad.xml"/>
In SampleMod mod folder, the basic infantry unit, Elf Warrior, has a different file path:
<Include type="all" source="DATA:SampleMod/Data/GDIElfWarrior.xml"/>
So FirstMod/SampleMod depends on the folder name of your mod!
Also note: white spaces (breaks between lines and before tags) and lower-case letters inside .xml files don't affect the mod functionality in any way (but avoid the file name with white spaces, e.g. Riflemen Squad.xml, instead use e.g. RiflemenSquad.xml).
5) Save the file.
IV) Creating the mod.
1. Return to MOD SDK main directory
2. Run ealamodstudio.exe (RA3 icon)
1) Below Mod Build in the upper left corner there's a field to choose the mod you want to create
2) select FirstMod
3) click Build Mod
4) wait until the build process ends, you should see:
V) Testing of the mod.
1. If you have a localised version of your C&C3, e.g. Italian, German, etc. you need to go to My Documents folder, search for a folder called Command & Conquer 3 Tiberium Wars, then copy the folder called Mods (or just your mod folder inside it, in this case FirstMod) to a folder called e.g. C&C3 Tiberiumkriege or Command & Conquer 3 : Les Guerres du Tiberium (or any other localised folder of your game actually used by C&C3) or FirstMod folder to folder Mods inside it. If Mods folder doesn't exist there, create one.
Note: if you have a localised version of C&C3, you must remember about constant updating your mod folder, i.e. copying the mod folder from Command & Conquer 3 Tiberium Wars to your localised one!
Otherwise you won't see the updated version of your mod!
2. Run C&C3 control panel, choose Game Browser (or any localised one ;-P) button, then Mods tab, choose FirstMod and start & test it! ;-D
(Especially check GDI Riflemen Squad unit.)