Entity Modding

Entity modding is the addition of new or modification of existing entity types. An "entity" can be a brigade, building, faction, upgrade, stance, skill tree, skill, faction group, or anything else defined by a .XNT file. .XNT files are .XML files. In order to manipulate them, you'll need a plain text editor (like Notepad or Notepad++, but NOT Microsoft Word or other formatted text editors).

Common XNT Structure
Every XNT file expects to be contained within a single xml block, and each entity expects to have an entire xml block to itself opening and closing with the "entity" tag. This is what an xml block defining an entity looks like. (your data here) If you want to have multiple entities defined, you need to contain them all within one block marked "entitygroup", like so. (your data here) (your data here) (your data here) In addition, every entity looks for its class and type. The class is what tells the game whether it's trying to make a unit, building, faction, or so on. The type is the unique name of the entity being defined here. For example, Greek Hoplites have the following header: greekHoplite brigade (...) Where "brigade" is specifying that it's a unit and "greekHoplite" is saying what type of unit it is. An entity's class and type can also be declared as xml attributes, which would look like this.  (...)

Mod Technique
All editable entity types look for an attribute called "modtechnique". Add a modtechnique attribute when you're editing an existing entity. There are three valid declarations of modtechnique.   
 * Adds the contents of the entity block to the Greek Hoplite brigade.
 * Replaces the Greek Hoplite with the contents of the entity block. Be sure to declare everything an entity of the given class needs!
 * Deletes the Greek Hoplite.

Entity Refs
These are references to another entity. A tag with an entity ref has a "class" and "type" attribute pointing to the entity referenced; usually, this tag will have nothing else in it and will be immediately closed with a slash. For example,  Is an entity ref pointing to the skirmish brigadestance.

Atlas Refs
These are references to an image. Most atlas refs in the default game point to part of an "atlas", or image compiled out of multiple ones. For example,  points to the buildetruscanaxemen part of the buttons atlas, which is a large image containing every button in the default game stored together for optimization purposes. However, you can also point to a single image in an atlas ref. You do this by putting "FILE:" in the atlas attribute and path to the image in the sprite attribute. For example,  Is an atlas ref pointing to the custom image in a mod's resources/images/newportraits folder.