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

richvh

Preserver of the Light
62 Badges
Dec 1, 2001
14.706
2.021
Visit site
  • Stellaris: Leviathans Story Pack
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • 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: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • A Game of Dwarves
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
After spending 5 hours debugging a handful of events submitted for LUCKS, most of it waiting for CK to load yet again so I could find the next error, the top of my wishlist is a way to check event syntax quicker, an external utility that could be left running, and read a file that I've just saved.
 
That would be a real trick, since (as you've undoubtedly noticed) the syntax is not 100% uniform.

If you ever successfully manage to make one, please let me know. Until then it's Notepad and coffee for me.
 
Something that would at least make sure that the braces are balanced would be a good start.
 
i modified my eu2 event file parser to work with ck event files :)
http://coder.specialforces.ee/eu2/ckeventparser.zip

currently it mainly checks only syntax not semantics - it doesn't recognise this as an invalid value for age:
condition = { type = age value = old }

and i already found an error in lordship_events.txt file :D
(line 588, the "Legitimate son Revelead as a Bastard!" event has two action_a elements)
 
The CK event parser missed the missing right brace in this snippet:
Code:
		condition = {
			type = not
			value = {
				type = trait
				value = lustful
			}
 
Also missed the missing right brace in this snippet:
Code:
	action_a = { # 
		effect = { type = death value = spouse }
		effect = {
			type = random
			chance = 85
			effect = { type = add_trait value = kinslayer }
        }
 
Other things not caught:

nested condition
Code:
  condition = {
    condition = {
      type = is_married
    }
  }

condition after type = not (which takes value, not condition):
Code:
  condition = {
    type = not
    condition = {
      type = is_married
    }
  }
 
value without preceding type:
Code:
                        condition = { value = { type = age value = 35 } }
 
it should now detect missing braces
apparently i deleted a bit too much old eu2 event parser code :D
and those other things are not detected as errors because as i said, currently it doesn't check semantics
however, i'm planning to write all those condition/effect rules into the syntax/semantics database, althought it might take some time (because ck has tons of them :D)
edit: found two more errors: Provincial_Structure_Events.txt and sin_events.txt are missing some }
 
Last edited:
Coder said:
it should now detect missing braces
apparently i deleted a bit too much old eu2 event parser code :D
and those other things are not detected as errors because as i said, currently it doesn't check semantics
however, i'm planning to write all those condition/effect rules into the syntax/semantics database, althought it might take some time (because ck has tons of them :D)
edit: found two more errors: Provincial_Structure_Events.txt and sin_events.txt are missing some }

:confused:

As it happens, I was going through the Provincial_Structure_Events.txt today. There are no syntax errors in that file in the version that I have (08/03/2004).

There is one missing right elipse in event ID#5300 of the sin events file though.
 
Note: you will have to write syntax rules for every command in each of the 3 types since in many cases they follow different rules. Don't forget to have your syntax checker take that into account.

Good example: virtually any condition you use in a spread event will result in an error (or it being non-functional, depending on circumstance) if you fail to specify whether it is a "to" or "from" condition - but those same broken events would work perfectly in a normal (non-spread) province event.
 
I have no clue when my file is from as I edited it already, but the version I had of 'Provincial Structure events' did have one missing right bracket at the end, 'sin events' had two missing on the bottom as well.


Nice tool coder :)
 
Confirmed - the last event in 1.02's Provincial_Stucture_Events.txt and sin_events.txt are missing closing braces - 1 in event 990 in Provincial_Structure_Events.txt and 2 in event 5300 (the only event in the file) in sin_events.txt.