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

C4LEB

Recruit
50 Badges
Mar 2, 2018
5
0
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Victoria 2
  • Crusader Kings II: Rajas of India
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • 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: Art of War
  • Knights of Honor
  • Europa Universalis IV: Conquest of Paradise
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III Collection
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Victoria 2: A House Divided
  • Crusader Kings II

Hi I am working on a custom event for Europa Universalis IV, but I keep running into errors related to the namespace and event ID definitions. Despite several fixes, the event does not trigger, and the error log keeps showing issues.My event is located in events/my_quiz_events.txt and is structured as follows:
namespace = quiz_event

event = {
id = 37200001
title = "The Great Quiz!"
desc = "Which year marked the end of the Hundred Years' War?"
picture = DIPLOMACY_eventPicture
is_triggered_only = yes

option = {
name = quiz_event.1.a # Correct answer
trigger = { always = yes }
hidden_effect = {
add_stability = 1
random_list = {
33 = { add_adm_power = 100 }
33 = { add_dip_power = 100 }
34 = { add_mil_power = 100 }
}
}
}
option = {
name = quiz_event.1.b # Wrong answer
trigger = { always = yes }
hidden_effect = {
add_stability = -1
random_list = {
33 = { add_adm_power = -100 }
33 = { add_dip_power = -100 }
34 = { add_mil_power = -100 }
}
}
}
}

However, my error log continuously shows these messages:

[eventmanager.cpp:389]: unknown namespace 'quiz_frage' defined in event files
[eventmanager.cpp:216]: Corrupt Event Table Entry - event in events/my_quiz_events.txt line: 36
[eventmanager.cpp:442]: Incorrect namespace: quiz_frage
[eventmanager.cpp:398]: Broken id definition 'quiz_frage1' defined in event files

What I Have Tried:
  • Ensuring the namespace is quiz_event and that all event IDs use quiz_event.X.
  • Changing the event ID from a string (quiz_frage.1) to a number (37200001).
  • Verifying the event file is properly placed in the events/ folder.
  • Checking events.txt (if necessary) for correct event registration.
  • Making sure my localization file (localisation/my_quiz_events_l_english.yml) correctly matches my event IDs:
l_english:
37200001.title: "The Great Quiz!"
37200001.desc: "Which year marked the end of the Hundred Years' War?"
37200001.option.a: "1453"
37200001.option.b: "1492"

My Questions:

  1. What might be causing the namespace error?
  2. Is there anything I’m missing in my event structure?
  3. Do I need to explicitly register my event in events.txt, or does EU4 automatically load all event files in the events/ folder?
  4. Could my localization file be affecting event recognition?
  5. Is there any known issue with how I use hidden_effect or random_list?
I would really appreciate any help or insight on this issue!
Thanks in advance.
 
Ensuring the namespace is quiz_event and that all event IDs use quiz_event.X.
That's obviously not the case in the code which you posted
Checking events.txt (if necessary) for correct event registration.
Where did you even come up with such a thing? Are you using an AI to help you? Then I would strongly suggest that you stop doing that and start from scratch by either using the documentation on the wiki or by using an existing event as a template(or both). Your event has some weird errors which don't make sense if you would have ever looked at existing events

AIs don't understand context and they have not nearly enough training data to learn how eu4 scripting works and a lot of their training data is outdated(because most posts and mods about eu4 are for old versions)
Making sure my localization file (localisation/my_quiz_events_l_english.yml) correctly matches my event IDs:
That's not the case in your code either
 
  • 2
Reactions:
After reading the wiki it works. But the localisation still missing.
I created two event files:
CSS:
namespace = DLBHPMPG01_1
country_event = {
    id = DLBHPMPG01_1.1  # quiz question 1
    title = "DLBHPMPG01_1.1.title"
    desc = "DLBHPMPG01_1.1.desc"
    picture = DIPLOMACY_eventPicture
    is_triggered_only = yes 
    option = {
        name = "DLBHPMPG01_1.1.a"  # right answer
        ai_chance = { factor = 50 }
        hidden_effect = {
            country_event = {
                id = DLBHPMPG01_right_or_wrong.1
                days = 1
            }
        }
    }
    option = {
        name = "DLBHPMPG01_1.1.b"  # wrong answer
        ai_chance = { factor = 50 }
        hidden_effect = {
            country_event = {
                id = DLBHPMPG01_right_or_wrong.2
                days = 1
            }
        }
    }
}

___________________________________________________________
Code:
namespace = DLBHPMPG01_right_or_wrong
country_event = {
    id = DLBHPMPG01_right_or_wrong.1  # right answer
    title = "DLBHPMPG01_yes.1.title"
    desc = "DLBHPMPG01_yes.1.desc"
    picture = DIPLOMACY_eventPicture
    is_triggered_only = yes
    hidden = yes
    option = {
        name = DLBHPMPG01_yes.1.a
        add_prestige = 50
        add_stability = 1
        random_list = {
            33 = { add_adm_power = 100 }
            33 = { add_dip_power = 100 }
            34 = { add_mil_power = 100 }
        }
    }
}
country_event = {
    id = DLBHPMPG01_right_or_wrong.2  # wrong answer
    title = "DLBHPMPG01_no.1.title"
    desc = "DLBHPMPG01_no.1.desc"
    picture = DIPLOMACY_eventPicture
    is_triggered_only = yes
    hidden = yes
    option = {
        name = DLBHPMPG01_yes.1.a
        add_prestige = -50
        add_stability = -1
        random_list = {
            33 = { add_adm_power = -100 }
            33 = { add_dip_power = -100 }
            34 = { add_mil_power = -100 }
        }
            
    }
}

___________________________________
\Europa Universalis IV\mod\quiz_for_study\localisation\DLBHPMPG01_1_I_english.yml
Code is in UTF-8 with BOM:
Rich (BB code):
l_english:
 DLBHPMPG01_1.1.title:0 "Das grosse Quiz!"
 DLBHPMPG01_1.1.desc:0 "Welches Jahr markierte das Ende des Hundertjaehrigen Krieges?"
 DLBHPMPG01_1.1.a:0 "1453"
 DLBHPMPG01_1.1.b:0 "1492"

VS Code CWTools says there are no problems.

What is wrong? I looked in tempates and wiki. It should work.
And yes i played the game in english.
 
Code:
\Europa Universalis IV\mod\quiz_for_study\localisation\DLBHPMPG01_1_I_english.yml
The filename must end in _l_english.yml (lowercase L ) and not _I_english.yml (uppercase i )
 
  • 1Like
Reactions: