EU 2 Event Scripting.doc

(69 KB) Pobierz
EU 2 EVENT SCRIPTING

Europa Universalis 2 Event Manual

 

 

2001-11-06, Henrik Fåhraeus, (c) Paradox Entertainment

 

1          Introduction

 

 

In EU 2, it is possible to implement complicated events by using a custom script language. The events can be set to happen for a certain country at or between certain dates, with optional condition triggers.

 

2          The Event Files

 

Events are separated into major and flavour events. Although they are scripted exactly the same way, the convention is to place minor events, such as scientists and cultural personalities, in the flavour event files whereas major events go in the major event files. This is just a convention; the event files can be called anything as long as they are included in DB\EVENTS.TXT (whose name is also a convention – it is just included in all of the scenario .EUG files).

 

2.1   Major Events

 

Major events should be scripted in the files called:

 

DB\EVENTS\MAJOR_XXX.TXT

 

(Where XXX is the country tag.)

 

2.2   Flavour Events

 

Flavour events should be scripted in the files called:

 

DB\EVENTS\FLAVOR_XXX.TXT

 

(Where XXX is the country tag.)

 

2.3   Random Events

 

The random events reside in two files:

 

DB\EVENTS\RANDOMEVENTS.TXT

 

and

 

DB\EVENTS\RANDOMRELIGIOUSEVENTS.TXT

 

2.4   Huge events

 

Some events affect all countries in the world. These are stored in:

 

DB\EVENTS\HUGEEVENTS.TXT

 

and

 

DB\EVENTS\RELIGIOUSEVENTS.TXT

 

2.5   Event texts

 

The texts for the events reside in the file called:

 

CONFIG\TEXT.CSV

 

This is a comma-separated resource file containing all the in-game text.

 

 

3          Event Structure

 

Example

 

event = {

id = 3704

              trigger = {}

              random = no

              country = CHI

              name = "EVENTNAME3704"

              desc = "EVENTHIST3704"

              style = 1

             

              date = { day = 1 month = october year = 1773 }

              offset = 150

              deathdate = { day = 2 month = may year = 1820 }

 

              action_a ={

                            name = "ACTIONNAME3704A"

                            command = {  }

                            command = {  }

                            command = {  }

              }

              action_b ={

                            name = "ACTIONNAME3704B"

                            command = {  }

                            command = {  }

                            command = {  }

              }

              action_c ={

                            name = "ACTIONNAME3704C"

                            command = {  }

                            command = {  }

                            command = {  }

              }

action_d ={

                            name = "ACTIONNAME3704D"

                            command = {  }

                            command = {  }

                            command = {  }

              }

}

 

This is an empty event that will do nothing, but it will happen sometime from Oct 1, 1773 and 150 days forward. We will now go through each of the commands outlined in the example, in order.

 

3.1   Id

 

Every event in the game must have a unique id. It is very important that there are no id conflicts. The number of possible ids is 256^4 (4,294,967,296). 1-15000 is reserved by Paradox.

 

Example

 

id = 0300

 

3.2   Trigger

 

The trigger condition statement is optional. If left out the event will happen on the dates specified, or if directly triggered by another event.

 

Example

 

trigger = {

atwar = yes

}

 

It is also possible to set several conditions for the trigger.

 

Example

 

trigger = {

exists = TUR

              event = 3549

              atwar = no

}

 

In this case, all three conditions must be true; the default Boolean operator is AND. However, it is also possible to use OR and NOT.

 

Example

 

trigger = {

OR = {

                            owned = { province = 110 data = -1 }

                            owned = { province = 86 data = -1 }

                            owned = { province = 47 data = -1 }

              }

              NOT = {

                            event = 3301

              }

}

 

This trigger is true if province 110 OR 86 OR 47 is owned by the country this event affects AND event 3301 has NOT happened.

3.2.1        Trigger Conditions

 

atwar =               yes / no

 

Checks if the country is at war.

 

religion =               catholic / counterreform / protestant / reformed / orthodox / sunni / shiite /

confucian / buddhist / hindu / pagan

 

Checks the religion of the country.

 

event =               xxxx

 

Checks if event with id xxxx has happened.

 

leader =              xxxx

 

Checks if leader with id xxxx is alive.

 

monarch =               xxxx

 

Checks if monarch with id xxxx is alive.

 

 

owned =               { province = x data = aaa }

 

Checks if province x is owned by country aaa (if data = -1 then it is for the country receiving the event)

 

control =               { province = x data = aaa }

 

Checks if province x is controlled (owned or occupied) by country aaa (if data = -1 then it is for the country receiving the event)

 

core =                { province = x data = aaa }

 

Checks if province x is a core province of country aaa (if data = -1 then it is for the country receiving the event)

 

continent =               europe / america / asia / africa / oceania

 

Checks on which continent the capital of the country getting the event lies.

 

exist =               aaa

 

Checks if country aaa exists. (Where aaa is the three letter tag of the country.)

 

alliance =               { country = aaa  country = bbb )

 

Checks if aaa and bbb are in the same military alliance.

 

dynastic =               { country = aaa country = bbb )

 

Checks if aaa and bbb have a royal marriage.

 

vassal =               { country =aaa  country = bbb )

Checks if country bbb is a vassal of aaa.

 

war =                             { country = aaa  country = bbb )

 

Checks if country aaa is at war with country bbb.

 

domestic =              { type =               aristocracy / centralization / innovative / mercantilism /

land / offensive / quality / serfdom

value = x }

 

Checks if a domestic policy slider is at value x or higher. (Use NOT to negate.)

 

stability =               x

 

Checks if stability is at x or higher. (-3 to 3)

 

land =                             x

 

Checks if the land tech level is at x or higher. (0 to 60)

 

naval =               x

 

Checks if the naval tech level is at x or higher. (0 to 60)

 

infra =               x

 

Checks if the infra tech level is at x or higher. (0 to 10)

 

trade =              x

 

Checks if the trade tech level is at x or higher. (0 to 10)

 

discovered =               reg

 

Checks if region reg has been discovered by the Europeans.

 

cot =                             x

 

Checks if there is a centre of trade in province x.

 

year =                             x

 

Checks if the year is x. This is equivalent to using the date statement. See section 3.8.

3.3  
Random

 

This directive tells whether the event should be random or not. For country events, this is usually no.

 

Example

 

random = no

 

3.4   Country

 

This statement tells which country the event should affect. This must be set to a valid country tag. If this statement is left out, the event will happen for all countries.

 

Example

 

country = CHI

 

3.5   Province

 

An alternative to using the country statement, this means that the event should happen for whoever owning a certain province.

 

Example

 

province =  357

 

3.6   ...

Zgłoś jeśli naruszono regulamin