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

Rob de Hard

I said ink, not drink!
7 Badges
Jul 21, 2004
617
7
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • War of the Roses
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings Complete
I'm just mucking around with the scripting, trying to get an idea how it works ...

I put together a simple event script:

It checks to see if you are lustful and gives you an illness if you:

a. are over 35, greater risk
b. are also indulgent or reckless, greater risk

################################
# The Wages Of Sin
################################

character_event = {
id = 10292

picture = "event_sickness"

trigger = {
condition = { type = trait value = lustful }
condition = { type = not value = { type = trait value = illness } }
}

mean_time_to_happen = {
months = 450

modifier = {
condition = { type = age value = 35 }
factor = 0.8
}
modifier = {
type = or
condition = { type = trait value = indulgent }
condition = { type = trait value = reckless }
}
factor = 1.2
}
}

# Swim in the sewer and eventually you'll catch something!
immidiate = {
effect = { type = add_trait value = illness }
}
}

I get 'unknown lhs in event file type = or' so it is a syntax error?

Also am I correct/incorrect in assuming to add a new event you must:

a. allocate an available event number
b. put the following into events.txt:

# Rob's Tough Luck

event = "db\events\robs_tough_luck.txt"

c. add the following to /config/event_text.csv

ACTIONNAME10292A;God save me!;;;;;;;;;X
EVT_10292_NAME;The Wages of Sin;;;;;;;;;X

Evidently I am doing something wrong, probably all of the above :rolleyes: ^
 
Last edited:
I get 'unknown lhs in event file type = or' so it is a syntax error?

This means that the event misses a }

To make events easier readable on the forum, don't put them between 'quote' brackets, but use the 'code' brackets. The # button

So put it between this
Code:

Code:
################################
# The Wages Of Sin 
################################ 

character_event = {
	id = 10292

	picture = "event_sickness"

	trigger = {
		condition = { type = trait value = lustful } 
		condition = { type = not value = { type = trait value = illness } }
	}

	mean_time_to_happen = {
		months = 450

		modifier = {
			condition = { type = age value = 35 }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = indulgent }
			factor = 0.8		
		}
		modifier = {
			condition = { type = trait value = reckless }
			factor = 0.8		
		}

	}

# Swim in the sewer and eventually you'll catch something!
	immidiate = { 
		effect = { type = add_trait value = illness }
	}
}

Try the above event and see if that works better
 
Another tip:
put your event text into a config\modtext.csv file instead of using the paradox ones, because a next patch update could overwrite your work ;)