[BNW] ShowInPedia for (almost) all primary tables

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,728
Location
Near Portsmouth, UK
Modified BNW CivilopediaScreen.lua file adding support for ShowInPedia column for (almost) all primary tables - Beliefs, Buildings, Builds, Civilizations, Concepts, Eras, FakeFeatures, Features, Improvements, LeagueProjectRewards, LeagueProjects, MinorCivilizations, Policies, PolicyBranchTypes, Projects, Religions, Resolutions, Resources, Routes, Specialists, Technologies, Terrains, UnitPromotions and Units.

To use
  1. Add a UI/Civilopedia folder to your mod
  2. Add the attached CivilopediaScreen.lua file into the folder
  3. Set VFS=true
  4. Using SQL, alter the database table(s) that need a ShowInPedia column, eg "ALTER TABLE Buildings ADD ShowInPedia INTEGER DEFAULT 1;" (It is recommended to place each ALTER TABLE statement in its own .sql file, in case of conflicts with other mods.)
  5. Using XML/SQL set ShowInPedia = 0 for entries not to appear in the 'pedia, eg "<ShowInPedia>0</ShowInPedia>"

Note that the Civilopedia will display exactly what you tell it to, so if you add a prereq tech to a building, but that tech has ShowInPedia=0, there will be no indication that a tech is required to construct it!


Related Post: ShowInTechTree for all tech dependant primary tables and ShowInCityView for Buildings, Resources and Specialists
 

Attachments

So? thats what i need! But...this not work for me.

I do something like that

Add UI/Civilipedia/CivilopediaScreen.lua (also add it InGameUIAddin)
Make it (Import in VFS=true)

Then add in SQL folder a file SIP_Improvements.sql (Update database)
With this content:
-- Insert SQL Rules Here
ALTER TABLE Improvements ADD ShowInPedia INTEGER DEFAULT 1;

Then go in XML
And add to:
Spoiler :
<Row>
<Type>IMPROVEMENT_IRRIGATED_FARM</Type>
<Description>TXT_KEY_IMPROVEMENT_IRRIGATED_FARM</Description>
<Civilopedia>TXT_KEY_CIV5_IMPROVEMENTS_IRRIGATED_FARM_TEXT</Civilopedia>
<Help>TXT_KEY_CIV5_IMPROVEMENTS_IRRIGATED_FARM_HELP</Help>
<ArtDefineTag>ART_DEF_IMPROVEMENT_FARM</ArtDefineTag>
<RequiresFlatlandsOrFreshWater>true</RequiresFlatlandsOrFreshWater>
<FreshWaterMakesValid>true</FreshWaterMakesValid>
<PillageGold>18</PillageGold>
<PortraitIndex>22</PortraitIndex>
<IconAtlas>TERRAIN_ATLAS</IconAtlas>
<ShowInPedia>0</ShowInPedia>
</Row>


But only effect of testing in game - disappeared this improvements at all.
When removing this row (<ShowInPedia>0</ShowInPedia>) - improvement appear and working

What i do wrong?
(I`m novice...)
 
CivilopediaScreen.lua must NOT be InGameUIAddin (it's replacing a core game file so JUST vfs=true)

Your SIP_Improvements.sql file will need an OnModActivated->UpdateDatabase entry
 
Let's come at it from the other direction.

"Not working" isn't terribly helpful. Have you enabled logging and checked database.log? Have you examined the Debug database with a SQLite Browser while the mod is loaded? (Is the ShowInPedia column there? Is it set to 0 for your entry?) Without anything else to go on, I'd suggest checking your VFS settings and file load order.

If none of that makes sense or you can't figure it out, I'd suggest opening a new thread in the main Creation & Customization subforum, attaching your built mod, and posting your database.log.
 
Mod-component work fine. It was a incompatibile with a one of other mod-components (maybe culturePerPops or Specialist Preacher?).

Thank you very much, Whoward and all others.
 
Back
Top Bottom