Quick Modding Questions Thread

upload_2021-1-26_21-58-8.png

Gametest begins in Middle Ages.
Abilities cited that it has additional combat strenght earned by Iron Working tech. but
upload_2021-1-26_22-6-26.png

Strength calculations and combat prognosis shows no effects of techs AT ALL!!

What did I do wrong or miss now?
 

Attachments

Can I see the Modinfo?
 
@Lonecat Nekophrodite I tried an attachement modifier for Units, OwnerRequirement for the Tech, I even tested it without Technology Requirement to see if combat strength works at all, and it doesn't. I don't know why it doesn't work, perhaps something about loadorder (I didn't try that). Sorry I couldn't help you with this, I have many other things to do, so just have a look at the game's codes that grant Combat Strength and use Raen's database searchtool for reference. Just stick with it and you'll definitely find the solution.
 
Hi, I'm trying to make a mod that gives all civs a new ability but I do not know how to make a new ability for an existing civ can anyone help me with this? Thanks in advance!

You'd have to be more specific. Do you want link to tutorial on how to make custom civ/change game's content from the scratch. Or you already made most of the work and just don't know how to assign already created bonus to civ?

I'd suggest looking into source files Civilizations.xml to see how the bonuses are made and tied.
 
I am looking for help/guide/tutorial on how to replace Governor icons. So far I've downloaded the tools and made the required files (.dds textures), but the scripting shenanigans in ModBuddy is beyond my grasp.
 
Hi folks - hope someone has a quick and easy solution to my problem. I'm starting a mod in the late 1800s and want to have a base set of civics and techs already in place for all civs. For example, everyone should know how to farm, fish, harvest woods, build basic districts and buildings, have mid-game governments and civics, etc. Can anyone tell me how to do this?

Any help will be appreciated. Thanks!
Hey - still looking for some help on this - anybody got any pointers?

Thanks!
 
Hey - still looking for some help on this - anybody got any pointers?

Thanks!
By starting the game in a specific era the players will get the techs of all previous era and a few boost (see <StartingBoostedTechnologies> and <StartingBoostedCivics> tables in gameplay and <Eras> table in frontend)

You can then add techs/civics/government individually using Lua, see for example
\Steam\steamapps\common\Sid Meier's Civilization VI\DLC\VikingsScenario\Scripts\VikingScenario.lua
Code:
        local pCulture:table = pPlayer:GetCulture();
        local pScience:table = pPlayer:GetTechs();
        local pDiplomacy:table = pPlayer:GetDiplomacy();
        local pReligion:table = pPlayer:GetReligion();
        
        pCulture:SetCivic(GameInfo.Civics["CIVIC_CODE_OF_LAWS"].Index, true);
        pScience:SetTech(GameInfo.Technologies["TECH_SAILING"].Index, true);
        local config = PlayerConfigurations[iPlayer];
        if(GameInfo.Civilizations["CIVILIZATION_AL_ANDALUS"].Hash ==
        config:GetCivilizationTypeID() or
            GameInfo.Civilizations["CIVILIZATION_BYZANTIUM"].Hash == config:GetCivilizationTypeID() or
            GameInfo.Civilizations["CIVILIZATION_FRANCIA"].Hash == config:GetCivilizationTypeID() ) then
            pCulture:SetCivic(GameInfo.Civics["CIVIC_MONOTHEISM"].Index, true);
            pCulture:SetCivic( GameInfo.Civics["CIVIC_DIVINE_RIGHT"].Index, true);
            pCulture:SetCivic(GameInfo.Civics["CIVIC_THEOLOGY"].Index, true);
            pCulture:SetCivic(GameInfo.Civics["CIVIC_REFORMED_CHURCH"].Index, true);
            pCulture:UnlockGovernment(GameInfo.Governments["GOVERNMENT_THEOCRACY"].Index);
            pCulture:SetCurrentGovernment(GameInfo.Governments["GOVERNMENT_THEOCRACY"].Index);

            pScience:SetTech(GameInfo.Technologies["TECH_LONGSHIPS"].Index, true);
            pScience:SetTech(GameInfo.Technologies["TECH_MEAD_HALLS"].Index, true);
            pScience:SetTech(GameInfo.Technologies["TECH_APPRENTICESHIP"].Index, true);
            pScience:SetTech(GameInfo.Technologies["TECH_LANCES"].Index, true);
            pScience:SetTech(GameInfo.Technologies["TECH_STIRRUPS"].Index, true);
            pScience:SetTech(GameInfo.Technologies["TECH_CASTLES"].Index, true);
        else
            pCulture:UnlockGovernment(GameInfo.Governments["GOVERNMENT_CHIEFDOM"].Index);
            pCulture:SetCurrentGovernment(GameInfo.Governments["GOVERNMENT_CHIEFDOM"].Index);
        end
 
Thanks Gedemon - just what I was looking for. Can you tell me where in the xml files I would set the starting ERA? Or at least set it as the default on the create game UI?

Re the LUA script, that's very interesting - I've not messed with LUA to this point because I'm still catching up on the xml changes since Civ4. If I understand the example you've given, first you're pulling 4 tables into LUA, then you're giving Code of Laws and Sailing to everyone, then, if the civ is either Byzantium or Francia, they get more civics/techs and the govt Theocracy which is their current govt, otherwise all other civs are govt Chiefdom. Did I miss anything?

Thanks for your help!
 
for the Lua example, it's only a part of the code running in a loop, which, yes, iterate every players and does what you say (some of the techs are specific to the scenario BTW)

for the file, I don't know where in the base file it is, I work directly on tables when modding (looking at them using a sqlite viewer, and making my changes in SQL or XML DB updates files) you can still edit the base game files if you want for a quick test, but it's not recommended.

one of the bigger step from civ4 to civ5/6 modding is that change to setup the data, which is explained at the beginning of LeeS' guide
 
I seem to have encoutered problem once again.

How does one correctly update LUA script? I have InGame ReplaceUIScript Action that sets Properties LuaContext to GovernorPanel and LuaReplace to <filename>.lua, where the file is in root of project. Prior to this, I have InGame ImportFile Action that imports the <filename>.lua.

The game accepts my script (I tried shifting SS Governors to the end of the queue for testing purposes), but when I open Promotions of any Governor, they are blank, no Description, no Promotions, both Back and Confirm buttons appear. I did no further change to the script, it's the exact copy, and while I did add new Governor, it worked fine before I replaced it with my file.

Before I debug it any further I just want to make sure I am not simply importing the LUA script incorrectly or doing some basic mistake.
 
I think they updated the UI of Governors (something about Icons IIRC) in the latest dlc, so perhaps you will have to change the script as well.
 
I only began making the mod with this update and I do have that script that includes Secret Societies.
 
anyone know how to get custom music? I tried replacing the files with my own music after using wwise to convert it to wem, but in-game it's just silent.
 
A couple questions to save me some time experimenting with things that might be impossible.
1. If I use SQL to add a new column to an existing table like "Units". Can I access that new column in LUA when iterating over GameInfo.Units() ?
2. If I use the SetProperty function to set a property on a city, does that property remain on the city when another player captures the city?
 
1/ yes
2/ I suppose not, I'd set the property on the plot instead.
 
anyone know how to get custom music? I tried replacing the files with my own music after using wwise to convert it to wem, but in-game it's just silent.

If you published with wwise and uploaded in plataforms (an update changed music place to platforms) , run play in lua of your music. You can see my Portugal mod as reference.
 
If you published with wwise and uploaded in plataforms (an update changed music place to platforms) , run play in lua of your music. You can see my Portugal mod as reference.
i literally just converted a wav to wem in wwise, renamed it according to the music bank text file, and dragged and replaced it into Sid Meier's Civilization VI\Base\Platforms\Windows\audio. I know it worked because that audio is now silent in game, but my song is not playing instead. just silence.
I have no idea what publishing in wwise entails, and I do not have any lua related to this.
 
Back
Top Bottom