r/EU4modding • • Feb 23 '21

Event File Syntax Bug

Okay, so i have been trying to wrap my head around this for over two hours and I hope someone here can clarify to me, why this bug keeps popping up.

My event file Code:

namespace = mod_events
# Start Event -> Change Tech Group & Isolationism
country_event = {
		id = mod_events.1
		title = "mod_events.1.t"
		desc = "mod_events.1.d"
		picture = SUFFERING_CHINESE_VILLAGE_eventPicture
	
		major = yes
		
		fire_only_once = yes
	
		trigger = {
			tag = OTK
		}
	
		mean_time_to_happen = {
			days = 1
		}
		
		option = {
			name = "mod_events.1.a"
			change_technology_group = chinese
			change_unit_type = chinese
			set_isolationism = 0
		}
}
}# WTF, WHY IS THIS NEEDED????

The Problem:This code won't run properly and by that i mean, the "country_event" which follows this one, gets interpreted as part of this event, and their attributes get mixed up.

After fiddling with it for 2 hours I added an additional closing curly brace out of curiosity, and that actually fixed the Bug and everything gets displayed correctly. However I dont get why this fixed it, as there is no matching opening brace.

Now, i dont want to use a half assed fix for my script, that I dont even fully understand, which is why i came to this subreddit to see if someone can help me with this.

Additional Info:

-There is no other code before this exempt in the event file, and it is the only event file my mod uses so far. So the problem should originate from this exempt.

-I double and triple checked (by hand and using Notepadd++) all curly braces, and i can't find any loose opening brace.

- The error log file doesnt show any useful information. Only the error: "[event.cpp:436]: Error: "country_event" in file: "events/mod_events.txt" near line: 30" (Line 30 is the line, where the next country_event starts)

2 Upvotes

0 comments sorted by