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

Truchses

Colonel
53 Badges
May 29, 2002
847
0
Visit site
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV
  • 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: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III Complete
  • Divine Wind
  • Arsenal of Democracy
  • 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 Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Europa Universalis III Complete
actually studying event files

provincial_conversion_events.txt:
Code:
#########################################
# PROVINCE RELIGIOUS CONVERSION SERIES  #
#########################################
#########################################
# Mass-scale Conversions   # by Guinnessmonkey	#
#########################################


#########################################
# Catholic Conversions #
#########################################

[COLOR=DarkOrange]province_x_province_event[/COLOR] = {   # Catholic religion (spreading)
	id = 1084

.
.
.

# Ruler character traits modifiers

		modifier = {
			condition = { [COLOR=DarkOrange]type = to condition = { type = trait[/COLOR] value = zealous } }
			factor = 0.6
		}


This does work?

After reading through the stickied posts 'Event scripting: tricks and traps explained' and 'Events Scripting 1.03 style' I don't undersand this. According to

'event effect.txt':
====================
= CHARACTER EVENTS =
====================

--------------
- Conditions -
--------------

Character conditions:
---------------------

.
.
.

type = trait value = [trait type]

The 'trait' condition belongs to the character events, while the province conversion events are province_x_province events. According to the explanations and the 'event effect.txt' file, the character conditions can't be used with this events. These conditions belong to a character contxt, so here should be a context switch. Thus a context switching for the province_x_province events should be used according to 'event effect.txt':

===================
= PROVINCE EVENTS =
===================

--------------
- Conditions -
--------------

.
.
.

-----------------------------
- Context Switch Conditions -
-----------------------------
type = owner

like here, other modifier in same file and same event

provincial_conversion_events.txt, province_x_province_event id = 1084
Code:
		modifier = {
			condition = {
				[COLOR=DarkOrange]type = to
				condition = {
					type = owner[/COLOR]
					condition = {
						type = or
						condition = { type = title value = HOSP }
						condition = { type = title value = TEUT }
						condition = { type = title value = TEMP }
					}
				}
			}
			factor = 0.5
		}


Another question:

realm_disruption_events.txt:
Code:
#################################
#################################
## Realm Disruption Events     ##
## By Byakhiam and Chris Stone ##
## Added May 05                ##
#################################
#################################

#############################################################
# Catholic vassals in Middle East or North Africa break free from distant lieges

character_event = {
	id = 6102

.
.
.

	mean_time_to_happen = {

.
.
.
		modifier = {
			condition = { type = liege
				condition = { type = or
					condition = { type = diplomacy value = 9 }
					condition = { type = chancellor_csc condition = { type = diplomacy value = 12 } }
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = { type = liege
				condition = { type = and
					[COLOR=DarkOrange]condition = { type = not value = { type = diplomacy value = 5 } }
					condition = { type = not value = { type = chancellor_csc condition = { type = diplomacy value = 7 } } }[/COLOR]
				}
			}
			factor = 0.5
		}

.
.
.

I think the optically beautifully matching lines

condition = { type = not value = { type =
condition = { type = not value = { type =

cause a wrong assumption that they are correct if we look fastly over the lines. But the 'not' condition in the first line applies to the diplomacy of the liege. If I stop the fast looking and thinking, than I would guess, that it is intended that the 'not' condition in the second line should likewise apply to the diplomacy of the chancellor_csc of the liege. But this 'not' condition should be after the chancellor_csc condition:

Code:
		modifier = {
			condition = { type = liege
				condition = { type = or
					[COLOR=DarkOrange]condition = { type = diplomacy value = 9 }[/COLOR]
					[COLOR=DarkOrange]condition = { type = [/COLOR][COLOR=Sienna]chancellor_csc[/COLOR][COLOR=DarkOrange] condition = { type = diplomacy value = 12 } }[/COLOR]
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = { type = liege
				condition = { type = and
					[COLOR=DarkOrange]condition = [/COLOR][COLOR=Red]{ type = not value = [/COLOR][COLOR=DarkOrange]{ type = diplomacy value = 5 } }[/COLOR]
					[COLOR=DarkOrange]condition = { type = [/COLOR][COLOR=Sienna]chancellor_csc[/COLOR][COLOR=DarkOrange]  condition = [/COLOR][COLOR=Red]{ type = not value = [/COLOR][COLOR=DarkOrange]{ type = diplomacy value = 7 } } }[/COLOR]

In the original version the 'not' condition in the second line applies to the chancellor_csc instead, thus the diplomacy value is not negated as it should be, but the chancellor value. In my understanding this applies to characters who are not chancellor but have a diplomacy value above 7. That's not the same as having chacellors with diplomacy below 7.
 
Q1: Dunno. Think it works even though it might not seem logical, it's doesn't throw up an error at least...

Q2: A 'not' statement needs to negate only a single part of the condition, so these are the same:
Code:
condition = { type = liege
	condition = { type = not condition = { type = age value = 18 } }
}
Code:
condition = { type = not
	condition = { type = liege condition = { type = age value = 18 } }
}

It looks like the second variant is a little more efficient though.

Chancellor_Csc can only match if there is a chancellor, if there is none, it is ignored. The moment the code sees this, it applies everything else to the chancellor.
So condition = { type = chancellor_csc condition = { type = not value = { type = diplomacy value = 7 } } } works exactly like condition = { type = not value = { type = diplomacy value = 7 } } if fired for the chancellor character, and thus can not negate the chancellor check, but the diplomacy one.