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

DiePie7724

Recruit
May 31, 2020
8
8
So recently I've been making a mod for eu4 that turns it into ww1.
One of the things that I'm doing is to give the ottomans some (historically accurate) debuffs, like slower movement and reinforcement speed since ottoman rail networks were extremely poor at the onset of the war. I created an event that would trigger when the game started, that would give the ottomans this debuff. However, when I loaded up the game, the event showed up, but only said "missing localization" and didn't give the country modifier.

<picture of event>
View attachment 583525

<code in the "events" file>
Code:
namespace = railway

#starting off the game with
country_event = {
    id = 100000
    title = "TURrailname1"
    desc = "TURraildesc1"
    picture = COMET_SIGHTED_eventPicture
    fire_only_once = yes

    trigger = {
        is_year = 1900
        tag = TUR
        }

    option = {
            name = "TURrailopt1"
            }
       
    immediate = {
        add_country_modifier = TURrailmod1
            }
        }
    }

<code in the "event_modifiers" file>
Code:
TURrailmod1 = {
    reinforce_speed = -.5
    movement_speed = -.25

<code in the "localization" file>
Code:
TURrailname1: 0 "ineffective railway systems"
TURraildesc1: 0 "The Ottoman economy has long lagged behind the rest of Europe. Recent efforts have been aided by foreign powers with an interest in the region such as Great Britain, France, and Germany. However, the vast Ottoman Empire still remains poorly connected by rail, with already constructed railways either not connecting to each other, or to strategically important locations.
TURrailopt1: 0 "We must improve our railways"
TURrailmod1: 0 "Poor Railways"

I don't have all of the DLC, so that might cause issues?
I have the localization in a seperate file, but it doesn't give the modifier either so I don't think that's it.
 
You should better post this in the user mods subforum(I think that you have to register your game to access it).

You seem to have a space between the colon and the 0 in the localisation file. I think that is not allowed. Also it looks like there is no leading space in the localisations lines, but that might be caused by the forum display. Did you add this to a new localisation file? In that case it needs to have a BOM and the first line must contain(without any spaces):
Code:
l_english:
And I think that you should prefix your event ids with the namespace, e.g. "railway.100000", but I don't know if that is necessary.
And I think that you used the add_country_modifier the wrong way. See the wiki for an example.
And if you want the modifier to show up in the tooltip of the option, it needs to be part of the option
 
All forums are open now, no registration necessary.
Thanks for the info. The user mods forum is still inaccessible when not logged in, so I thought that they still need game registration.
 
I had the same issue and even though this is an old thread I thought I might as well write down the problem and what I did to solve it.
Quite simply you cannot create a text file and rename it to a yml file because of character encoding. This is easily solved by just copying a localization file from the vanilla game files and removing everything except the first line. Hope this helps some random person who stumbles upon this thread just as I did!
 
Quite simply you cannot create a text file and rename it to a yml file because of character encoding.
You can. You just have to make sure that you actually change the file extension(and not have a file named .yml.txt which looks like .yml if your file explorer hides file extensions) and you must tell your text editor to use the UTF-8 encoding with a BOM. Any decent text editor has a way to do that, but I think windows notepad doesn't have one.