Modding

There are several ways to mod the game.

Always Do This Stuff

 * Make a mod folder
 * Name the mod folder something not already existent

Summary
The easiest way to mod provinces with little in-depth work is to copy and paste it from another province, then edit what you need to change. For example, you want to make the province of Asgard, copy and paste it from another nation, then edit it.

Step-by-Step Guide
You can ensure you have done it right by following the steps.

Ensure that all the cultures, religions, etc. you want are already in the game. You can do this by checking the relevant scripts in the ie_core's scripts subfolder. Also ensure that you have a nation to give the province to.

1) Copy and paste a province's code

The first line of this code, where it establishes a variable, defines it as being a Province class, then using the Province:create function is how creating the definition of it for the game. It has the reference name, meaning it is what will be used to reference that province in things, ex events. The hexadecimal is the color the province is on the game map. If it isn't on the map, then the province won't show up. The province name is what it will look like when the player right-clicks on it, showing the province information. The game will show it as Dresden. It then hands over the name, reference, and color to the Province register function, thus actually creating it. The traits after it are defining it, from giving it pops, to adding nuclei, to giving the province to Saxony, to setting the province as the capital of Saxony

2) Check that the reference id, hexadecimal color, province name, province nuclei, province owner, and the job, culture, religion, and amount of pops are accurate

Asgard isn't German protestant, it's Asgardian Norse, owned by Asgard, as well as being its capital. This means that we need to replace it. Be sure to put whatever color you made the Asgard province on the map in the blank.

3) Save the province file, and remove the province's color from unknown.lua; since we added a province that wasn't there originally, we don't need this step, but you should always double-check.

4) To add your province file to the game, create it, then go to init.lua, find the area where it loads the province files, then copy, paste, and edit the reference file so it calls yours.

Summary
Navigate to the nations folder, make sure all attributes you want are already in there. Copy and paste the code from another nation, edit it so it fits your nation, and save the file. Remove the province from unknown.lua, and you have created a nation.

Step-By-Step Guide
Navigate to the game files, and go into the scripts folder. From there, go into the nations folder, and open the file. This example will be adding Asgard as a nation. For the sake of simplicity, the nation of the Netherlands will be copied. Asgard has the Asgardian culture, which must be added to cultures. Culture modding is more quicker and easier than nation modding. Now to finish the nation's creation. Now, to create the nation, it needs to have some provinces.

The nation of Asgard has been successfully created.

Summary
Go to the area in religions.lua where it creates the religions. Then, copy and paste a religion. Change the unique attributes about it, and save the file.

Step-By-Step Guide
This example will make the Norse religion. Navigate to the religions file. Use the find function to find the section with religions.

Copy and paste a religion. Edit the religion. Save the file. The Norse religion has now been created.

Summary
Go to the area in init.lua where it creates the cultures. Then, copy and paste a culture. Change the unique attributes about it, and save the file.

Step-By-Step Guide
This example will make the Asgardian culture. Navigate to the init.lua file. Use the find function to find the section with cultures.

Copy and paste a culture. Edit the culture. Save the file. The Asgardian culture has now been created.

Summary
Go to mod.lua, and enter the file. You should see an event. Copy it. Edit all the relevant parts.

Step-By-Step Guide
Go to mod.lua, then copy and paste the first event. For this example, the cake event will be edited.

First, add any requirements. Then, edit any parts of the mod that you want to change. First, the name, reference, and description. Then the decisions Next, edit the decisions. Finally, edit the event's ending. Now the event is complete.