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

Cheexsta

Veni, vidi, vici
60 Badges
Dec 22, 2005
2.897
62
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Mount & Blade: Warband
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Heir to the Throne
  • 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 III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II
  • Europa Universalis III Complete
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
At least, not as decisions...

Made a couple of simple decisions with the following code:
Code:
country_decisions = {
	set_variable = {
		allow = {
			ai = no
		}
		effect = {
			change_variable = { which = variable_test value = 1 }
		}
	}
	change_variable = {
		allow = {
			ai = no
			check_variable = { which = variable_test value = 1 }
		}
		
		effect = {
			change_variable = { which = variable_test value = -1 }
		}
	}
}

In-game, the trigger check_variable displays properly. However, the effect change_variable does not, and clicking the button has no effect. The code seems to work fine in EU3 (some mods use it but I haven't checked it myself).
 
Upvote 0
The actual change is not supposed to show in the tool tip (or at least they are not shown in EU3 either). I use them extensively in MN and they work just fine, with the little kink (also in EU3 by the way) that when you do something like:

check_variable = { which = variable_test value = 1 }

It will only return true if the value is actually more than 1 but not when it is exactly 1.

I usually fix this by having a setup script with set_variable 0.01 but you could probably just use 0.99 in all the checks instead.