• 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.

Richard Karlsson

Second Lieutenant
60 Badges
Mar 13, 2017
108
70
www.richardkarlsson.se
  • Europa Universalis IV: Wealth of Nations
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Cities in Motion 2
  • Crusader Kings II
  • Stellaris: Federations
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Green Cities
  • Imperator: Rome - Magna Graecia
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • PDXCON 2018 "The Baron"
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Cities: Skylines Industries
  • Hearts of Iron IV: By Blood Alone
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Europa Universalis 4: Emperor
  • Battle for Bosporus
  • Cities: Skylines - Campus
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: Conclave
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Sons of Abraham
How do you check the value of a variable during game play?

What I want is to be able to track a variable during game play, to see how the value changes over time due to events and other things. To make sure that I get the effect I want.

It should be pretty simple and a very basic thing to do when testing the mod, but I haven't found out how to do this.

I have started the game in debug mode and looked through the explorer, read the Victoria 3 wiki-pages related to modding as well as some other paradox games modding-instructions.

Even though I'm pretty new to modding these games, I have done some programming before. Finding the necessary information is difficult though.
 
I posted an answer to a similar question in the quick questions thread:
What are the values in script terms? Are they variables, modifiers? Either way, the check should be straightforward.

The check format is type:name_of_type compare value
For example, If x1 and y1 are modifiers with x1 in root/current scope and y1 in prev scope, this should work modifier:x1 > prev.modifier:y1

If they are variables, then var:x1 > prev.var:y1

Then it's just a bunch of if/else_if checks
Basically, you just write var:variable_name then a comparison operator and the comparison value, and you can "dot-scope" if you want to call a variable stored on a different scope than the current one.