1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

change to modding from the Gathering Storm patch

Discussion in 'Civ6 - Creation & Customization' started by Gedemon, Feb 14, 2019.

  1. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    3,385
    Gender:
    Male
    Location:
    Warsaw
  2. Tiramisu

    Tiramisu Chieftain

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    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.
     
  3. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    3,385
    Gender:
    Male
    Location:
    Warsaw
  4. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,642
    Location:
    France
    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 ?
     
  5. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    3,385
    Gender:
    Male
    Location:
    Warsaw
    OR is the key. I want to have a possibility to run the same component for both XP1 and XP2, I don't want to duplicate it in .modinfo.
     
  6. TC_

    TC_ Chieftain

    Joined:
    Jul 8, 2017
    Messages:
    55
    Gender:
    Male
    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?
     
  7. FurionHuang

    FurionHuang Chieftain

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    Sad to find that LuaEvents are no longer passing between game play and context scripts. Ran multiple tests and this was my conclusion.
    @Gedemon Please see if it's true. Or is there any specific way to make them talk again.
     
  8. Tiramisu

    Tiramisu Chieftain

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    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.
     
  9. FurionHuang

    FurionHuang Chieftain

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    I may know what's going on. I will post my discovery when I have successful test result.
     
  10. Fampat

    Fampat Chieftain

    Joined:
    Jan 19, 2019
    Messages:
    29
    Someone was able to find out how to set strategic resource amounts/balance?
     
  11. Serp

    Serp Chieftain

    Joined:
    Apr 1, 2015
    Messages:
    579
    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: Feb 20, 2019
  12. Tiramisu

    Tiramisu Chieftain

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    For me it sufficed to set the load order to 1.
     
  13. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    Which DLCs have +100 LoadOrder?
     
  14. Serp

    Serp Chieftain

    Joined:
    Apr 1, 2015
    Messages:
    579
    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
     
  15. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    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.
     
    dbergan and Serp like this.
  16. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,456
    Location:
    London, UK
    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!
     
  17. FurionHuang

    FurionHuang Chieftain

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    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.
     
  18. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Actually, I just discovered that you can modify your .civ6proj file so that it's there after build every time.
     
  19. FurionHuang

    FurionHuang Chieftain

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    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.
     
    Zur13 and Gedemon like this.
  20. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,642
    Location:
    France
    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 ?
     

Share This Page