change to modding from fall patch

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
12,793
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
 

Attachments

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?
 
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.
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
 
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");
 

Attachments

Thanks !

could you quote just the section of code in the scenario's modinfo that refers to those UI files ?
 
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>
 
perfect, thanks.
 
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
 
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.
 
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.
 
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?
According to JFD the bug is still alive and well
 
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.
 
According to JFD the bug is still alive and well

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 :(
 
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.
 
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.

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.
 
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.

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.
 
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.
 
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.

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.
 
Back
Top Bottom