I'm trying to use the dynamic city naming in my own mod, but I can't seem to get it to work. The game even successfully reads the modified Lua code, as is evident from the logs when attempting to found a City:
Code:
[2521065.218] dynamic city names: player attempting to settle: 0 Gustavus Adolphus
[2521065.218] dynamic city names: player civ: 35 TXT_KEY_CIV_SWEDEN_SHORT_DESC
The Cities don't get the geographically predetermined names though.
Here's a number of things that could be causing the error:
- I removed some of the Regions (Australia, Oceania, Middle East) and combined others (North/South Asia and America are now just Asia and America, respectively), if that could possibly cause any issues?
- The Regions only encompass parts of the map. Do they have to cover the entirety even if I only want dynamic city names in the parts of the world that are already accounted for?
- The Lua file is imported into the game as a
InGameUIAddin. Should it be something else?
- In the Lua file at the very bottom, it says
Code:
local map = Path.GetFileNameWithoutExtension(PreGame.GetMapScript())
if string.match(string.sub(map, 1, 14), "1415") then
bValidMap = true
print("City names initialized")
end
"1415" is the name of my map. Do I have to change anything else to have the code apply? Maybe the "1, 14" numbers?
Thank you for any help.