Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

10. Mods Guide

matthew snoddy edited this page Aug 2, 2020 · 11 revisions

This guide covers creating a new infantry type in the game using the NCO mod and C&C mod configuration. You will create a new solider who you can build in-game and tweak the rules for; the same steps can be followed for adding new units.

This guide does not cover:

  • Setting a text description for your new type
  • Showing graphics for your unit in the modern graphics mode
    • A white square will be shown when not using classic mode
  • Setting a sidebar icon for your new type

If you want help on how to do the above, see the test folder I use for this mod which has an example new Infantry & Unit mod in it here. These are not things provided by the mod, they are supported out of the box by C&C for making mods using XML, text and image files.

Adding a New Type

  • Open or create the RULES.INI file inside the mod folder (see here for details)
  • Add a Mods section like so:
[Mods]
NewInfantry=LaserDude

This tells NCO to create a new infantry type with the identifier LaserDude.

For units use the NewUnits rule instead


Below the Mods section create a new section for your mod:

[LaserDude]
BaseType=E1

The BaseType is what the new infantry type should look, act and sound like. In this example a Minigunner will be seen in-game when you create this type.


Your RULES.INI should now look like this:

[Mods]
NewInfantry=LaserDude

[LaserDude]
BaseType=E1

Setting Rules

Note: New types will inherit ALL the rules of the base type, so you should refer to the RULES-DEFAULT.INI file and set new rules for the different things you want to change.

For example: if you use a commando you will need to set the BuildLevel and ScenarioLevel rules for your new infantry type if you want to build it in a campaign mission.

Let's update our RULES.INI section for our new type:

[LaserDude]
BaseType=E1
PrimaryWeapon=Obelisk_Laser
Cost=200

This soldier should now be equipped with a laser gun and cost around 200 credits (depending on difficulty level).

Adding Mod Config

Now we have configured the NCO mod to create our new unit we must do the same for C&C. This is done by editing some files in the NCO mod directory.

  • Open the CNCModGameCommands.xml file inside the XML folder in a text editor
  • Add a new piece of text after the mods comment:
      <!-- mods -->

      <Command Name="LaserDude">
        <GameCommand>GAME_COMMAND_TD_MOD_CUSTOM_BUILD20</GameCommand>
      </Command>

Note: the 20 in the command above tells the game the ID of the new type - this starts at 20 for new infantry types and increases by one for each new type, in the order they appear in the NewInfantry rule.

For units this starts at 27 for new unit types and increases by one for each new type, in the order they appear in the NewUnits rule.

For example: setting NewInfantry=NewType,AnotherType would mean that NewType would have an ID of 20, and AnotherType has an ID of 21.

Testing

  • Start C&C in the usual way
  • Load a mission or skirmish
  • Ensure you are in Classic graphics mode (spacebar to toggle)
  • Build a barracks/hand of nod
  • Click on your new infantry type in the sidebar
  • Your laser powered soldier should now be ready for battle

Clone this wiki locally