I've noticed there are some users on the forums who are new, or just unfamiliar with making a mod.
I though I'd start a post to offer basic information for them on how to start, as most posts I've seen assume you know the basics. I know I'm not the best modder here(by a long shot), but hoped I could offer some help, and maybe the masters out there could offer more.
This following is an example of creating a basic mod for simple changes:
Adding a new entry:
I will use adding a new starting unit as an example (since I just made a little mod to do so)
First:
Look at the original code, so you'll know what you'll need:
now we're going to add a scout as a starting unit.
There are two basic methods to do this,
In both methods you are doing the same thing:
1. Selecting the Table you will me modifying - MajorStartingUnits
2. Inserting into it the varibles for the row - Era, Unit, and NotStartTile
This same basic format is used to add items into most any of the tables (Just need to make sure the variables are predefined, you cannot add a value to a column that doesn't exist, in that case, you would have to define the column.)
Update an already defined item:
Now,if instead of adding a new entry, we just wanted to undate an existing one, we would use the following format:
For either example above, you would then want to save the file as the corresponding type (sql or xml)
Creating a modinfo file:
There are plenty of exaples of modinfo files on the forum, so I won't go into great detail all you really need to know is:
There are other feilds that can be entered in the modinfo, but there are just the basics to get a simple mod to run.
As you progress, you'll probably start making more complex mods, but most will rely on this basic format. If you wish to change/add things that are more than a line, or have more than one entry, just use a text editor such as notepad++, and search the files for all related instances, and make sure you make matching entries.
This is just a very simple intro into civ modding. There are many more, much better modders than me on the forums who can offer much better help, I just wanted to start a thread
for those who are just begining and not sure how to start.
If I have neglected a similar post already up, let me know and I'll remove.
Also Please do correct any mistakes, or info I neglected.
I though I'd start a post to offer basic information for them on how to start, as most posts I've seen assume you know the basics. I know I'm not the best modder here(by a long shot), but hoped I could offer some help, and maybe the masters out there could offer more.
This following is an example of creating a basic mod for simple changes:
Adding a new entry:
I will use adding a new starting unit as an example (since I just made a little mod to do so)
First:
Look at the original code, so you'll know what you'll need:
Code:
<MajorStartingUnits>
<Row Era="ERA_ANCIENT" Unit="UNIT_SETTLER"/>
<Row Era="ERA_ANCIENT" Unit="UNIT_WARRIOR" NotStartTile="true"/>
now we're going to add a scout as a starting unit.
There are two basic methods to do this,
SQL:
INSERT INTO MajorStartingUnits('Era', 'Unit', 'NotStartTile') VALUES ('ERA_ANCIENT', 'UNIT_SCOUT', 1);
XML:
<GameInfo>
<MajorStartingUnits>
<Row Era="ERA_ANCIENT" Unit="UNIT_SCOUT" NotStartTile="true"/>
</MajorStartingUnits>
</GameInfo>
In both methods you are doing the same thing:
1. Selecting the Table you will me modifying - MajorStartingUnits
2. Inserting into it the varibles for the row - Era, Unit, and NotStartTile
This same basic format is used to add items into most any of the tables (Just need to make sure the variables are predefined, you cannot add a value to a column that doesn't exist, in that case, you would have to define the column.)
Update an already defined item:
Now,if instead of adding a new entry, we just wanted to undate an existing one, we would use the following format:
SQL:
UPDATE MajorStartingUnits SET Quantity=2 WHERE Era='ERA_ANCIENT' AND Unit='UNIT_SETTLER';
XML:
<GameInfo>
<MajorStartingUnits>
<Update>
<Where Era="ERA_ANCIENT" Unit="UNIT_SETTLER"/>
<Set Quantity="2"/>
</Update>
</MajorStartingUnits>
</GameInfo>
For either example above, you would then want to save the file as the corresponding type (sql or xml)
Creating a modinfo file:
There are plenty of exaples of modinfo files on the forum, so I won't go into great detail all you really need to know is:
Code:
<Mod id="[COLOR=#ff0000]64562d3d-1EG3-4Y79-A44A-052B589R42w[/COLOR]" version="1"> [COLOR=#ff0000]The mod id needs to be unique, if two mods have same id, one will not load.[/COLOR]
<Properties>
<Name>Mod Name</Name>
<Description>What mod is</Description>
<Authors>You</Authors>
</Properties>
<Files>
<File>[COLOR=#0080ff]YourFile.xml/sql[/COLOR]</File> [COLOR=#0080ff]The file(s)included in your mod[/COLOR]
</Files>
<Components>
<UpdateDatabase id="Mod Component"> can just be name of mod
<Items>
<File>[COLOR=#00b359]YourFile.xml/sql[/COLOR]</File> t[COLOR=#00b359]he file(s)in your mod again (this is where they are loaded into the game database)[/COLOR]
</Items>
</UpdateDatabase>
</Components>
</Mod>
There are other feilds that can be entered in the modinfo, but there are just the basics to get a simple mod to run.
As you progress, you'll probably start making more complex mods, but most will rely on this basic format. If you wish to change/add things that are more than a line, or have more than one entry, just use a text editor such as notepad++, and search the files for all related instances, and make sure you make matching entries.
This is just a very simple intro into civ modding. There are many more, much better modders than me on the forums who can offer much better help, I just wanted to start a thread
for those who are just begining and not sure how to start.
If I have neglected a similar post already up, let me know and I'll remove.
Also Please do correct any mistakes, or info I neglected.
Last edited: