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

Wave

Rocker moth
61 Badges
Sep 12, 2009
946
34
  • Europa Universalis IV: Wealth of Nations
  • Semper Fi
  • Crusader Kings II
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Victoria 2: A House Divided
  • Magicka
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • 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
  • Hearts of Iron IV Sign-up
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Crusader Kings III
  • Crusader Kings II: Monks and Mystics
  • BATTLETECH
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Steel Division: Normand 44 Sign-up
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
LUA script generally does allow IF sentences just like C++ but do paradox games have this possibility?
So is it possible to have "trigger inside a modifier" like this:

is_triggered_only = yes

ruler = {
(tab) add_trait = corrupt
(tab) (tab) IF = {
(tab) (tab) (tab) ruler = { traits = cruel }
(tab) (tab) (tab) (tab) add_trait = vengeful
(tab) (tab) }
}

The event is triggered by another so it doesn't depend on character traits. So if the above isn't possible is the only way making a ton of events to cover all traits and then use

is_triggered_only = yes
trigger = {
traits = x
}

I probably remember wrong but a long time ago (when I was still playing Rome 1.3) and didn't know anything about scripting I saw IF sentence(s) in some files.. Though it could have been any other game as well.

Help is appreciated
- Wave
 
Last edited:
Well, luckily I don't have more than.. ermm.. 40 new traits to cover.. :wacko:

I guess it's going to be long night... :D
 
There is no "IF" in EUR scripting. The closest you can do is use limit = { xyz }.

Code:
country_event = {
	id = X
	
	is_triggered_only = yes
	
	title = "Money money money"
	desc = "Do you like money?"
	
	option = {
		name = "Yes, I do"
		ruler = { add_trait = corrupt }
		ruler = { 
			limit = { traits = cruel }
			add_trait = vengeful
		}
	}
}
Just to explain this:

When the player selects the option, both ruler sections will be processed by the game. The first one will always be triggered, while the second will only happen if the ruler already has the "Cruel" trait.

In essence, it works in the same way as an "IF" boolean in other scripting languages.
 
Well I did forget as well :D No problem.

I guess it won't hurt anyone if I uncover what I'm doing so you'll get better idea why I'm asking these.

I'm adding more "skills" to characters, at the moment they have martial, finesse, charisma, fertility, corruption, popularity and loyalty. These all are hardocoded so you cannot remove any of them or add more of them. Anyway I'm adding new ones such as Piety, authority, dread and chivalry and these will work trough traits. As an example to show the amount of piety the character will have trait (yet just named piety and number after it) which indicates it. It is possible to have any of these skills between 0 and 10 so I have 10 traits for all skills. When the character earns one point more (s)he will gain new trait and the old will be removed.

We'll see how well this works. In worst case I'll stop playing Total War series because they give bad influences.. :D