Hi Cicero
Most of the lines in the InGame.lua file in the folder UI are exactly the same as the game's InGame.lua, the new, added lines at the end are as follows (in blue):
So it is adding some lua files from these mods, but it has no effect on the game...
Thank you very much for looking into that.
Try the following steps:
1) Delete all copies of SummaryBar.lua and MiniMapPanel.lua from your modspack EXCEPT ONE OF EACH.
2) Place that one remaining copy inside the modspack UI/InGame/ (just for ease of access)
3)
Add
Code:
ContextPtr:LoadNewContext("SummaryLuxuries_SummaryBarHook")
ContextPtr:LoadNewContext("SummaryAntiquities_SummaryBarHook")
ContextPtr:LoadNewContext("SummaryBarbarians_SummaryBarHook")
ContextPtr:LoadNewContext("SummarySpecialists_SummaryBarHook")
immediately after lines
Code:
function LoadAddins()
LuaEvents.SummaryBarAddin.Add(OnSummaryBarAddin)
summaryAddins = {}
inside SummaryBar.lua
and add
Code:
ContextPtr:LoadNewContext("OverlayLuxuries_MiniMapOverlayHook")
ContextPtr:LoadNewContext("OverlayAntiquities_MiniMapOverlayHook")
ContextPtr:LoadNewContext("OverlayCityLimits_MiniMapOverlayHook")
ContextPtr:LoadNewContext("OverlayResources_MiniMapOverlayHook")
ContextPtr:LoadNewContext("OverlayRoadAndRail_MiniMapOverlayHook")
immediately after the lines
Code:
table.insert(overlayGroup, tab)
end
LuaEvents.MiniMapOverlayAddin.Add(OnMiniMapOverlayAddin)
minmapAddins = {}
in MiniMapPanel.lua.
4) Now try your modspack again and see if it works. It still *might* not, because of how whoward coded it, but fingers crossed, it probably will.
5) Just as a favor, if it does work, can you try it again with those lines copied to the END of the file instead? I just want to check something.
EXPLANATION:
In Civ 5, lua files that need to be loaded into a specific part of the game, such as CityView, InGame, or LeaderHeadRoot are handled in a specific manner. By configuring a file in modbuddy when making the mod, you make a .modinfo that includes lines such as the following:
Code:
<EntryPoint type="InGameUIAddin" file="UI/SummaryLuxuries.xml">
<Name>Luxuries Summary</Name>
<Description>
</Description>
</EntryPoint>
This, for instance, makes sure the file InGame.lua "sees" SummaryLuxuries.xml. In fact, this adds both SummaryLuxuries.xml and SummaryLuxuries.lua into InGame.lua, because Civ 5 deliberately ignores the file extension.
When mods are loaded, every single one of these entry points are stored in a special table, where, for example, files with the name "SummaryLuxuries" are associated with the type "InGameUIAddin".
With InGame.lua, this is then retrieved with these lines:
Code:
g_uiAddins = {};
for addin in Modding.GetActivatedModEntryPoints("InGameUIAddin") do
local addinFile = Modding.GetEvaluatedFilePath(addin.ModID, addin.Version, addin.File);
local addinPath = addinFile.EvaluatedPath;
-- Get the absolute path and filename without extension.
local extension = Path.GetExtension(addinPath);
local path = string.sub(addinPath, 1, #addinPath - #extension);
table.insert(g_uiAddins, ContextPtr:LoadNewContext(path));
end
The key operation here being ContextPtr:LoadNewContext(path) .
This ensures that every time InGame.lua is called for any reason, every other mod file assigned to it gets called as well.
However, when mods are being loaded as a fake DLC in the modspack, THIS TABLE NEVER GETS MADE, because of course, civ 5 does not consider the "mods" as loaded. Every single .modinfo file is completely ignored, including all the entry point information. The Modspack maker "fixes" this by including in every mods pack a carbon copy of InGame.lua, CityView.lua and LeaderHeadRoot.lua, and then explicitly stapling to the end every single ContextPtr:LoadNewContext line needed for the mods in the modpack. This is why your InGame.lua has a million ContextPtr:LoadNewContext lines at the end.
HOWEVER, for the whoward Overlay and Summary mods, he does something relatively tricky by mod standard - he creates his own new context! Specifically, he creates new SummaryBarAddIn and MiniMapOverlay contexts, which he then points to with the new:
Code:
EntryPoint type="SummaryBarAddin" file="UI/SummaryLuxuries_SummaryBarHook.lua">
<Name>Summary Bar Luxuries Addin</Name>
<Description>
</Description>
</EntryPoint>
and he processes it the same way InGame.lua does. Unfortunately this means, it has the same problem with the Modspack maker, and because Modspack maker doesn't specifically deal with it, both of these features are broken. By manually introducing ContextPtr:LoadNewContext lines into the relevant lua files, it should fix the problem.
(unfortunately, whoward wasn't kind enough to do all his ContextPtr:LoadNewContext at the END of the file, like the civ 5 people did, so I can't be sure that there's not other things in the file that will glitch out if ContextPtr:LoadNewContext is placed at the end, or because it's not being loaded through the mods menu. It *looks* okay, but I won't know until you test it. The reason I want you to also test having those lines at the end is, if that works, I can consider adding a Summary/Overlay specific adjustment to the modspack so this doesn't have to be done manually again. Otherwise, I'd have to have it search the middle of the .lua file and add it there, and that's just annoying to code.)