• Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

Divine

Programmer
Super Moderator
33 Badges
Dec 26, 2005
548
885
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
- Added while effect.
- Added export_to_variable effect.
 
  • 2
Reactions:

Divine

Programmer
Super Moderator
33 Badges
Dec 26, 2005
548
885
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
The syntax should be the same that EUIV uses so I'll just quote Captain Gars post where he explains it in a thorough manner.
Do note however that I've yet to fill out most of the variables that can be exported. So please head over here https://forum.paradoxplaza.com/foru...eature-feedback-request.951329/#post-21468139 to suggest prioritized game values to export.

Update:

- Added a while effect
- Added an export_to_variable effect

Examples:

Code:
    set_variable = { which = count value = 20 }
    while = {
       limit = {
         check_variable = {
           which = count
           value = 1
         }
       }    
       subtract_variable = {
         which = count
         value = 1
       }
       add_treasury = 5
     }
Note: the while effect will not produce any tooltip due to the problems that would cause. Also, make sure you don't create an endless loop... (altough there is a fail-safe at 100K loops)

Code:
    export_to_variable = {
       which = prestigeVar
       value = prestige
     }
Note: The current country's prestige is saved in the variable.

Code:
    export_to_variable = {
       which = stabilityVar
       value = stability
       who = FROM
     }
Note: FROM's stability is saved in the variable.

Code:
    export_to_variable = {
       which = productionEfficiencyVar
       value = modifier:production_efficiency
     }
Note: The current country's modifier production_efficiency is saved in the variable.

Code:
    export_to_variable = {
       which = borderDistanceVar
       value = borderDistance
       who = FRA
     }
Note: The border distance between the current country and FRA is saved in the variable.

General note: export_to_variable also works in province scope

Country values:
Code:
prestige
war_exhaustion
manpower
manpower_percentage
max_manpower
states_development
average_autonomy
average_home_autonomy
corruption
stability
treasury
land_forcelimit
naval_forcelimit
average_unrest
num_of_cities
army_tradition
navy_tradition
mercantilism
overextension_percentage
inflation
num_of_ports
patriarch_authority
piety
religious_unity
ADM
DIP
MIL
heir_adm
heir_dip
heir_mil
tolerance_to_this
trade_income_percentage
years_of_income
monthly_income
army_size
navy_size
adm_tech
dip_tech
mil_tech
border_distance
capital_distance
+ all global modifiers
Province values:
Code:
province_trade_power
local_autonomy
base_manpower
base_production
base_tax
development
unrest
nationalism
tolerance_to_this
+ all local modifiers
 
  • 2
Reactions:

blackninja9939

Programmer
69 Badges
Aug 28, 2013
2.285
3.367
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Tyranny: Archon Edition
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Stellaris: Lithoids
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • BATTLETECH
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Shadowrun Returns
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: The Republic
  • Stellaris: Ancient Relics
  • Imperator: Rome
  • Prison Architect
  • Mount & Blade: Warband
  • Stellaris: Distant Stars
  • Imperator: Rome Sign Up
  • Crusader Kings II: Holy Fury
  • Teleglitch: Die More Edition
  • Victoria 2
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Age of Wonders: Planetfall
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Crusader Kings II: Jade Dragon
Very nice!
Just to check with regards to while, I am getting the idea it is a constantly looping if clause until the limit is no longer satisfied or you reach the fail safe value of 100K, is that correct?
 
  • 1
Reactions:

Jorlem

Field Marshal
107 Badges
May 9, 2012
4.426
3.551
  • Crusader Kings III
  • 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
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • The Showdown Effect
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Tyranny - Bastards Wound
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Surviving Mars: First Colony Edition
  • Europa Universalis IV: Golden Century

Zarathustra_the

General
77 Badges
Nov 3, 2011
1.743
978
  • Victoria 2: A House Divided
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • King Arthur II
  • The Kings Crusade
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Naval War: Arctic Circle
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Call to arms event
  • Cities in Motion
  • 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
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Warlock: Master of the Arcane
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
Divine, how frequently does the while loop trigger? And can we get the ability to define how frequently? Such as weekly, daily, monthly, or indeed yearly?
 

ngppgn

Field Marshal
17 Badges
Jan 29, 2011
3.510
653
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Heir to the Throne
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
Divine, how frequently does the while loop trigger? And can we get the ability to define how frequently? Such as weekly, daily, monthly, or indeed yearly?
What do you mean? Fron the example, one would assume that the while = {} effect is executed once when called (as in, if it loops 999 times, the 999 loops are executed in one game tick, not periodically. Or am I missing something here?
 
  • 1
Reactions:

Zarathustra_the

General
77 Badges
Nov 3, 2011
1.743
978
  • Victoria 2: A House Divided
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • King Arthur II
  • The Kings Crusade
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Naval War: Arctic Circle
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Call to arms event
  • Cities in Motion
  • 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
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Warlock: Master of the Arcane
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
Well if all your loops are triggered in one tick then what the hell is the the point of it? If it instead is an effect triggered every tick till there is a change of conditions, it would seem it is much less likely to spiral totally out of control. Especially if for instance you use a while condition that is not going to be false for say 10-15 ticks from the start.
 

DC123456789

Field Marshal
77 Badges
Oct 22, 2012
6.273
2.140
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Parklife Pre-Order
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Lithoids
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • 500k Club
  • Crusader Kings II: Charlemagne
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Imperator: Rome
  • Victoria 2
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Imperator: Rome - Magna Graecia
That's not what while loops are for though. While loops are specifically supposed to loop over and over until the condition is met.
 
  • 1
Reactions:

Zarathustra_the

General
77 Badges
Nov 3, 2011
1.743
978
  • Victoria 2: A House Divided
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • King Arthur II
  • The Kings Crusade
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Naval War: Arctic Circle
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Call to arms event
  • Cities in Motion
  • 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
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Warlock: Master of the Arcane
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
It depends actually on how you use a while loop. My point though is with CKII why would you want a while loop that did have a tick function?
 

Yard1PL

Second Lieutenant
8 Badges
Apr 6, 2016
150
52
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
It depends actually on how you use a while loop. My point though is with CKII why would you want a while loop that did have a tick function?
Anything you would use a while loop in programming for. For example right now I have an event that fires itself X times until a condition is met. A while loop would be a way better solution. Anything with complicated variable operations would benefit from such a loop.
 
  • 3
  • 1
Reactions:

Zarathustra_the

General
77 Badges
Nov 3, 2011
1.743
978
  • Victoria 2: A House Divided
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • King Arthur II
  • The Kings Crusade
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Naval War: Arctic Circle
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Call to arms event
  • Cities in Motion
  • 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
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Warlock: Master of the Arcane
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
At the moment I am using similar things, I am thinking though more of an operations standpoint, what if the condition does not become valid for x number of ticks? Depending on how fast the while loop acts it will cause a crash.
 

richvh

Preserver of the Light
62 Badges
Dec 1, 2001
14.691
1.996
Visit site
  • Stellaris: Leviathans Story Pack
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III
  • Europa Universalis IV: Call to arms event
  • A Game of Dwarves
  • 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
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
At the moment I am using similar things, I am thinking though more of an operations standpoint, what if the condition does not become valid for x number of ticks? Depending on how fast the while loop acts it will cause a crash.
What you seem to be wanting is better handled by repeat_event with a delay.
 
  • 1
Reactions:

Zarathustra_the

General
77 Badges
Nov 3, 2011
1.743
978
  • Victoria 2: A House Divided
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • King Arthur II
  • The Kings Crusade
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Naval War: Arctic Circle
  • Victoria 2: Heart of Darkness
  • Warlock 2: The Exiled
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Call to arms event
  • Cities in Motion
  • 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
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Warlock: Master of the Arcane
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
Rich it is how I already do it. TBH my question with While loop is that I do not see how it will not simply cause issues.
 

DC123456789

Field Marshal
77 Badges
Oct 22, 2012
6.273
2.140
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Parklife Pre-Order
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Lithoids
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • 500k Club
  • Crusader Kings II: Charlemagne
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Imperator: Rome
  • Victoria 2
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Imperator: Rome - Magna Graecia
You'll simply have to code keeping in mind that it will run continually until the conditions are met and make sure there aren't some edge cases that could make it run more than it should, just like what you have to do in programming languages.
 
  • 1
Reactions:

Divine

Programmer
Super Moderator
33 Badges
Dec 26, 2005
548
885
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
Sorry that I'm late to answer. Had a week of early vacation. Yes the while loop is implemented as an effect and will execute until the condition is no longer met. It will check the condition before every execution of the combined effects inside the loop. If you have a huge effect inside the loop and you are doing lots of loops it can cause a lag spike so it is something to keep in mind when using the while loop.
 
  • 3
Reactions:

Divine

Programmer
Super Moderator
33 Badges
Dec 26, 2005
548
885
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
These are the implemented game values currently available for export_to_variable effect.

Character:
martial
diplomacy
intrigue
stewardship
learning
base_health
demesne_efficiency
decadence
dynasty_realm_power
fertility
infamy
monthly_income
plot_power
population_factor
relative_power_to_liege
religion_authority
scaled_wealth
treasury
yearly_income
age
ai_ambition
ai_greed
ai_honor
ai_rationality
ai_zeal
among_most_powerful_vassals
combat_rating
demesne_garrison_size
demesne_size
health_traits
imprisoned_days
lifestyle_traits
max_manpower
num_of_baron_titles
num_of_children
num_of_claims
num_of_consorts
num_of_count_titles
num_of_count_titles_in_realm
num_of_duke_titles
num_of_dynasty_members
num_of_emperor_titles
num_of_extra_landed_titles
num_of_friends
num_of_holy_sites
num_of_king_titles
num_of_lovers
num_of_plot_backers
num_of_prisoners
num_of_rivals
num_of_subrealm_castles
num_of_subrealm_cities
num_of_spouses
num_of_titles
num_of_trade_posts
num_of_traits
num_of_unique_dynasty_vassals
num_of_vassals
over_max_demesne_size
over_vassal_limit
personality_traits
piety
population
population_and_manpower
prestige
realm_diplomacy
realm_intrigue
realm_learning
realm_martial
realm_stewardship
realm_levies
max_realm_levies
realm_size
republic_total_num_of_trade_posts
ruled_years
score
unused_manpower
retinue_points_max
retinue_points_used
retinue_points_free

Title:
mercenary_siphon_factor
num_fitting_characters_for_title
num_of_buildings
num_of_feuds
population
population_and_manpower
ruled_years
unused_manpower
holding_tax_value

Province:

religion_authority
revolt_risk
num_of_empty_holdings
num_of_max_settlements
num_of_settlements
total_tax_value

Example usage:
Code:
ROOT = {
    export_to_variable = {
        which = count
        who = event_target:my_capital
        value = total_tax_value
    }
    while = {
        limit = {
            check_variable = {
                which = count
                value = 1
            }
        }   
        subtract_variable = {
            which = count
            value = 1
        }
        wealth = 1
    }
}
The current scope will always be holding the variable that is assigned the value but the who parameter is used if you want to export a value from another scope to use in your current scopes variables. If who is not defined it will default to using the current scope when exporting the game value.

In addition to these you can also export modifier values for the different scopes (eg. value = modifier:fertility).
Posted in the feedback thread for export variables. This is now the current functionality for export_to_variable. Please keep the feedback for this specific effect in the linked thread: https://forum.paradoxplaza.com/forum/index.php?threads/script-feature-feedback-request.951329
 
  • 2
Reactions:

Divine

Programmer
Super Moderator
33 Badges
Dec 26, 2005
548
885
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
I'm just posting here as a notification that I'll be gone on vacation for 3 weeks from now. So be nice towards the team working with Crusader Kings in the meantime and I'll be back soon enough. Hopefully I'll be able to concentrate more on one project at a time then rather than keeping track of all of our projects at the same time. But time will tell what my tasks will be.

Happy modding while I'm brb.
 
  • 3
Reactions: