User avatar
Generalisimo
Posts: 4176
Joined: Wed Jun 07, 2006 10:03 pm
Location: Buenos Aires, Argentina
Contact: ICQ WLM

One-feature-a-day articles: #19 Modding Pride of Nations

Fri May 27, 2011 1:59 pm

Pocus wrote:From current discussions in the PON forum, it is obvious that many of you would like one day or another to play a smaller country rather than one of the major contenders of the era. We, as the development team, concentrated on the gameplay and events for the eight majors, but nothing here is in the end hard coded. Or perhaps you will want to tweak some datum or another, because you have your own personal opinion about something. As you’ll see, it is easy to mod PON, based on the AGE engine.


We can split modding in two categories, for ease of understanding. First, there is modding that is about altering a value in a game asset. Let’s take an example with the chance of successfully forging a casus-belli. The data are all in the GameData directory, and quite logically, the diplomacy data are in the Diplomacy subfolder. One great thing to realize about diplomacy items (treaties or unilateral moves) is that the vast majority of the diplomacy module is data-driven. What does this mean? It means that by changing or adding data in some text files, you alter the behavior of the game.

So back to your Forge Casus Belli entry: You believe it should have a higher chance of success. This tweak can be done in a few minutes. In the Diplomacy folder we talked about, there are a lot of entries. The file of interest to us is ’40-Forge Casus-Belli.dpl’. Dpl meaning … diplomacy as you can guess. Double-click on it, and Windows is asking you how to open the file. This is a text file, so just pick your favorite text editor. Then you’ll see there are several entries there, but more specifically, here are the ones of interest to you:

SuccessImperialism = 2
SuccessDiplomacy = 3
SuccessAdministration = 0
These three entries, define the % chances of success of forging a CB, for each point of statistic of your Ruler and Prime minister (the two stats are aggregated in one overall value ranging from 1 to 9). So if we have a cabinet with 5 in Imperialism and 3 in Diplomacy, then our chance of forging a CB would be 5x2 + 3x3 = 19%
Just tweak these entries, save the file, and voila, you have just done your first modding of the AGE engine. It is difficult to have something simpler, in our opinion!


Image

Image

Now, this kind of modding is just the beginning, useful when you need a little fix, as you can guess. If you really want to engage in serious modding, then it is better to work a bit differently, with a utility we provide for free and with the Excel files listing the data in a more convenient way (because editing the 11277 leaders and combat units subtypes(sic!) of the game would not be practical, if you had to open each file separately). We will post the link to the utility when the game is out.

The second category of modding is about the modification of the scenario setups and events. This type of modding uses a simple scripting language, so that you can tell the engine what to do with the data you add. Here we will do also a bit of modding. Let’s say we want to add 100 steel to the county we are currently playing, Russia. We will do an event for that. Events are in the Events folder of the game, and they are text files ending with .sct. There is a file for you in particular, called Plugin_1850GC.sct. This file is empty currently, but everything you add there will be used by the Grand Campaign. So let’s add a simple event to it:

SelectFaction = RUS
StartEvent = Steel arrival|1|2|Sir, we received 100 Steel from an unknown benefactor|Benefactor.png|$Moskva|NULL
Conditions
MinDate = 1850/01/01
Actions
ChangeResStock = $merSteel;100
EndEvent

The only line of text that is perhaps a bit complicated is the StartEvent one… The text ‘Steel Arrival’ is the name of your event. 1 means it will occur only once, and 2 means we want the full Monthy, i.e a pop-up with an image (which is Benefactor.png). $Moskva is the region of focus. Save the file, resume your turn and click end turn. It works!

A neat thing about the engine, is that the events you add will work even if you add them after you started a campaign. This is great for ‘on the fly’ tweaking and modifications and can even be used to fix a data during the course of the game…


Follow us in here too:
http://www.facebook.com/ageod
"History is the version of past events that people have decided to agree upon."
Napoleon Bonaparte


BOA-AAR: ¡Abajo el imperialismo Británico! (en español)

AGEOD Facebook Fanpage - news & screenshots about the upcoming games!

Martok
Civilian
Posts: 4
Joined: Sat Aug 21, 2010 8:22 pm

Sat May 28, 2011 9:49 am

Is there any way we could please get those screenshots sized down, or at least put in spoiler tags? Right now they're so huge, it makes the post a real pain to read.


EDIT: If the same could also be done for the #20 Logistics article, it would be much appreciated! :)

Return to “Pride of Nations”

Who is online

Users browsing this forum: No registered users and 3 guests