Sid Meier's Civilization V

Sid Meier's Civilization V

Components - Civ 6 Beliefs
refpuz 19 May, 2024 @ 8:43am
Bug with Aztec Unique Building in Lua Script
The function defined in the lua script file is having an unintended effect of deleting the Aztec Floating Gardens building after it is constructed by the Aztecs when they have no religion. I confirmed this by only using this mod with IGE and manually giving myself a Floating Gardens, and on next turn it gets removed from the city. The Floating Gardens has a building class ID of 0 in the base game, and in your script initializing both “iDummyID” variables to 0 results in the building in the player's city of TYPE ID 0 changing to TYPE "BELIEF_SACRED_PLACES" or "BELIEF_SACRED_PLACES_DUMMY" as defined in your XML when line 46 resolves to FALSE (i.e. no majority religion in the city).

It goes: INITIALIZE to 0, do logic checks, checks result in FALSE, so dummy variables don't get updated to 1 respectively, and lines 58-59 still run regardless of the variables' values, changing the city's building with ID 0 in the city to types defined in your XML file.

Normally, this is harmless for every civ since there will never be a building class of TYPE ID 0 in their cities, except the Aztecs. I think a potential fix would be to not initialize your dummy variables values as 0, and to rather set them to a higher number that is not used by anything in the base game. I fixed this locally by editing the lua script and initializing the dummy variables to both 9998 respectively, but do not know if this will cause the Sacred places belief to stop functioning altogether.

If this mod was not meant to be used as a standalone, my apologies, but mod was working great with all Civs until I tried to play as Aztecs and noticed my gardens kept getting deleted and narrowed it down to this mod. Otherwise, great mod thanks for your contribution!
Last edited by refpuz; 19 May, 2024 @ 9:03am
< >
Showing 1-4 of 4 comments
refpuz 19 May, 2024 @ 9:53am 
Upon further testing, the only way the Floating Gardens does not get deleted is if you have BOTH beleifs (Sacred Places AND Monastic Isolation), or by changing the initilization value to an ID that isn't used, OR by changing where the
"pCity:SetNumRealBuilding(eSacredPlacesDummy, iDummy)" AND "pCity:SetNumRealBuilding(eMonasticDummy, iDummy2)" are called instead of resolving every time.
Iska and Ismet  [developer] 19 Jul, 2024 @ 6:34pm 
Thanks so much for reporting this, will include an update in the Il Principe version, prob too lazy to fix the standalone
refpuz 22 Jul, 2024 @ 6:53am 
You are welcome. Shame about not updating the standalone, understand why, but I will probably just download your Il Principe version and copy the code to my local standalone lua script. Thanks!
Iska and Ismet  [developer] 25 Jul, 2024 @ 7:38pm 
Hey, so I fixed this in the new update to Il Principe along with the Religious Colonization Belief bug. Issue was actually that local eSacredPlacesDummy = GameInfoTypes["BELIEF_SACRED_PLACES_DUMMY"] should have been local eSacredPlacesDummy = GameInfoTypes["BUILDING_BELIEF_SACRED_PLACES_DUMMY"]. Thanks again for the report <3
< >
Showing 1-4 of 4 comments
Per page: 1530 50