Sukritact's Events and Decisions

To clarify, the recent gameplay mods I've released on Steam have no compatibility issues with E&D. Chrisy was referring specifically to Rise to Power, which in general I would advise against using and don't support atm because of incompatibilities like this.
 
To clarify, the recent gameplay mods I've released on Steam have no compatibility issues with E&D. Chrisy was referring specifically to Rise to Power, which in general I would advise against using and don't support atm because of incompatibilities like this.

Thanks for the reply JFD! Would you happen to know anything about the bug I encountered? It's frustrating to see the pop-ups come up when I have the gold, culture and faith to enact a certain decision, only to be unable to select it in the decisions panel. Also, events don't seem to be happening anymore either. I really appreciate Chrisy's and your help!
 
Spoiler :
I did as your link asked and found this error message, repeating several times as E&D loads. Copying them all here for good measure:
[19059.375] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua:402: attempt to call method 'BuildInstance' (a nil value)
[19079.015] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua:402: attempt to call method 'BuildInstance' (a nil value)
[19082.572] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/CityInfoStack.lua:59: attempt to call method 'BuildInstance' (a nil value)
[19085.115] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua:402: attempt to call method 'BuildInstance' (a nil value)
[19085.365] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua:402: attempt to call method 'BuildInstance' (a nil value)
[19095.115] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/CityInfoStack.lua:59: attempt to call method 'BuildInstance' (a nil value)
[19098.047] Runtime Error: C:\Users\Gabriel\Documents\My Games\Sid Meier's Civilization 5\MODS\Sukritact's Events and Decisions (v 3)\Lua/UI/CityInfoStack.lua:59: attempt to call method 'BuildInstance' (a nil value)

I have since found the only instance of "BuildInstance" in the E&D Lua file. Copying the function below:

g_ItemManagers[tInfo[sKey].iKey]:BuildInstance()
local itemInstance = g_ItemManagers[tInfo[sKey].iKey]:GetInstance()

local Pedia = CivilopediaControl and (tEvent.Pedia)
if Pedia then
itemInstance[tInfo[sKey].sButton]:RegisterCallback(Mouse.eRClick, function() getPedia(Pedia) end)

local sPediaTitle = Locale.ConvertTextKey(tEvent.Pedia)
local sHelpPedia = Locale.ConvertTextKey("TXT_KEY_RIGHT_CLICK_NOTE", sPediaTitle)
tEvent.Desc = tEvent.Desc .. sHelpPedia
end

I hope this helps! Thank you for working through this with me.


I don't see how this error can be coming about: the object BuildInstance is being called on can't be nil, because otherwise the error message would reflect that fact; the method can't have been left undefined by InstanceManager.lua because ResetInstances is defined after it in that file, and that method must be working fine for the interpreter to reach this part of the file. The fact that the same method is found to be nil in two different files implies the issue must be with InstanceManager rather than its specific instances themselves, but I don't know why anything would be rewriting InstanceManager.lua nor how this would happen if you have no other mods running. Are there more errors in the log? Do you want to just try Verifying Integrity through Steam?
 
This is likely a compatibility issue with the latest EUI beta: since BuildInstance is never used by Firaxis for any other purpose than a subroutine to GetInstance, it was not included in EUI's optimized instance manager (which overwrites InstanceManager.lua).

In the next EUI version I will add a dummy BuildInstance function (that does nothing) to improve compatibility... In the mean time, you can safely delete line 402 from Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua.

Edit:

Actually with the base game InstanceManager, the mod's BuildInstance call on line 402 of EnactDescisionsPopup.lua defeats the action of its ResetInstances call line 323, so the mod will spam new hidden instances and eventually cause an out of memory crash. If the goal was to make the sure the instances appeared in a predictable order, the mod should be using GenerationalInstanceManager:new instead of InstanceManager:new, but in no case should it use BuildInstance. CityInfoStack.lua and RandomEventsPopup.lua both have the same issue. Proposed fix attached (untested).

Given my analysis this mod needs a fix, I will not be making any change to EUI.
 

Attachments

  • Descisions fixed.zip
    9.1 KB · Views: 236
Last edited:
This is likely a compatibility issue with the latest EUI beta: since BuildInstance is never used by Firaxis for any other purpose than a subroutine to GetInstance, it was not included in EUI's optimized instance manager (which overwrites InstanceManager.lua).

In the next EUI version I will add a dummy BuildInstance function (that does nothing) to improve compatibility... In the mean time, you can safely delete line 402 from Sukritact's Events and Decisions (v 3)\Lua/UI/EnactDescisionsPopup.lua.

Edit:

Actually with the base game InstanceManager, the mod's BuildInstance call on line 402 of EnactDescisionsPopup.lua defeats the action of its ResetInstances call line 323, so the mod will spam new hidden instances and eventually cause an out of memory crash. If the goal was to make the sure the instances appeared in a predictable order, the mod should be using GenerationalInstanceManager:new instead of InstanceManager:new, but in no case should it use BuildInstance. CityInfoStack.lua and RandomEventsPopup.lua both have the same issue. Proposed fix attached (untested).

Given my analysis this mod needs a fix, I will not be making any change to EUI.

I have the same problem with the "Decisions" icon. It does not appear in the upper interface. I have used the "Fix" files and it doesn't work. Any solution?
 
The creator site seems to be dead, but the generator Lua script still exists in the spoiler which will produce the skeleton for your event if executed in an interpretor such as the Lua Demo
 
Top Bottom