Quick Modding Questions Thread

Is there a way to change city ownership between players using .lua in Civ 6?

I found this example from Civ 5, hoping that it would work in Civ 6, but it did not work for me:
Players[newOwnerID]:AcquireCity(City, true, false);

I'm hoping there is something similar in Civ 6 though!
See the CityManager tab in Gedemon's spreadsheet. I have no idea what the arguments are for the "Transfer" method, however. Like in Civ5 there may be any number of preparatory actions that need to be performed prior to the actual transfer command. And the method may only work in GS.
 
Making a big mod by combining smaller unit mods. Is it neccessary to combine once separate codes into unified ones?

Can't you just have sub-directories for each existing mod, remove their .modinfo files and put the relevant contents in the top directory? That's how I combined a ton of Gedemo's city state mods and it works fine.
 
WHAT?! Is there a simpler methods than what Deliverator uses? (actually he began with *.sql files. his later works are made in *.xml since the new patch doesn't seems to support SQL anymore, also Modbuddy template mod data files, icon files, and civilopedia entries are all XML so i stay with it.)

My mod project is a combination of my very own unit mods of several units + community created units posted here in Civfanatics. each unit is assigned to the class and I want these units to be upgradeable; upgrades from, and upgrades to.

Another annyoing things are icons.xml files. A separate smaller unit mod allocates icons and portraits to their respective 'One index atlasses' and uses a respective separate .dds files. I don't wanna risk combining these atlasses into one. Is it still possible to just copy *.xml programming codes from icons.xml of two different unit mods and paste it one after another without giving a new atlas? assuming that i've already copied the existing .dds icons and portraits and assigned them to a collective UITexture file.
 
Last edited:
lua question: using CityManager.GetCityAt(iX, iY) , does (iX,iY) needs to be the city center, or can it be any plot in the city?
 
See the CityManager tab in Gedemon's spreadsheet. I have no idea what the arguments are for the "Transfer" method, however. Like in Civ5 there may be any number of preparatory actions that need to be performed prior to the actual transfer command. And the method may only work in GS.
Thank you, LeeS! That's a great starting point, and even if the command only works in GS that's okay, since my map is intended only for GS anyways! :)
 
WHAT?! Is there a simpler methods than what Deliverator uses? (actually he began with *.sql files. his later works are made in *.xml since the new patch doesn't seems to support SQL anymore,....
The game database is an SQL database. XML files added under UpdateDatabase, UpdateIcons, UpdateText all get translated by the game into SQL before insertion into their respective databases. If a patch broke your SQL files for these types of actions, then you have a syntax issue introduced into your code by the patch changing things in the Database or by mistyping or other errors that crept into an SQL file when attempting to make it give compatibility to a change made by a patch, not a "using SQL is no longer working" issue.
 
Does anyone got a problem with Saka Horse Archer Armor asset? where you can duplicate it (save as) but you can't rig it (behaviour changes the duplicated ones in Asset Editor?). No such problems happens with different armor assets however, where you can still rig ones as normal.
 
It needs to be the XY location of the City Center.
Then, how do I get the city object if i have the coordinates of a plot in the city?
Because, if i understood correctly, BuidingAddedToMap() gives you the coordinates of the building, not the city center.
 
Then, how do I get the city object if i have the coordinates of a plot in the city?
Because, if i understood correctly, BuidingAddedToMap() gives you the coordinates of the building, not the city center.
Code:
local pCity = Cities.GetPlotPurchaseCity(pPlot)
 
I have a building added with a mod. The icon for the building shows up fine in the overworld map when I start constructing it, but as the construction meter fills up the icon gets replaced with whatever I built previously. What have I forgotten to do?
 
Hi I am using UI Plugins Framework, everything is working well except the icon:

Code:
Icon = "ICON_UNIT_JAPANESE_SAMURAI";

The example value works, but I don't know where those values come from. How can I get/dump a list of these? I tried something like ICON_Turn or ICON_TURN but they don't work.

EDIT: seem like ICON_ and append with any unit/building/civic/technology ID works, but how about other icons? I need something that look like a timer icon for example (ICON_Turn would be good)
 
Hi, I have made this mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1300927610&tscn=1567414388
And if you go down to the comments section you will see there is one guy there complaining about some problem I have no idea how to solve. I really want to help, so I hope you can help me figure out what is not working for this guy.
Basically, he says that this mod is considered as an older version of my mod for Gathering Storm (https://steamcommunity.com/sharedfiles/filedetails/?id=1660291558) , so he can't use both expansions.
Any ideas?
 
Do they both have the same mod id? Only one mod with the same id can be active at once, so if they are meant to be compatible with each other you should change one of the ids.
Nope, the ids are completely different. I have a feeling that maybe there is a bug in the mod uploader that has caused this. I have reuploaded the mods again, and I hope now it is all fine.
 
I think not because I think the mechanic is directly buried in the game's controlling DLL code to which we have no access.

It might be under the GameEffects SQL-table but I don't remember seeing it listed therein in the SQLite Database.
 
I try to add some natural wonders to my self-created map using world builder but failed, I checked the condition which the wonder needed but still cannot add it.

Therefore I want to directly editing .Civ6Map file using SQLite, I find the plot is using ID to identify each of them in file, but in world builder it's usinig X Y position,
so how to get plot id from X Y position? thanks.
 
the formule used in the Lua files is
Code:
id = y * g_iW + x + 1
where g_iW = mapWidth - 1 (x,y starting at 0)
 
Back
Top Bottom