Working on my Independent Project: Part 2

Well, it appears that this semester has flown by. Within the next week, classes will be over, and everyone will be able to take some time and relax. Only four more assignments between now and the start of the winter break.

Last time I posted, I talked about where I was going with my independent project. Just in case you need a refresher, I wrote that I was working on a disaster mod for Europa Universalis IV (EU4) that would add a Nine Years’ War (the Irish one) for England/Great Britain players. Since that post, I have finished coding the disaster, and have begun working on writing the text that will appear alongside every event. Therefore, I would take some time and briefly discuss my experience coding a mod into EU4.

It was not too difficult getting started with my mod. On YouTube, alone, there are various tutorials created by community members that explain the essentials of modding EU 4’s “Clausewitz Engine.” [1] Basically, EU 4’s mechanics run off code in .txt files. Almost every aspect of the game can be changed if you know its location in the game’s file structure. The syntax is of Paradox’s own design, but it is relatively easy to read compared to other coding languages.

After watching a few videos, I was surprised to discover that there are no tutorials on creating a disaster event. While one exists on EU 4’s fan wiki page, it is about four versions out of date. Therefore, I figured out how to code a disaster by loading up the disaster.txt files to see how the developers did it. Essentially, the disaster event code is divided into two .txt files. The first file explains to the computer who can get the disaster, the starting conditions and all the associated events/modifiers within the disaster. The second .txt file contains the coding for each of the events. Lastly, a third .txt file holds all the text associated with the disaster.

2019-11-27 (7)

Here is a blob of code that specifies who can get the Nine Years’ War disaster and how it starts. Basically, it says that only England or Great Britain (GB) can get the disaster, as long as they own the British Isles region. Progress towards the disaster starting can only occur during the Age of Reformation, as long as England/GB is not Catholic and owns territory in Ireland. However, progress towards the disaster starting will halt if England/GB is Catholic or owns no territory in Ireland.

2019-11-27 (5)

 

Here is another blob of code. It says that progress towards the disaster starting will increase by 0.25% a month if England’s owned territory in Munster, Connacht, or Leinster has an average unrest of at least one. However, an average unrest of at least 1 in owned Ulster territories will increase progress towards the disaster starting by 0.5% per month. All of these modifiers stack, so if England/GB owns territory in all of Ireland, and there is an average unrest of at least 1, progress towards the disaster starting would increase by 1.25% a month. These modifiers are supposed to simulate the Irish population. If they are upset with England/GB’s rule, the disaster will begin sooner. I gave a higher modifier to the Ulster territories because of the central role the Ulster Lords played in the outbreak of the rebellion.[1] While it may not seem like a hard thing to code, it was one of the first aspects I tackled, and it proved to be a real struggle for a beginner. My first attempt resulted in any unrest in Ireland increasing progress towards the disaster, regardless if  England/GB controlled the territory. After doing some digging and finding the any_owned_province command, it was easy to fix.

Overall, the coding process has been fun, but it can prove to be difficult when you are unsure why something is not working correctly. For me, it was often a matter of forgetting a bracket that would throw everything else off balance. Usually, as soon as I finished writing the code of something, I would immediately load the game up to ensure it was working correctly. For my next post, I will delve into some of the events related to the disaster!

 

[1] G.A. Hayes-McCoy, “The Completion of the Tudor Conquest and the Advance of the Counter-Reformation, 1571-1603,” in A New History of Ireland III Early Modern Ireland: 1534-1691, ed. T.W. Moody, F.X. Martin and F.J. Byrne (Oxford: Oxford University Press, 2009 [1976]), 118.

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: