Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

Candi tooltip lacks information about YieldPerReligion #176

Closed GrantSP closed 10 years ago

GrantSP commented 10 years ago

Looking in the game at the stats for the Candi shows a rogue figure :1 in the stats for this UB but doesn't show the +200 Faith for each religion in the city. The database and the TooltipWriter code have the correct table references to pull this value but for some reason it isn't showing. The table is: Building_YieldChangesPerReligion

The code looks to call this for the value but I can't see why it isn't showing.

GrantSP commented 10 years ago

Found the problem, and the solution but I can't seem to get the lua code to function without bugging out the game.

TW_Init.lua needs to have an elseif line added to use this table in the tooltip generation. Similar to this one:

    elseif lineType == "YieldFromBuildings" then
    return GetYieldInfo{table="Building_BuildingClassYieldChanges", cell="YieldChange", tableExtra="BuildingClasses", cellExtra="BuildingClassType"}

However I can not seem to get the right code set up and it renders the game next to useless.

Going through the tooltips for the buildings shows there are a number of tables that buildings/wonders use that are not reflected in the current tooltips. Someone with a bit more coding skill than me may need to look through this stuff.

GrantSP commented 10 years ago

Looking at bit more into this. We may be better to drop our use of the tooltip code and go with EUI From what I have seen, at least for buildings, it is able to handle all the value changes really well, it has no need of modded TXT_KEYs and it can be added to much more simply than ours.

I have yet to do further testing with units and promotions. Will do so now.

stackpoint commented 10 years ago

I believe the lineType will be "YieldFromReligion" as seen from TW_BuildingStats.sql.

GrantSP commented 10 years ago

That part I could get. It was the return part of the function that threw me.

stackpoint commented 10 years ago

I don't understand the code either. However, even if we use the majority of EUI's tooltip code, we'll still need to write custom code for any custom table/columns/properties we've added in CEP. Which I wouldn't know how to do either.

GrantSP commented 10 years ago

that's the thing though, the InfoTooltipInclude.lua that bc1 uses in EUI is so simple. As far as I can see all he does is set up some local UnitFlags and then list ALL the different variables like this:

OneShotTourism = L"TXT_KEY_MISSION_ONE_SHOT_TOURISM" .. " (%g)",    -- Musician
OneShotTourismPercentOthers = "",

Here The OneShotTourism uses the vanilla TXT_KEY and a % for the value. The OneShotTourismPercentOthers is yet to be defined and it just shows that variable as the label. Nothing gets left off and it is all in one file. Very elegant.

GrantSP commented 10 years ago

Thanks to help from @Thalassicus this is now fixed. He has modified the lua code to have some helpful information about how to set up new tooltips.