Skip to content
wuschel edited this page Dec 22, 2011 · 31 revisions

Introduction

OpenRA is designed to be highly moddable. Both RA and C&C are implemented as mods on top of the core engine, and other mods can choose to use as much or as little of that functionality as they like. At the simplest, a mod may just contain some custom MiniYaml definitions. More complex mods may need to introduce some custom traits, which are written in a .NET language (we prefer C#) and compiled into a DLL. At the most complex end of the spectrum, it is possible to use the engine without any of the RA behavior, although this involves an incredible amount of work (reinventing combat, production, resource management etc).

Running the game with a mod

By default, the game runs the mods listed in ~/OpenRA/settings.yaml (or similar), under Game:InitialMods:. If this doesn't exist, the default is RA. You can override the settings and run with specific mods by listing them on the command line. For example, to run the C&C mod, you can do:

$ mono OpenRA.Game.exe Game.Mods=cnc

Note to Windows users: It might be easier to create a shortcut to the OpenRA.Game.exe executable and provide these options in the shortcut settings. Windows also executes OpenRA.Game.exe directly, rather than using mono.

Multiple mods can be loaded at once, (provided they are compatible). To do this, list multiple mod names, separated by commas. Mods are applied in order. For example, to load the base RA mod, and also load the RA Performance test content, you can do:

$ mono OpenRA.Game.exe Game.Mods=ra,ra_perf

Note that not all mods are compatible with each other. For example, trying to load the ra and cnc mods together does bad things.

Mod Directory Layout

Each mod has a directory inside the mods directory in the game root. It is the name of this directory which is used when naming mods to load. Everything related to a particular mod is contained within this directory (with the possible exception of user maps, which can be loaded from other locations too.)

The only file which is absolutely required for a mod is mod.yaml. This contains the manifest for the mod, which the engine will use to load all the other pieces you need. By convention, other things are placed in subdirectories of the mod directory:

  • packages contains MIX archives required by the mod
  • rules contains MiniYaml files describing how to assemble actors (units/buildings/etc)
  • maps contains maps.
  • tilesets contains MiniYaml files describing the various tilesets -- temperate, snow, etc.
  • chrome contains MiniYaml files describing the UI chrome
  • uibits contains various textures used by the chrome
  • bits contains various loose in-game assets -- SHPs, etc.

Nothing forces you to lay out a mod this way, but it's easier if everything is consistent.

Adding a faction to Your mod

(mini-HOWTO:)

1.) Add faction

Add Your faction to the following files:

system.yaml voice.yaml chrome.yaml

The faction will now start out with the MCV only.

2.) Add/buildings Units

Modify the respective yaml files for structures, vehicles etc. Note that You need to modify the sequences.yaml file as well and add the corresponding shp files (e.g. bggy.shp and bggyicon.shp) to Your 'bits` directory.

Players ๐ŸŽฒ

Modders โœ๏ธ

Developers ๐Ÿ”ง

Clone this wiki locally