Unit & Building Modding

 
1. How to add a building 
 
This would require forethoughts as to what you want to add, where (which nation) you want to add the building to and how (availability of unit, upgrade levels, etc.). There is an additional step that you will need to do also. Because you will be introducing new files, you must remember that new MD files must be listed in NMLIST.TXT file and its description given in TEXT\MDLIST.TXT file. Now you go to the nation NDS file that you wish to add this new unit to and start editing. You must decide what its name is going to be, where it will be born and what position will it be placed in the family plus its potential role when it matures. So you go through the process of adding this new member with a new name in the
[MEMBERS] entry. Then you must decided where it is going to be produced at under the [FIXED_PRODUCE] entry. After this, you must decide on whether or not its going to be available by default under [ENABLED] entry, etc. You then must go through the whole NDS file entries to complete the addition of this new member. 

List of files that you need to get a new barrack working for example: 

I took the AUCEN.MD from the Imperia mod to test with. 

Take the AuCen.GP & AuCen2.GP( extract from Imperia, its under the various mod & patch files)

Let’s use an already existing icon to make things easier. ( Sklad)(Storehouse icon)&( change it in the .md file) 

Make or copy a DESCRIPTION+AUCEN.MD  and add its description (note this one is not mandatory for the building to function properly)

Add the entry to the NMLIST.TXT 

Add the entry to the TEXT+MDLIST.TXT 

Add the entry to the FILELIST.LST ( MASM) 

Add the entry to the AUSTRIA.NDS under [MEMBERS] [FIXED PRODUCE] [ENABLE] 

Picture shows list of files needed to get this one working:
 
Generate a patch with these files.

Run dmcr.exe, find your newly Austrian center or barrack whatever you wanna make of it.

I had an error first time I ran this, I forgot to change in the AUCEN.MD file the userlc from UNITSGP\AuCen to AuCen. (Just delete the UNITSGP\ ).

It’s the way AWAR BOGDAN has made up his files for Imperia.(folders for the gp units) So just change it to the correct name since you-we are working as “ +” extraction.
 
 
This was simple, now you will also need an icon for it. So this case add it to ICONLIST.TXT and ICON.GP

For making troops and upgrades in the building I refer to the .nds file information in the other modding sections

If you intend to you use more of the Imperia units, or from some other mod, and you intend to release your mod publicly, pls remember to ask first permission to the respective owners of the mods and the game itself.
This was only for testing purposes and a ‘ show-how-to’ .
 

 
2. How to change a unit graphic
 
Let's change the graphic of the mercenary dragoon. For this, you will need the file DR2DIP.MD. This is the file that defines the stats for mercenary dragoon. Let's say we swap its graphic for the French dragoon graphic. You will now need the file DRF.MD. In each of these two files, you will need all the lines from ICON to GEOMETRY are those that define the graphic for these units. Just cut that section from DRF.MD and paste it into (replacing that in) DR2DIP.MD. Of course if you feel a bit adventurous, you can try your hand on editing a few of the unit stats at the same time also. Then put the edited DR2DIP.MD file back into the game and you will find the new graphic for YOUR mercenary dragoon.
 

3. How to clone a unit / building
 
-Copy the md file of a unit.
-Change the name of the md file.
-Then inside the md file, change the NAME entry
-Then add the new name to nmlist.txt
-Then make the entry in mdlist.txt ( this is the name of the md in capitals)+ a description to show up in game
-Then add the entry in the nds file under [MEMBERS] [FIXED PRODUCE] [ENABLED] [COUNTRY] and possibly more depending on what you want to do with the unit.