Lua error attempt to index a nil value when trying to modify CQUI production panel and the game flashback Unhandled Exception Error

g1bew

Chieftain
Joined
Nov 7, 2023
Messages
1
I'm trying to make "harmony in diversty v1.38"(id=2465378070) and "CQUI - Community Quick User Interface"(id=2115302648) compatible. When starting a game with both CQUI-Lite and HiD, the game loads at least, but some key functionality is broken. The most obvious thing (which prevents from exploring further): When you click on a city banner that city is selected as normal, but clicking the gear in the city banner doesn't work. Clicking the big gear in the bottom-right DOES bring up the production panel, but there are no faith/gold purchase prices shown for items. The spaces for those numbers are there in the UI, but blank (and oddly enabled even without sufficient faith/gold). Due to the gear in the city banner not working, once you've selected something to produce, there's no way to get back to production panel for the city until it requires a new production selection.
I managed to located the module conflict on two files, "DL_productionpanel.lua" in "harmony in diversty" and "productionpanel_CQUI.lua" in "CQUI", and i use productionpanel_CQUI.lua instead of the vanilla version as DL_productionpanel.lua's base file so that Hid could make additional changes. This time clicking the big gear in the bottom-right causes the game to stutter and quit with errmsg
Code:
Unhandled Exception
Code:  EXCEPTION_ACCESS_VIOLATION
Error writing address 0x0
Call Stack
-----------------------------------------------------
??? ! ???   ???, line 0
CQUI's production list interface contains xml and lua files and I double-checked Modding.log to make sure they are successfully imported. But there's a bug in the program at this sentence when CQUI tries to initialize and register a button defined by its xml file.
Code:
Controls.CQUI_ShowManagerButton:RegisterCallback(Mouse.eLClick, CQUI_ToggleManager);

XML:
                <!-- Blue Window Header -->
                <Grid Anchor="R,T" Size="parent+16,59" Style="HeaderBannerRight">
                    <Button ID="CQUI_ShowManagerButton" Offset="0,2" Anchor="L,T" Size="44,44" Texture="LaunchBar_Hook_ButtonMedium" Style="ButtonNormalText" ToolTip="LOC_PRODUCTION_PANEL_MULTI_QUEUE">
                        <Image Offset="0,-1" Texture="Stats32" Size="32,32" Anchor="C,C" Icon="ICON_QUEUE"/>
                    </Button>
                    <Container Anchor="L,T" Size="parent-20,parent-27">
                        <Label ID="HeaderLabel" Anchor="C,T" Offset="10,10" Style="BannerHeaderText" String="LOC_HUD_CHOOSE_PRODUCTION" />
                    </Container>
                    <Image Anchor="R,T" Size="38,30" Texture="Controls_CornerDetail.dds" />
                    <Button ID="CloseButton" Anchor="R,T" Offset="-2,-3" Style="CloseButtonSmall" />
                </Grid>

lua.log errmsg:
Code:
Runtime Error: C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\CQUI for Hid\Assets\UI\Panels\productionpanel_CQUI.lua:655: attempt to index a nil value
stack traceback:
    C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\CQUI for Hid\Assets\UI\Panels\productionpanel_CQUI.lua:655: in function 'Initialize_ProductionPanel_CQUI'
    C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\CQUI for Hid\Assets\UI\Panels\productionpanel_CQUI.lua:662: in function '(main chunk)'
    [C]: in function 'lInclude'
    C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\Harmony in Diversity v1.3.8\UI\Replacement\DL_ProductionPanel.lua:11: in function '(main chunk)'
    [C]: in function '(anonymous)'
Lua callstack:
@C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\Harmony in Diversity v1.3.8\UI\Replacement\DL_ProductionPanel.lua:11
Error loading file where=C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\Harmony in Diversity v1.3.8\UI\Replacement\DL_ProductionPanel.lua:11: , file=C:\Users\26088\Documents\My Games\Sid Meier's Civilization VI\Mods\CQUI for Hid\Assets\UI\Panels\productionpanel_CQUI.lua
ProductionPanel: DL_ProductionPanel Loading productionpanel_CQUI.lua as base file

I suspect that when a mod's lua file is called by another mod its corresponding xml file is not loaded properly. Please help me confirm if my guess is correct, and if so how do I change it?
 

Attachments

  • normal CQUI interface.jpg
    normal CQUI interface.jpg
    470.8 KB · Views: 4
Top Bottom