Quick Modding Questions Thread

Hello there! :)

I am trying to understand the ModifierType 'MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER'.

upload_2021-5-11_7-23-2.png

ModifierArguments table with AGENDA_IRON filter for ModifierId

Can you help me in to figure out what "ReductionValue" and "ReductionTurns" means and how it compares to "IncrementValue" and "IncrementTurns"?
If it's a simple increment and decrement, why do they use both with a negative value?

If I'd try to interpret "AGENDA_IRON_CONFEDERACY_MANY_ALLIANCES" it means that once you have many alliances player X likes you by 8 and every 4 turns X likes you --8 = +8 more?

Edit: Ah, and by the way. Is there a maximum value? I wouldn't want to make this unfunctional by using too high/low values.

Thank you in advance!
Best regards
CypRyan
 
Quick help with localization: I am translating my mod into french and everything works fine, but all the letters with accents are blocked out with a boxed 'X' in game. How do I get accented letters to appear correctly?

Thanks in advance! :)
 
Can you help me in to figure out what "ReductionValue" and "ReductionTurns" means and how it compares to "IncrementValue" and "IncrementTurns"?
If it's a simple increment and decrement, why do they use both with a negative value?
From how I understood it (which is a guess, and not how it actually works), Agendas have always an "Initial Value" which is either Positive or Negative (Favored by the Leader and the Opposite respectively), the higher the value the stronger the effect (i.e. -20 makes something very disliked by a Leader). "IncrementTurns" is how much Turns (after the Agenda has been activated/triggered) the "IncrementValue" will be added to the "InitialValue", but I'm not sure if it applies from the turn the agenda got activated or the following turn, so I will just assume the latter here. And some Agendas have a MaxValue that can't be exceeded.

Example: Let's say an Agenda has "InitialValue" set to 15, "IncrementTurn" to 10, "IncrementValue" to 1 and "MaxValue" to 20. If the Agenda get's triggered by turn 1, then it will have a favord value of 15 by the Player. At turn 2 the Value will increase to 16, 17 at 3... and so on. Till it reaches Turn 6 to have the Max amount of 20 (which would make it more favored by the Player than on turn 1), after that the Value won't get increase.

"ReductionTurn" and "ReductionValue" are the same as "IncrementTurn" and "IncrementTurn", except they reduce from the "InitialValue".
Example: Let's say an Agenda has "InitialValue" set to 15, "ReductionTurn" to 10 and "ReductionValue" to -1. If the Agenda get's triggered by turn 1, then it will have a favord value of 15 by the Player. At turn 2 the Value will be set to 16 (because 15 - (-1) = 15+1 = 16), 17... at 3 and so on. Till Turn 11 to achieve the final value of 25 (we don't have a MaxValue here).

The difference is arbitrary, so I'm not sure why the Devs wouldn't just use One of them. Perhaps because one didn't work for some values so they made another one, or I'm completely wrong and there is a difference, but its yet not clear for me.
And some Agendas using either Incremenr or Reduction don't make sence if we go with my explanation above, so I suppose that Agendas either decay with turns (hardcoded?) or could trigger multiple Times between after they have been triggerd and before the Increment/Reduction Turns are over.

If we take "AGENDA_IRON_CONFEDERACY_MANY_ALLIANCES" for example, it should work this way:
If the Agenda gets triggered by turn 1, then at Turn 1 the Initial Value will be 8, at turn 2 it will still be 8. Because 8 - (-8) = 16, but we have a Max Value of 8, so 8 will be the Value at turn 2. same thing on turn 3, 4 and 5. But what after 5? will the value stay as it is or change? if it doesn't change, then the whole thing doesn't make sence to me, so I assume it decays with each Turn or after a set amount of Turns. If that's the case, then that methode in "AGENDA_IRON_CONFEDERACY_MANY_ALLIANCES" makes sure that the agenda will have its Value set to 8 for 5 Turns from the moment it got activated, and after that it will decay.
 
Last edited:
Quick help with localization: I am translating my mod into french and everything works fine, but all the letters with accents are blocked out with a boxed 'X' in game. How do I get accented letters to appear correctly?
What are you using for the code, sql or xml?
 
@Zegangani: Thank you very much for your thougts and elaboration! I am gonna play around with it and figure out the details by trial and error! :)

Another question:
I am playing around with .lua to change loyality and alliances.
This link to a list of lua functions and objects is awesome, but there is something I might be missing. How to determine functions parameters and their types?
Let's say I wanna use SetHasAllied. I searched in the game's .lua files and found some usage in VikingScenario.lua:
Code:
Players[0]:GetDiplomacy():SetHasAllied(1, true);
I can guess that the first parameter is the player id. But what about the second one.
This is just an example, is there a general list or way to determine parameter types?

Thank you in advance :)
 
We don't have access to the source code (unlike civ5), and Firaxis hadn't even released the Lua API (unlike civ5), so we're in the dark here. I know people have tried to use a debugger to get those parameters, without success AFAIK.

So it's the old way, as you've done, and for the few that aren't used in the base code (or not obvious from it), it's the painful trial/error method.

I really have the feeling someone decided to limit the modding capabilities of the game mid-development, not long before the initial release. Because the base is here, modding framework included "from the ground up" as they say, but not releasing the API and not releasing the source have seriously limited the game to assets/modifiers modding only.
 
We don't have access to the source code (unlike civ5), and Firaxis hadn't even released the Lua API (unlike civ5), so we're in the dark here. I know people have tried to use a debugger to get those parameters, without success AFAIK.

So it's the old way, as you've done, and for the few that aren't used in the base code (or not obvious from it), it's the painful trial/error method.

I really have the feeling someone decided to limit the modding capabilities of the game mid-development, not long before the initial release. Because the base is here, modding framework included "from the ground up" as they say, but not releasing the API and not releasing the source have seriously limited the game to assets/modifiers modding only.
Thank you for the fast response.
I'd like to generally thank you @Gedemon and @Zegangani for all your Support here!!!
Gonny try to find out what I need! :)
 
Another question:
I am playing around with .lua to change loyality and alliances.
This link to a list of lua functions and objects is awesome, but there is something I might be missing. How to determine functions parameters and their types?
Let's say I wanna use SetHasAllied. I searched in the game's .lua files and found some usage in VikingScenario.lua:
From the Lua file, I think there are 3 Players, and the SetHasAllied used in the file reflects that. So I would assume that the first Parameter is the PlayerID and the second one is boolean true or false to set the two players as Allies or to break the Alliance if it already existed.
 
I am playing around with .lua to change loyality and alliances.
This link to a list of lua functions and objects is awesome, but there is something I might be missing.

BTW, you may want to have a look at DealManager in the spreadsheet for fine control over Alliance

For example, Military Alliance
Code:
    DealManager.ClearWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    local pDeal = DealManager.GetWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    if pDeal then
        pDealItem = pDeal:AddItemOfType(DealItemTypes.AGREEMENTS, fromPlayerID);
        if pDealItem then
            pDealItem:SetSubType(DealAgreementTypes.ALLIANCE);
            pDealItem:SetValueType(DB.MakeHash("ALLIANCE_MILITARY"));
            pDealItem:SetLocked(true);
        end
        pDeal:Validate();
        DealManager.EnactWorkingDeal(fromPlayerID, toPlayerID);
    end

Open border (10 turns)
Code:
    DealManager.ClearWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    local pDeal = DealManager.GetWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    if pDeal then
        pDealItem = pDeal:AddItemOfType(DealItemTypes.AGREEMENTS, fromPlayerID);
        if pDealItem then
            pDealItem:SetSubType(DealAgreementTypes.OPEN_BORDERS);
            pDealItem:SetValueType(-1);
            pDealItem:SetFromPlayerID(fromPlayerID);
            pDealItem:SetToPlayerID(toPlayerID);
            pDealItem:SetDuration(10);
            pDealItem:SetLocked(true);
        end
        pDeal:Validate();
        DealManager.EnactWorkingDeal(fromPlayerID, toPlayerID);
    end

Close Borders, via pDealItem:SetDuration(0)
Code:
    DealManager.ClearWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    local pDeal = DealManager.GetWorkingDeal(DealDirection.OUTGOING, fromPlayerID, toPlayerID);
    if pDeal then
        pDealItem = pDeal:AddItemOfType(DealItemTypes.AGREEMENTS, fromPlayerID);
        if pDealItem then
            pDealItem:SetSubType(DealAgreementTypes.OPEN_BORDERS);
            pDealItem:SetValueType(-1);
            pDealItem:SetFromPlayerID(fromPlayerID);
            pDealItem:SetToPlayerID(toPlayerID);
            pDealItem:SetDuration(0);
            pDealItem:SetLocked(true);
        end
        pDeal:Validate();
        DealManager.EnactWorkingDeal(fromPlayerID, toPlayerID);
    end
 
Hello! Can someone help, it is possible to create a REQUIREMENT "unit is promoted (at least one promotion)"? In particulary, I want to apply restriction on Columbia extra movements for promoted units only.
 
I don't see any RequirementType that is about a unit has at least one promotion. We cannot make up our own RequirementTypes, so we have to use what is provided by Firaxis.

There is RequirementType REQUIREMENT_UNIT_HAS_PROMOTION listed in the database, but it is not used anywhere by the game so no idea if it actually will work.

Given that it appears to be a requirement type that wants a specific promotion, it would probably be necessary to make an entire set of Requirements, one for each of the Level 1 promotions any units can have. These would need each their own specified PromotionType listed in table RequirementArguments. All these individual requirements would need to be attached to a single RequirementSetId that uses REQUIREMENTSET_TEST_ANY.
 
I'm using sql
When making Text files for Civ VI it's advised to use xml rather than SQL. Because you will eventually encounter some Issues like that, but I think your Issue might be with ' Apostrophs, that are used for Statements in SQL (but can be bypassed by using 2 apostrophes inside the quote, like 'Sid Meier''s Civilization').
I made some Texts with accents using SQL but they were showing correctly In-Game, So if you can upload the file with the Text, it would be easier to decifer the Issue.
 
When making Text files for Civ VI it's advised to use xml rather than SQL. Because you will eventually encounter some Issues like that, but I think your Issue might be with ' Apostrophs, that are used for Statements in SQL (but can be bypassed by using 2 apostrophes inside the quote, like 'Sid Meier''s Civilization').
I made some Texts with accents using SQL but they were showing correctly In-Game, So if you can upload the file with the Text, it would be easier to decifer the Issue.

Hmmm if this is just a problem with sql I'll have to remember to use xml next time - though it would take me a while to rewrite the files in xml rather than sql so if there is a solution that makes sql accented letters work I would greatly appreciate it.

There's no problem with the apostrophes, I already know the trick about using doubles and they appear in the game just fine. It is only the accented letters that are problematic. Here is the text file for my localizations (in .txt since the forum doesn't accept .sql), and an image showing an example of what it looks like in game.
 

Attachments

  • Civilization_Localisation.txt
    33 KB · Views: 29
  • Capture.PNG
    Capture.PNG
    14.2 KB · Views: 33
Hmmm if this is just a problem with sql I'll have to remember to use xml next time - though it would take me a while to rewrite the files in xml rather than sql so if there is a solution that makes sql accented letters work I would greatly appreciate it.
It should actually work. Try using double Apostrophes for the statements instead of single ones, like "Text".
 
New to civ6 modding, rookie question: I used worldbuilder to make quite a few edits on a map from a mod. After i made a lot of changes, i realized i needed to download and turn on some more mods that weren't activated when i created the new map file on worldbuilder, so i could continue to make the changes i wanted to. The new mods i downloaded and activated affect new maps i create on worldbuilder, but not the map i had already begun making. I do not seem to be able to use the worldbuilder map mod as a template for a new worldbuilder map, for some reason. Any ideas that don't involve dumping all the changes i already made?
 
Last edited:
It should actually work. Try using double Apostrophes for the statements instead of single ones, like "Text".
Ah, I have finally realised what the problem is! It turns out that modbuddy was saving the .sql files in ANSI encoding - when I saved the files as UTF-8 instead the accents appeared just fine. Thanks very much for your help! :)
 
Ah, I have finally realised what the problem is! It turns out that modbuddy was saving the .sql files in ANSI encoding - when I saved the files as UTF-8 instead the accents appeared just fine. Thanks very much for your help! :)
Haven't thought about that. I never use Modbuddy for Codes, though, but Notepad++. But Good that you found the Issue and solved it!
Modbuddy has also Issues with some Languages like Frensh and Polish, where the Asset Editor won't work till you change the PC's language to English.
 
You should be able to use Notepad++ to create the original SQL file also if you want to, and just use the Modbuddy --> Add Existing File function to import this pre-existing file into your mod.

But I also never do code in Modbuddy. I just create the project and its structure with the files I need and their actions, and then I save the work in Modbuddy. Exit Modbuddy and open SQL, XML, and Lua files in Notepad or Notepad++ to actually write my code as I find it far less burdensome than the slow modbuddy autofill nonsense.
 
Top Bottom