• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

kelumden

Second Lieutenant
11 Badges
Jan 4, 2004
104
0
  • Arsenal of Democracy
  • Darkest Hour
  • Europa Universalis III Complete
  • For The Glory
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Rome Gold
  • Sword of the Stars
  • Victoria 2
  • 500k Club
  • Pride of Nations
This thread is geared to the use of flags as managed by the commans setflag and clrflag, not
the global flags (from 0 to 6).
Those flags are called user country flags in Harvard's Exhaustive Bible of Event Scripting
(a really good source of information! Thanks for the job).

If I understand well the mechanism, when such a flagh is defined, it is restricted to
the country the event applies to.
What happens if the event is triggered for a province ? Harvard states that "the event should happen
for whoever owning a certain province
". I would believe that user country flags are also concerned by
this and, therefore, that such a flag declared in a province-specific event is defined in the context of
the country owning the province. Is this true ?

BTW, it should be interesting to be able to define global flags, applying to the scenario as a whole.
 

Ayeshteni

Jehanne's Slave
111 Badges
Jul 31, 2002
6.280
108
  • 500k Club
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Rome: Vae Victis
  • 200k Club
  • Heir to the Throne
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Pride of Nations
  • Rise of Prussia
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Hearts of Iron IV: No Step Back
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • A Game of Dwarves
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
In my understanding it will not work.

The event will trigger for whoever owns the province, but the game will ignore any command that has setflag in it (similar to if a command has relations +50 with Scotland and no scotland exists).

Setflag commands can only be placed in events for a specified country tag.
Clearflag commands can only be placed in events for a specified country tag.
Flag triggers can only be placed in events for a specified country tag.

yours
Ayeshteni
 

kelumden

Second Lieutenant
11 Badges
Jan 4, 2004
104
0
  • Arsenal of Democracy
  • Darkest Hour
  • Europa Universalis III Complete
  • For The Glory
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Rome Gold
  • Sword of the Stars
  • Victoria 2
  • 500k Club
  • Pride of Nations
The following sequence works perfectly: first event sets the flag but occurs at the level of the province, while the second one relies on the same flag being set and performs the test at the level of the country.

Code:
event = {
  id = 1999901
  name = "Trial event 1"
  desc = "Setting flag throu province owned by Portugal"

  province = 442

  date = { day = 1 month = january year = 1419 }
  deathdate = { day = 2 month = january year = 1419 }

  action_a = {
    name = "OK"
    command = { type = setflag which = PORTestSequence }
  }
}

event = {
  id = 1999902
  name = "Trial event 2"
  desc = "Reading flag at country level (Portugal)"

  country = POR

  date = { day = 4 month = january year = 1419 }
  deathdate = { day = 5 month = january year = 1419 }

  trigger = { 
    flag = PORTestSequence
  }

  action_a = {
    name = "OK"
    command = { }
  }
}
 

Ayeshteni

Jehanne's Slave
111 Badges
Jul 31, 2002
6.280
108
  • 500k Club
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Rome: Vae Victis
  • 200k Club
  • Heir to the Throne
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Pride of Nations
  • Rise of Prussia
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Hearts of Iron IV: No Step Back
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • A Game of Dwarves
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
kelumden said:
The following sequence works perfectly: first event sets the flag but occurs at the level of the province, while the second one relies on the same flag being set and performs the test at the level of the country.

Code:
event = {
  id = 1999901
  name = "Trial event 1"
  desc = "Setting flag throu province owned by Portugal"

  province = 442

  date = { day = 1 month = january year = 1419 }
  deathdate = { day = 2 month = january year = 1419 }

  action_a = {
    name = "OK"
    command = { type = setflag which = PORTestSequence }
  }
}

event = {
  id = 1999902
  name = "Trial event 2"
  desc = "Reading flag at country level (Portugal)"

  country = POR

  date = { day = 4 month = january year = 1419 }
  deathdate = { day = 5 month = january year = 1419 }

  trigger = { 
    flag = PORTestSequence
  }

  action_a = {
    name = "OK"
    command = { }
  }
}

:confused:

But OK where in the savefile is the setflag kept? If it records it it will be under the country description of who owns the province at the time the first event kicks right?

The second event would only kick in if POR had the first event, unless you have a second event for ALL countries (which will make the savefile HELLISHLY long).

Do I understand you correct?
yours
Ayeshteni
 

Khephren

Watery Tart
23 Badges
Mar 29, 2003
1.285
2
  • Victoria 2
  • Battle for Bosporus
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • March of the Eagles
  • Iron Cross
  • Europa Universalis III Complete
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Crusader Kings II
Yes, you are right. Unless Portugal has the first event, it will never get the second. (Unless you make a buttload of events for each country, as you said)