change to modding from the Gathering Storm patch

Another change in GS: In the UI-context you cannot use GameEvents.PlayerTurnStarted.Add any more, otherwise your UI script will not even be loaded. You have to use something like Events.PlayerTurnActivated.Add instead. Maybe this is another issue caused by the weird load orders.
 
Anyone knows how to create a criteria in .modinfo that would activate when XP1 or XP2 is used?
IDK if your "or" is important, if that the case I suppose you need multiple criteria.

else from one of the DLC modinfo
Code:
[...]
    <ReverseReferences>
        <Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="LOC_EXPANSION1_MOD_TITLE"/>
        <Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="LOC_EXPANSION2_MOD_TITLE"/>
    </ReverseReferences>
    <ActionCriteria>
        <Criteria id="IndonesiaKhmer" any="1">
            <LeaderPlayable>Players:StandardPlayers::LEADER_GITARJA,Players:StandardPlayers::LEADER_JAYAVARMAN,StandardPlayers::LEADER_GITARJA,StandardPlayers::LEADER_JAYAVARMAN,Players:Expansion1_Players::LEADER_GITARJA,Players:Expansion2_Players::LEADER_JAYAVARMAN,Players:Expansion2_Players::LEADER_GITARJA,Players:Expansion2_Players::LEADER_JAYAVARMAN</LeaderPlayable>
            <RuleSetInUse>RULESET_STANDARD,RULESET_EXPANSION_1,RULESET_EXPANSION_2</RuleSetInUse>
        </Criteria>
        <Criteria id="IndonesiaKhmer_Expansion1" any="1">
            <LeaderPlayable>Players:Expansion1_Players::LEADER_GITARJA,Players:Expansion1_Players::LEADER_JAYAVARMAN</LeaderPlayable>
            <RuleSetInUse>RULESET_EXPANSION_1</RuleSetInUse>
        </Criteria>
        <Criteria id="IndonesiaKhmer_Expansion2" any="1">
            <LeaderPlayable>Players:Expansion2_Players::LEADER_GITARJA,Players:Expansion2_Players::LEADER_JAYAVARMAN</LeaderPlayable>
            <RuleSetInUse>RULESET_EXPANSION_2</RuleSetInUse>
        </Criteria>
    </ActionCriteria>
    <InGameActions>
        <UpdateArt id="IndonesiaKhmerArt" criteria="IndonesiaKhmer">
            <File>DLC6.dep</File>
        </UpdateArt>
        <UpdateColors id="IndonesiaKhmerColors" criteria="IndonesiaKhmer">
            <File>Data/Indonesia_Khmer_Colors.xml</File>
        </UpdateColors>
        <UpdateDatabase id="IndonesiaKhmerGameplay" criteria="IndonesiaKhmer">
            <File>Data/Indonesia_Khmer_GameplayData.xml</File>
        </UpdateDatabase>
        <UpdateDatabase id="IndonesiaKhmerGameplay_XP1" criteria="IndonesiaKhmer_Expansion1">
            <File>Data/Indonesia_Khmer_Expansion1.xml</File>
        </UpdateDatabase>
        <UpdateDatabase id="IndonesiaKhmerGameplay_XP2" criteria="IndonesiaKhmer_Expansion2">
            <File>Data/Indonesia_Khmer_Expansion2.xml</File>
        </UpdateDatabase>
[...]

Now I'm interested by the effect of the new tag <ReverseReferences>, anyone tested it ?
 
WorldBuilder.CityManager():SetPlotOwner( params ) is apparently no longer working. It doesn't work with params (pPlot, pCity), (plotX, plotY, pPlayer, pCity), or even (plotX, plotY, false). Lua.log reports "function expected instead of nil". Anyone know of an alternative to granting plot ownership through lua? Or anyone have any insight on why the function no longer works?
 
What exactly happend in regards of LoadOrder of mods vs DLCs? Did the "LoadOrder" in DLCs modinfo was changed from eg. 0 to 100 and -100? Or what was the change?
I found an old thread from 2017 (https://forums.civfanatics.com/threads/mod-component-file-load-order-as-of-winter-patch.608496/) where someone said you should use 1 or -1 if you want to load after/before DLCs, but looking at the modinfos from DLCs they have values of 100 and -100. Doesn't this mean we have to make our mods LoadOrder at least 101 if we want them to load after all DLCs ? (I just wonder because some of you wrote "should use LoadOrder" which is not precise and "Luckily I already used LoadOrder for all my mods" which would not help if you used 1 before and now have to change it to 101)

edit:
did someone upload all the civ6 files (xml and lua) somewhere from before 13 Feb 2019? I would like to compare the files to see changes.
 
Last edited:
I guess most do. At least if I read it correctly. Eg in AlexanderScenario.modinfo I see two times "LoadOrder" both with a value of 100, while Expansion1 has a LoadOrder of -100
Ok, so I stopped slacking and looked through them myself and unless I missed some of them then all the content DLCs have LoadOrder set to either -100 or not at all. All the Scenario DLCs have LoadOrder set to +100 and this kind of makes sense, since you wouldn't want random mods to overwrite the values that might have been specifically tailored for a Scenario.
 
One of the best new modding features art-wise is that you can override Unit Culture for specific Civs. For example, Germany has grey tanks rather than the green specified for the European Unit Culture. Also there are Civ specific infantry graphics now. This makes it much more feasible to make Civ-specific cultural diversity type mods.

Also Unit skin tones and hair colour are now specified via Unit Tints so you have variations in skin tone, hair colour which is nice. It would be easy to have multi-ethnic units now. Also handy that they've split Beard attachments from Heads!
 
One of the best new modding features art-wise is that you can override Unit Culture for specific Civs. For example, Germany has grey tanks rather than the green specified for the European Unit Culture. Also there are Civ specific infantry graphics now. This makes it much more feasible to make Civ-specific cultural diversity type mods.

Also Unit skin tones and hair colour are now specified via Unit Tints so you have variations in skin tone, hair colour which is nice. It would be easy to have multi-ethnic units now. Also handy that they've split Beard attachments from Heads!
Are buildings able to apply this feature as well? I always feel it's stupid to have a Greek style Library in an Asian city.
 
You need to directly edit the .modinfo file in your mod's folder after you've build your project.

Actually, I just discovered that you can modify your .civ6proj file so that it's there after build every time.
 
How exactly did you test this? Did you check the load orders of your scripts? Maybe one of your scripts was loaded too late for sending your LuaEvent.
As promised I'm going to post what happens to GS's LuaEvent between UI and Gameplay.
So long story short, LuaEvent doesn't work between to 2 types of scripts any more. It still works among scripts of same context (UI or Gameplay only).
Instead, Firaxis introduced a new method:
Code:
    local kParameters:table = {};
    kParameters.iPlayerID = iPlayerID;
    kParameters.pEnvoyTokens = pEnvoyTokens;
    kParameters.iAnnexCost = iAnnexCost;
    -- Send this GameEvent when processing the operation
    kParameters.OnStart = "HT_LocalPlayerAnnexCityState";
    UI.RequestPlayerOperation(localPlayerID, PlayerOperations.EXECUTE_SCRIPT, kParameters);
This is my updated code to Tully's annex city-state script, on UI end. Basically this will trigger a GameEvent, and the Gameplay script will use this GameEvent to execute functions.
Code:
GameEvents.HT_LocalPlayerAnnexCityState.Add(OnLocalPlayerAnnexCityState);
Register the event in OnLoadScreenClose event, or wherever you feel comfortable in Gameplay end script.
Code:
function OnLocalPlayerAnnexCityState(localPlayerID, params : table)
    local citStateID = params.iPlayerID;
    local envoyTokens = params.pEnvoyTokens;
    local iAnnexCost = params.iAnnexCost;
    --Your actual functions
end
So by doing so the function is called when UI.RequestPlayerOperation method is activated on UI end. Parameters are packaged in a table so you want to unpack the data before using it.
And limitation is, the packaged table as parameter to pass into the function does not take tables in tables. When I packaged nested data, on calling the function the game crashed directly.

Hope this is useful information.
 
Ho, I thought that new (or unused until that scenario) method was used to add new actions in multiplayer games.

LuaEvents limited to context sound like a bug worth reporting, I'll do some test...

Does direct call to GameEvents still work between UI and script ?
 
Top Bottom