1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

change to modding from fall patch

Discussion in 'Civ6 - Creation & Customization' started by Gedemon, Oct 19, 2017.

  1. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,743
    Location:
    France
    I've attached a diff of the dep, artdef, sql, xml, lua, modinfo files for the fall patch to this post.

    And please, share here the differences you've found related to modding with the fall patch, TIA
     

    Attached Files:

    Ewok-Bacon-Bits likes this.
  2. thecrazyscot

    thecrazyscot Spiffy

    Joined:
    Dec 27, 2012
    Messages:
    1,674
    It looks like they've added support for includes in at least some of the UI files. The new scenario extends the CityStates, TradeOverview, and ReligionScreen UIs without requiring a full file replacement.
     
  3. greyTiger

    greyTiger Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    198
    Location:
    Australia
    Does anyone know if they have fixed the bug where you can not construct buildings in a unique district if there is another civ in the game with their own unique district?
     
  4. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,743
    Location:
    France
    could someone post the content of the scenario's lua file ?

    (the file is useless by itself for someone who doesn't have the DLC, but useful for modders that want to duplicate the new methods in their mods, ie not just the UI part)

    For the UI, is it a conditional include like the one used in the InGame.lua file ? I've always wondered why it wasn't extended to the other UI files since civ5
     
  5. thecrazyscot

    thecrazyscot Spiffy

    Joined:
    Dec 27, 2012
    Messages:
    1,674
    Sure thing - here are the ones I was talking about. I can post the other lua files if you would like them as well.

    The include statement is literally this:
    Code:
    include("CityStates");
     

    Attached Files:

    Gedemon likes this.
  6. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,743
    Location:
    France
    Thanks !

    could you quote just the section of code in the scenario's modinfo that refers to those UI files ?
     
  7. thecrazyscot

    thecrazyscot Spiffy

    Joined:
    Dec 27, 2012
    Messages:
    1,674
    Here's the relevant parts.
    Code:
    <InGameActions>
         <AddGameplayScripts id="Indonesia_KhmerScenarioScripts" criteria="Indonesia_KhmerScenario">
              <File>Scripts/IndonesiaKhmerScenario.lua</File>
         </AddGameplayScripts>
         <ReplaceUIScript id="Indonesia_KhmerScenarioCityStates" criteria="Indonesia_KhmerScenario">
              <Properties>
                   <LuaContext>CityStates</LuaContext>
                  <LuaReplace>UI/Replacements/CityStates_Indonesia_KhmerScenario.lua</LuaReplace>
              </Properties>
         </ReplaceUIScript>
         <ReplaceUIScript id="Indonesia_KhmerScenarioTradeOverview" criteria="Indonesia_KhmerScenario">
              <Properties>
                  <LuaContext>TradeOverview</LuaContext>
                  <LuaReplace>UI/Replacements/TradeOverview_Indonesia_KhmerScenario.lua</LuaReplace>
              </Properties>
         </ReplaceUIScript>
         <ReplaceUIScript id="Indonesia_KhmerScenarioReligionScreen" criteria="Indonesia_KhmerScenario">
              <Properties>
                  <LuaContext>ReligionScreen</LuaContext>
                  <LuaReplace>UI/Replacements/ReligionScreen_Indonesia_KhmerScenario.lua</LuaReplace>
              </Properties>
         </ReplaceUIScript>
    </InGameActions>
    Code:
    <InGameActions>
         <ImportFiles id="Indonesia_KhmerScenarioFiles" criteria="Indonesia_KhmerScenario">
              <File>UI/ARXManager.lua</File>
              <File>UI/CivilopediaPage_Resource.lua</File>
              <File>UI/EndGameMenu_Indonesia_KhmerScenario.lua</File>
              <File>UI/Replacements/CityStates_Indonesia_KhmerScenario.lua</File>
              <File>UI/Replacements/TradeOverview_Indonesia_KhmerScenario.lua</File>
              <File>UI/Replacements/ReligionScreen_Indonesia_KhmerScenario.lua</File>
              <File>UI/WorldRankings.lua</File>
              <File>UI/WorldRankings.xml</File>
              <File>UI/MinimapPanel.lua</File>
              <File>UI/GreatWorksOverview.lua</File>
         </ImportFiles>
    </InGameActions>
     
    Gedemon likes this.
  8. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,743
    Location:
    France
    perfect, thanks.
     
  9. ITcore

    ITcore Chieftain

    Joined:
    Dec 25, 2016
    Messages:
    240
    Gender:
    Male
    A lot of people are talking about an issue that is cropping up involving major and minor civs spawning too close as well as some City States not plopping their Settler immediately but wandering for a bit. Does the following code have any affect on that? I don't know LUA from a hole in the ground, I'm just trying to help. It was from the file in this thread and compares the changes in the AssignStartingPlots script.

    Code:
    @@ -310,9 +310,18 @@ function AssignStartingPlots:__SetStartMajor(plots)
     
         sortedPlots ={};
     
    +    if plots == nil then
    +        return;
    +    end
    +
         local iSize = #plots;
         local iContinentIndex = 1;
    -
    +   
    +    -- Nothing there?  Just exit, returing nil
    +    if iSize == 0 then
    +        return;
    +    end
    +   
         for i, plot in ipairs(plots) do
             row = {};
             row.Plot = plot;
    @@ -339,6 +348,8 @@ function AssignStartingPlots:__SetStartMajor(plots)
         end
     
         local bValid = false;
    +    local pFallback:table = Map.GetPlotByIndex(sortedPlots[1].Plot);
    +    local iFallBackScore = 0;
         while bValid == false and iSize >= iContinentIndex do
             bValid = true;
             local NWMajor = 0;
    @@ -349,26 +360,48 @@ function AssignStartingPlots:__SetStartMajor(plots)
             -- Checks to see if the plot is impassable
             if(pTempPlot:IsImpassable() == true) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 0;
    +            if (iFallBackScore <= iFallBackScoreTemp) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if the plot is water
             if(pTempPlot:IsWater() == true) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 1;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
    -
    -        -- Checks to see if there are resources
    -        if(pTempPlot:GetResourceCount() > 0) then
    -           local bValidResource = self:__BonusResource(pTempPlot);
    -            if(bValidResource == false) then
    -               bValid = false;
    -            end
    -        end
    +       
    +        -- Checks to see if there are any major civs in the given distance
    +        local bMajorCivCheck = self:__MajorCivBuffer(pTempPlot);
    +        if(bMajorCivCheck == false) then
    +            bValid = false;
    +        else
    +            local iFallBackScoreTemp = 2;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
    +        end   
     
             -- Checks to see if there are luxuries
             if (math.ceil(self.iDefaultNumberMajor * 1.25) + self.iDefaultNumberMinor > self.iNumMinorCivs + self.iNumMajorCivs) then
                 local bLuxuryCheck = self:__LuxuryBuffer(pTempPlot);
                 if(bLuxuryCheck  == false) then
                     bValid = false;
    +            else
    +                local iFallBackScoreTemp = 3;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
                 end
             end
            
    @@ -383,23 +416,49 @@ function AssignStartingPlots:__SetStartMajor(plots)
             local bWaterCheck = self:__GetWaterCheck(pTempPlot);
             if(bWaterCheck == false) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 4;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             local bValidAdjacentCheck = self:__GetValidAdjacent(pTempPlot, 0);
             if(bValidAdjacentCheck == false) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 5;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if there are natural wonders in the given distance
             local bNaturalWonderCheck = self:__NaturalWonderBuffer(pTempPlot, false);
             if(bNaturalWonderCheck == false) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 6;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
    -
    -        -- Checks to see if there are any major civs in the given distance
    -        local bMajorCivCheck = self:__MajorCivBuffer(pTempPlot);
    -        if(bMajorCivCheck == false) then
    -            bValid = false;
    +       
    +        -- Checks to see if there are resources
    +        if(pTempPlot:GetResourceCount() > 0) then
    +           local bValidResource = self:__BonusResource(pTempPlot);
    +            if(bValidResource == false) then
    +               bValid = false;
    +            end
    +        else
    +            local iFallBackScoreTemp = 7;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if there is an Oasis
    @@ -416,7 +475,7 @@ function AssignStartingPlots:__SetStartMajor(plots)
             end
         end
     
    -    return nil;
    +    return pFallback;
     end
     
     ------------------------------------------------------------------------------
    @@ -429,8 +488,18 @@ function AssignStartingPlots:__SetStartMinor(plots)
         -- minimum food
     
         sortedPlots ={};
    -
    +   
    +    if plots == nil then
    +        return;
    +    end
    +   
         local iSize = #plots;
    +
    +    -- Nothing there?  Just exit, returing nil
    +    if iSize == 0 then
    +        return;
    +    end
    +
         local iContinentIndex = 1;
     
         for i, plot in ipairs(plots) do
    @@ -443,6 +512,8 @@ function AssignStartingPlots:__SetStartMinor(plots)
         table.sort (sortedPlots, function(a, b) return a.Fertility > b.Fertility; end);
     
         local bValid = false;
    +    local pFallback:table = Map.GetPlotByIndex(sortedPlots[1].Plot);
    +    local iFallBackScore = 0;
         while bValid == false and iSize >= iContinentIndex do
             bValid = true;
             local NWMinor = 2;
    @@ -453,36 +524,72 @@ function AssignStartingPlots:__SetStartMinor(plots)
             -- Checks to see if the plot is impassable
             if(pTempPlot:IsImpassable() == true) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 0;
    +            if (iFallBackScore <= iFallBackScoreTemp) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if the plot is water
             if(pTempPlot:IsWater() == true) then
                 bValid = false;
    -        end
    -
    -        -- Checks to see if there are resources
    -        if(pTempPlot:GetResourceCount() > 0) then
    -            local bValidResource = self:__BonusResource(pTempPlot);
    -            if(bValidResource == false) then
    -                bValid = false;
    +        else
    +            local iFallBackScoreTemp = 1;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
                 end
             end
    +       
    +        -- Checks to see if there are any minor civs in the given distance
    +        local bMinorCivCheck = self:__MinorCivBuffer(pTempPlot, 1);
    +        if(bMinorCivCheck == false) then
    +            bValid = false;
    +        else
    +            local iFallBackScoreTemp = 2;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
    +        end       
     
             local bValidAdjacentCheck = self:__GetValidAdjacent(pTempPlot, 2);
             if(bValidAdjacentCheck == false) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 3;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if there are natural wonders in the given distance
             local bNaturalWonderCheck = self:__NaturalWonderBuffer(pTempPlot, true);
             if(bNaturalWonderCheck == false) then
                 bValid = false;
    +        else
    +            local iFallBackScoreTemp = 4;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
    -        -- Checks to see if there are any minor civs in the given distance
    -        local bMinorCivCheck = self:__MinorCivBuffer(pTempPlot, 1);
    -        if(bMinorCivCheck == false) then
    -            bValid = false;
    +        -- Checks to see if there are resources
    +        if(pTempPlot:GetResourceCount() > 0) then
    +            local bValidResource = self:__BonusResource(pTempPlot);
    +            if(bValidResource == false) then
    +                bValid = false;
    +            end
    +        else
    +            local iFallBackScoreTemp = 5;
    +            if (iFallBackScore <= iFallBackScoreTemp and bValid == true) then
    +                pFallback = pTempPlot;
    +                iFallBackScore = iFallBackScoreTemp;
    +            end
             end
     
             -- Checks to see if there is an Oasis
    @@ -498,7 +605,7 @@ function AssignStartingPlots:__SetStartMinor(plots)
             end
         end
     
    -    return nil;
    +    return pFallback;
     end
     
  10. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,743
    Location:
    France
    yes, that's one of the first files I've looked at (as it could impact YnAMP)

    seems they wanted to provide a fallback starting location in case the code failed to find a starting location. I don't know if it's that part that's break the placement.

    I've not tried a vanilla game, but I have a few start with YnAMP without problem (need more test to make sure of course, as this does not happens every time with vanilla I guess), it uses the old code and I added my own fallback function with the Terra map script.
     
  11. ITcore

    ITcore Chieftain

    Joined:
    Dec 25, 2016
    Messages:
    240
    Gender:
    Male
    I've only tried 2 vanilla games so far (testing personal mod) and both times it dropped me on a coastal tundra tile on the absolute farthest south end of a continent. I have changed the start bias terrains for the Civ I'm testing but it's odd to place me at tundra each time but I think it has to do with some other factors in there so I'll be checking that out.
     
  12. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,620
    Location:
    Illinois, USA
    According to JFD the bug is still alive and well
     
  13. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    301
    Something appears to have changed with art. I have a build of a mod that adds religious buildings working, and it was adding in my custom models graphically fine. Now, they don't appear on the map. Weird.
     
  14. greyTiger

    greyTiger Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    198
    Location:
    Australia
    Wonderful. Was really eager to see that addressed. Don't want to really create a district from scratch for my Mongols but to resolve this issue I just may have to :(
     
  15. ReichAdler

    ReichAdler Chieftain

    Joined:
    Nov 4, 2016
    Messages:
    83
    Gender:
    Male
    I see we have lost all the player items on the civ selections screens, well just for custom civs.

    Does anyone know the image size of the default game loading screen (brown world map) that sits behind the leader once the civ has been selected & you are starting the game. I am sick of every patch messing up my start screen images in a new way.
     
  16. hangman

    hangman almost-scientist

    Joined:
    Dec 31, 2010
    Messages:
    765
    Location:
    Best Louisiana
    I actually saw this exact behavior quite often on my maps in Civ 5. I assume it's because the viable starting positions are very heavily limited on most of them. I haven't dived into the LUA (I just forced them to start elsewhere with semi-random starting positions :p), but I wonder if it's a similar issue.
     
  17. ITcore

    ITcore Chieftain

    Joined:
    Dec 25, 2016
    Messages:
    240
    Gender:
    Male
    There seems to have been some issues with the new fallback code that Firaxis put in the AssignStartingPositions.lua. There are a couple of fixes already put up so I'd say it's safe to say that it's solved for now until Firaxis pushes out their fixed code.
     
  18. TheMarshmallowBear

    TheMarshmallowBear Benelovent Chieftain of the BearKingdom

    Joined:
    Dec 27, 2006
    Messages:
    6,966
    Location:
    Inside an Ikanda.
    Not sure if mentioned, well, no.

    But it seems they have cleared the GameEffects.xml, it now contains nothing, this is where all the effects, collections and requirements are listed, thankfully you can see see those using a SQLiteStudio.
     
  19. Laurana Kanan

    Laurana Kanan Queen's

    Joined:
    Apr 10, 2014
    Messages:
    1,098
    Gender:
    Female
    Location:
    Near the Greatest Snow on Earth
    TheMarshmallowBear likes this.
  20. Magil

    Magil Monarch

    Joined:
    Sep 26, 2010
    Messages:
    1,598
    I've noticed this too with my own mod--need to track down the issue. Not much talk about it so clearly I'm doing something wrong.
     

Share This Page

Ebates: Get Paid to Shop