Resource icon

Civ 6 Modding Tools & Basics

Ok so I made it work. Here's what I did :
Code:
        <Row Name="ICON_UNIT_NOMADICFAMILY" Atlas="ICON_ATLAS_UNITS" Index="0"/>
        <Row Name="ICON_UNIT_NOMADICFAMILY_PORTRAIT" Atlas="ICON_ATLAS_UNIT_PORTRAITS" Index="0"/>
The first line I already had. It was used in the city menu to display that little "settler flag".
The second line I found in a mod template. It's used to display the "bearded guy with a walking stick" portrait when I select my unit in the world.

What I still don't understand, though, is how the system detected that "ICON_UNIT_NOMADIC_PORTRAIT" should be used for that unit. I didn't link it anywhere, and it just worked.
 
Hello raen, I have another question for you.

In your artdef example, you provide a Units.artdef, using the scout as an example. I'm trying to make an artdef file for Buildings. So here are my two questions :
1. Where can I find a "base" artdef that I could then modify for buildings?
2. I want to reuse art from the base game. Where can I find the name of the base game's buildings? (For example, you had Scout and ScoutDog for your units)

Thanks!
 
In core game files, inside assets you find Buildings.artdef along with other artdefs (use astrogrep or use other finding app to find inside assets). Inside the file you have all defined buildings, you copy to your own, then change the last property to your building type name, just like I did in units.
 
Hi Raen, i have read your article in details. I have a query regards to creating a new civilization. First time creating a Civ mod although playing Civ game since Civ 1.

I want to create a new civilisation (INDUS) mod using the current civilisation leader’s (Chandragupta) picture/icon/blp/mtl/etc. Would want to retain everything as per original game. My intend is the change the name of the leader as well as include a civilisation/leader traits. For start, I wanted to create a leader trait similar to Gran Colombia‘s “COMANDANTE_GENERAL” but limit it to only classical era.

Is it possible to create a new civilisation using the base game material. I have read through extensively on mod creation and have created some basic mod for myself in the past. I have SQLITE, Photoshop, and the Civ 6 Asset Editor and Modbuddy works well. Your guidance is greatly appreciated.
 
Hi :)

Yes, you can use base game material, but you have always to make a new copy. Like I try to explain in this tutorial, you get your civilization XML data you want, make your copy and change it. That for Units, Building, and such.

As for icons and leader screens, you can copy images but you still have to do your own new icons and leader screens (all DDS file format)

For comandante general, you can copy (once more) the modifiers and use only in classical (search for MODIFIER_PLAYER_ADJUST_GREAT_PERSON_GUARANTEE in last DLC files)

For modifiers, you have to copy always all relations since Trait. Valid also for all stuff, for instance, copying from new civ (KIND_CIVILIZATION) to its cities, and so on.

If it is easier for you and you have modbuddy, try to create a new civ by the template.

Try to follow my tutorial to create the first structure,

I hope that helps.
 
Hi :)

Yes, you can use base game material, but you have always to make a new copy. Like I try to explain in this tutorial, you get your civilization XML data you want, make your copy and change it. That for Units, Building, and such.

As for icons and leader screens, you can copy images but you still have to do your own new icons and leader screens (all DDS file format)

For comandante general, you can copy (once more) the modifiers and use only in classical (search for MODIFIER_PLAYER_ADJUST_GREAT_PERSON_GUARANTEE in last DLC files)

For modifiers, you have to copy always all relations since Trait. Valid also for all stuff, for instance, copying from new civ (KIND_CIVILIZATION) to its cities, and so on.

If it is easier for you and you have modbuddy, try to create a new civ by the template.

Try to follow my tutorial to create the first structure,

I hope that helps.
Thank you Raen for your response. Will follow your tutorial. I only intent to change the leader name, and add Traits to leader (Comandante_General) till classical era. That’s all. Will use the modbuddy to create the mod.
 
help! i added 4 extra tech options, and got it to work, but cant't get the civics options to work.. teach me masters..
NOTEPAD++. SQL

Code:
local Tech_One = GameInfo.Technologies["TECH_POTTERY"];                         
local Tech_Two = GameInfo.Technologies["TECH_ANIMAL_HUSBANDRY"];                 
local Tech_Three = GameInfo.Technologies["TECH_MINING"];                                     
local Tech_Four = GameInfo.Technologies["TECH_ASTROLOGY"];
local Tech_Five = GameInfo.Technologies["TECH_IRRIGATION"];
local Tech_Six = GameInfo.Technologies["TECH_WRITING"];
local Tech_Seven = GameInfo.Technologies["TECH_ARCHERY"];
local Tech_Eight = GameInfo.Technologies["TECH_BRONZE_WORKING"];
 
 
local Civics_One = GameInfo.Civics["CIVIC_CODE_OF_LAWS"];                         
local Civics_Two = GameInfo.Civics["CIVIC_CRAFTSMANSHIP"];                 
local Civics_Three = GameInfo.Civics["CIVIC_FOREIGN_TRADE"];                                     
local Civics_Four = GameInfo.Civics["CIVIC_MILITARY_TRADITION"];
local Civics_Five = GameInfo.Civics["CIVIC_STATE_WORKFORCE"];
local Civics_Six = GameInfo.Civics["CIVIC_EARLY_EMPIRE"];
local Civics_Seven = GameInfo.Civics["CIVIC_MYSTICISM"];
local Civics_Eight = GameInfo.Civics["CIVIC_GAMES_RECREATION"];

function OnPlayerTurnActivated( player, bIsFirstTime )
 
    local currentTurn = Game.GetCurrentGameTurn();
    local SpawnTurn = 0;
    local playerUnits;
    local adjacentPlot;
    local unitPlot;
        if currentTurn == GameConfiguration.GetStartTurn() then
        local pPlayer = Players[player]
            if pPlayer:IsHuman() then
             playerUnits = pPlayer:GetUnits()
                for i, unit in playerUnits:Members() do
                    local unitTypeName = UnitManager.GetTypeName(unit)
                    if "LOC_UNIT_SETTLER_NAME" == unitTypeName then
                        SpawnTurn = 1;
                        unitPlot = Map.GetPlot(unit:GetX(), unit:GetY());   
                    end
                end
            end   
        
            if SpawnTurn == 1 then
                local lastPlot = unitPlot;
                if NumOne > 0 then
                    for i = 1, NumOne do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX() + 1), lastPlot:GetY(), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break   
                            end
                        end
                        pUnit = playerUnits:Create(iOne, unitPlot:GetX(), unitPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
                end
                if NumTwo > 0 then
                    for i = 1, NumTwo do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX()), (lastPlot:GetY() - 1), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break   
                            end
                        end
                        pUnit2 = playerUnits:Create(iTwo, adjacentPlot:GetX(), adjacentPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
                end
                if NumThree > 0 then
                     for i = 1, NumThree do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX() - 1), lastPlot:GetY(), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break   
                            end
                        end
                        pUnit3 = playerUnits:Create(iThree, adjacentPlot:GetX(), adjacentPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
                end
                if NumFour > 0 then
                     for i = 1, NumFour do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX() ), (lastPlot:GetY() + 1), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break   
                            end
                        end
                        pUnit4 = playerUnits:Create(iFour, adjacentPlot:GetX(), adjacentPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
                end
                if NumFive > 0 then
                     for i = 1, NumFive do
                        for direction = 1, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
                            adjacentPlot = Map.GetAdjacentPlot((lastPlot:GetX() - 1), lastPlot:GetY(), direction);
                            if (adjacentPlot ~= nil) and not (adjacentPlot:IsWater() or adjacentPlot:IsImpassable()) then
                                break   
                            end
                        end
                        pUnit5 = playerUnits:Create(iFive, lastPlot:GetX(), lastPlot:GetY())
                        lastPlot = Map.GetPlot(pUnit:GetX(), pUnit:GetY());
                    end
                end
                    pPlayer:GetTreasury():SetGoldBalance(PlayerGold);
                local curPlayerTech = pPlayer:GetTechs();
                    if(curPlayerTech ~= nil) then
                        if (Tech_One ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_One.Index, curPlayerTech:GetResearchCost(Tech_One.Index));
                        end
                        if(Tech_Two ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Two.Index, curPlayerTech:GetResearchCost(Tech_Two.Index));
                        end
                        if(Tech_Three ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Three.Index, curPlayerTech:GetResearchCost(Tech_Three.Index));
                        end
                        if(Tech_Four ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Four.Index, curPlayerTech:GetResearchCost(Tech_Four.Index));
                        end
                        if(Tech_Five ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Five.Index, curPlayerTech:GetResearchCost(Tech_Five.Index));
                        end
                        if(Tech_Six ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Six.Index, curPlayerTech:GetResearchCost(Tech_Six.Index));
                        end
                        if(Tech_Seven ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Seven.Index, curPlayerTech:GetResearchCost(Tech_Seven.Index));
                        end
                        if(Tech_Eight ~= nil) then
                            curPlayerTech:SetResearchProgress(Tech_Eight.Index, curPlayerTech:GetResearchCost(Tech_Eight.Index));
                    end
                end
                local curPlayerCivics = pPlayer:GetCivics();
                    if(curPlayerCivics ~= nil) then
                        if (Civics_One ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_One.Index, curPlayerCivics:GetResearchCost(Civics_One.Index));
                        end
                        if(Civics_Two ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Two.Index, curPlayerCivics:GetResearchCost(Civics_Two.Index));
                        end
                        if(Civics_Three ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Three.Index, curPlayerCivics:GetResearchCost(Civics_Three.Index));
                        end
                        if(Civics_Four ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Four.Index, curPlayerCivics:GetResearchCost(Civics_Four.Index));
                        end
                        if(Civics_Five ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Five.Index, curPlayerCivics:GetResearchCost(Civics_Five.Index));
                        end
                        if(Civics_Six ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Six.Index, curPlayerCivics:GetResearchCost(Civics_Six.Index));
                        end
                        if(Civics_Seven ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Seven.Index, curPlayerCivics:GetResearchCost(Civics_Seven.Index));
                        end
                        if(Civics_Eight ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Eight.Index, curPlayerCivics:GetResearchCost(Civics_Eight.Index));
                        end
                    end
            
            end
        
        end
 
 
 
end
        
 
 
function Initialize()
Events.LocalPlayerChanged.Add( OnPlayerTurnActivated );
Events.PlayerTurnActivated.Add(OnPlayerTurnActivated);
end
 
Initialize();

i think it's the last few lines causing the conflict:

Code:
local curPlayerCivics = pPlayer:GetCivics();
                    if(curPlayerCivics ~= nil) then
                        if (Civics_One ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_One.Index, curPlayerCivics:GetResearchCost(Civics_One.Index));
                        end
                        if(Civics_Two ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Two.Index, curPlayerCivics:GetResearchCost(Civics_Two.Index));
                        end
                        if(Civics_Three ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Three.Index, curPlayerCivics:GetResearchCost(Civics_Three.Index));
                        end
                        if(Civics_Four ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Four.Index, curPlayerCivics:GetResearchCost(Civics_Four.Index));
                        end
                        if(Civics_Five ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Five.Index, curPlayerCivics:GetResearchCost(Civics_Five.Index));
                        end
                        if(Civics_Six ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Six.Index, curPlayerCivics:GetResearchCost(Civics_Six.Index));
                        end
                        if(Civics_Seven ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Seven.Index, curPlayerCivics:GetResearchCost(Civics_Seven.Index));
                        end
                        if(Civics_Eight ~= nil) then
                            curPlayerCivics:SetResearchProgress(Civics_Eight.Index, curPlayerCivics:GetResearchCost(Civics_Eight.Index));
                        end  
                    end  
               
            end
           
        end
   
 
   
end
           
 
 
function Initialize()
Events.LocalPlayerChanged.Add( OnPlayerTurnActivated );
Events.PlayerTurnActivated.Add(OnPlayerTurnActivated);
end
 
Initialize();

thanks!
 
Hi, any lua errors in logs?

not that i know of.. everything loads fine, it's just that after the map loads and starts, i get all the tech but i don't get the civics.. =(

no error msg when i start, quit the game, or loading a map either.

i copy pasted the tech portion from a mod by a another guy on a site... (that if site was stated, marks the post as spam haha) the mod is called radiantnewgamepresets.

anyway, i went into the sql file and i added 4 more tech options and just copy-pasted the chunk of code "strings" (sorry, i don't know the correct terminology haha) and replaced the 'Tech_ ' with 'Civics_' according to the naming conventions in the Civics files in the base game folder

so i think maybe i named the civics wrong? is it CIVIC_ or Civic_? or Civics_?

or is it named as something else? naming conventions should follow 'Tech' or 'Technologies' right? lol

i already tried 'Civic_' without the 's' too.. so i'm at a loss..

thanks!

i only could find this is in logs/modding.. couldn't find a log/error file..

Code:
[1746161.595] Creating database save point.
[1746161.595] LocalizedText - Loading RMT_Text.xml
[1746161.608] Successfully released save point.
[1746161.608] Applying Component - RNGP_Database (UpdateDatabase)
[1746161.608] UpdateDatabase - Loading RNGP_RadiantNewGamePresets.sql
[1746161.628] Applying Component - UI (AddUserInterfaces)
[1746162.468] Modding Framework - Finished Apply Components
[1746162.468] Applied all components of enabled mods.
[1746162.468] UpdateContent - Importing implicit files, post components
[1746162.513] Localization database has been updated.  Caching data.
[1746163.504] Initializing Gameplay DLL.
[1746163.846] Saving a debug version of the gameplay database.
[1746164.115] Performing post configure processing.
[1746164.752] Reloading Tuner states.
[1746164.765] Reloading icons.
[1746165.416] Reloading colors.
[1746166.094] Successfully reconfigured game.
[1746247.388] Modding Framework - Shutting down framework.
[1746247.388] Releasing Modding Framework Services...
[1746247.388] Services released!

ooo.. is it this? i found it in logs/lua

Code:
LoadScreen: OnLoadGameViewStateDone
RMTUI:  ################ Start Initializing Mod RMT UI Script... ################
RMTUI:  ################ End Initializing Mod RMT UI Script... ################
Runtime Error: C:\Users\user\Documents\My Games\Sid Meier's Civilization VI (Epic)\Mods\RadiantNewGamePresets\RNGP_RadiantNewGamePresets_Spawn.lua:175: function expected instead of nil
stack traceback:
    C:\Users\user\Documents\My Games\Sid Meier's Civilization VI (Epic)\Mods\RadiantNewGamePresets\RNGP_RadiantNewGamePresets_Spawn.lua:175: in function 'OnPlayerTurnActivated'
    [C]: in function 'func'
    [C]: in function '(anonymous)'
MapLabelManager: TETHYS OCEAN (-1662.8940429688, 874.99761962891)
MapLabelManager: TETHYS OCEAN (-1887.9945068359, 9.1764526367188)
MapLabelManager: TETHYS OCEAN (2277.6557617188, -1055.9852294922)
MapLabelManager: TETHYS OCEAN (-2272.7829589844, 1035.5521240234)
MapLabelManager: TETHYS OCEAN (1531.3891601563, -1066.0738525391)
MapLabelManager: TETHYS OCEAN (2273.8532714844, -16.428068161011)
MapLabelManager: TETHYS OCEAN (2401.4326171875, -562.84332275391)
MapLabelManager: TETHYS OCEAN (-2196.5974121094, 488.44320678711)
TutorialUIRoot: ignoring queue for item which is already active item: SCOUT_UNIT_ADDED_TO_MAP
TutorialUIRoot: ignoring queue for item which is already active item: SCOUT_UNIT_ADDED_TO_MAP
TutorialUIRoot: ignoring queue for item which is already active item: SCOUT_UNIT_ADDED_TO_MAP
TutorialUIRoot: ignoring item already in queue: DISTRICT_UNLOCKED
TutorialUIRoot: ignoring item already in queue: DISTRICT_UNLOCKED

thanks again!
 
Last edited:
Yes, lua errors are in logs/lua, do you notice something wrong in code line 175? if not make some prints.

But your case is very specific, if I understand well, you want to have some techs and civics at start game. In that case, try to see Really Advanced Setup Lite from LeeS.

If no solution found in debug or in other mods, I advise you to post at Help Forum.
 
we most likely already have some thread/post explaining how to release a mod on Steam. can I set up some scripts, say in Jenkins? do I need to use Workshop Uploader in Civ6 SDK ? etc.
can someone please share a link to this info? I want to document the release process in a mod's git repo.
 
Yes, lua errors are in logs/lua, do you notice something wrong in code line 175? if not make some prints.

But your case is very specific, if I understand well, you want to have some techs and civics at start game. In that case, try to see Really Advanced Setup Lite from LeeS.

If no solution found in debug or in other mods, I advise you to post at Help Forum.

ooo.. thanks for the good recommendation! :)
 
Raen, I would like to enable this mod which allow 2 unit to be stacked on one tile. This mod was originally created by Gedemon (creator of YnAEMP maps). I check with him via the below link and he mentioned that he had quitted modding for Civ 6. The mod still works with the latest update but some of the unit’s icon (Scout, Slinger,etc) does not show/appear in-game. I checked through the mod but could not solve the problem. I am not expecting you to re-create the mod but to give me some guidance on how to solve the mod errors( enable the unit’s to appear in-game).
https://forums.civfanatics.com/threads/combat-and-stacking-overhaul.608292/page-7#post-15785014
https://forums.civfanatics.com/threads/combat-and-stacking-overhaul.608292/page-7#post-15785014
 
we most likely already have some thread/post explaining how to release a mod on Steam. can I set up some scripts, say in Jenkins? do I need to use Workshop Uploader in Civ6 SDK ? etc.
can someone please share a link to this info? I want to document the release process in a mod's git repo.

Hi. You run Steam Workshop Uploader and grab your .modinfo file of your mod in mods folder, follow easy steps, and upload. The mod will appear as one of your steam user workshops.

You can use all you want to produce the mod but you use always final published result, for instance, you can choose to get your release of git, but Im not aware of any deploy integration with other systems uploading to steam.
 
Raen, I would like to enable this mod which allow 2 unit to be stacked on one tile. This mod was originally created by Gedemon (creator of YnAEMP maps). I check with him via the below link and he mentioned that he had quitted modding for Civ 6. The mod still works with the latest update but some of the unit’s icon (Scout, Slinger,etc) does not show/appear in-game. I checked through the mod but could not solve the problem. I am not expecting you to re-create the mod but to give me some guidance on how to solve the mod errors( enable the unit’s to appear in-game).
https://forums.civfanatics.com/threads/combat-and-stacking-overhaul.608292/page-7#post-15785014

It seems a problem after Last Update, but the mod does not mix directly with icons, no clue at the moment what can be. There´s a thread about it in help forum: https://forums.civfanatics.com/thre...-formation-class-missing-after-update.658801/
 
Top Bottom