Modding Events

Events can be found as simple text files within \democracy 3 \data\simulation\events. Every text file in the folder is considered to be a separate events. every 3 turns, the 'event manager' will evaluate the chances of every single event happening, and if the highest-scoring one has a value above 70%, it is triggered. The score of an event is based on a number of 'influences' that are effects from other items in the game, and once triggered the event runs a script, which effectively creates temporary effects.

The config section

The [config] section of an event has lines for Name, GUIName, Texture and Description. These are the internal name, the name displayed to the player, the graphic used for display when the player clicks to see details of the event, and the text displayed in that window. There is also a GUISound line, which is the name of a sound effect file that will be played while that window is active.


That section also has a line called 'OnImplement' which looks like this:

OnImplement = CreateGrudge(Aerospace Contract Won!,AerospaceBoom,Unemployment,-0.080,0.650);CreateGrudge(Aerospace Contract Won!,AerospaceBoom,GDP,0.030,0.880);CreateGrudge(Aerospace Contract Won!,AerospaceBoom,AerospaceBoom,-0.950,0.970);

This is a 'script' which has a number of 'functions' each of which are separated by a semicolon (;). The functions are always called 'CreateGrudge', and what these do is to create a 'temporary' and hidden object called a grudge, which decays over time, but while it is active, will exert an effect on another object within the game. The Parameters to the function are as follows:

GUIName of Parent (for displaying on effects)
Object Name of Parent (This is the same as the event name)
Target Object Name (Internal name for the object we wish to affect...)
Effect value (At the maximum, ie: the start of the grudge)
Decay (Actually the inverse of a decay, so a 0.97 is multiplied by 0.97 each turn. Higher numbers lead to slower decays)
There is no limit to the number of grudges an event can create. Note that most effects create a negative grudge against themselves, to prevent frequent repetition.

The influences section

This is a numbered list of inputs into the event, to determine the likelihood of it being triggered. You can have any input into these items, and also use the magic value of "_random_" which then takes a minimum and a maximum value to be calculated each time the event score is evaluated. This is used to add some random variation. See the basic modding intro for more information on the syntax of effects.

More Games from Positech

  • Gratuitous Space Battles 2
  • Gratuitous Tank Battles
  • Big Pharma