Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

Sovereignty Social Policy for Rationalism is broken #303

Open Bloodrocution opened 7 years ago

Bloodrocution commented 7 years ago

So, I know this project seems pretty dead/discontinued from development, but in case there are any individuals besides myself who really enjoy this mod, I am opening a new thread regarding a game-breaking issue I recently discovered (and managed to fix, despite my very limited knowledge and experience with coding).

Anyway, the issue is that the Sovereignty social policy in the Rationalism tree does not function as it should: that is, provide +1 Happiness from all National Wonders; the policy is completely broken and does nothing.

I located the coding for this social policy in the file CEP_End.sql, found at Documents\my games\Sid Meier's Civilization 5\MODS\Communitas Enhanced Gameplay (v 3)\Policies .

I am not sure if the coding for the Sovereignty policy in this file is simply not working as intended (my research of this bug led me to a topic pertaining to the "Yield Library" #179 -- I didn't fully understand it, but it appeared as if this was the source of many of the bugs within the Communitas Expansion, and it wasn't clear from the discussion if they were ever fully resolved or not), or if the coding was wrong altogether. Anyway, to fix the issue, I changed the coding in reference to the Sovereignty policy to the following

INSERT INTO Policy_BuildingClassHappiness (PolicyType, BuildingClassType, Happiness) SELECT DISTINCT 'POLICY_SOVEREIGNTY', BuildingClass, 1 FROM Buildings WHERE BuildingClass IN ( SELECT Type FROM BuildingClasses WHERE (MaxPlayerInstances = 1) AND NOT Type IN ( 'BUILDINGCLASS_PALACE' ) );

The original coding treated Happiness as a yield, just like culture, faith, science, et cetera, but I couldn't find any basis for doing this in the course of my research. In addition to simply studying the existing code of the mod and the game in order to (try to) understand it and discern a fix for the issue, I primarily referenced Civilization Fanatics forum user, LeeS's XML (Advanced) Guide to Adding Buildings and Wonders to Brave New World (so, much thanks to him for that extensive and thorough guide; even though the coding ultimately wasn't in an XML file, I still found his guide most helpful). Thanks, man.

TL;DR

Use the Civ5 Modbuddy software included in the Civ5 SDK to open the file titled CEP_End.sql ( Documents\my games\Sid Meier's Civilization 5\MODS\Communitas Enhanced Gameplay (v 3)\Policies ). Find the block of code that refers to the Sovereignty social policy, and change it to this:

INSERT INTO Policy_BuildingClassHappiness (PolicyType, BuildingClassType, Happiness) SELECT DISTINCT 'POLICY_SOVEREIGNTY', BuildingClass, 1 FROM Buildings WHERE BuildingClass IN ( SELECT Type FROM BuildingClasses WHERE (MaxPlayerInstances = 1) AND NOT Type IN ( 'BUILDINGCLASS_PALACE' ) );

This resolved the issue for me. Hope this helps someone.