[BNW] ShowInTechTree for all tech dependant primary tables

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,699
Location
Near Portsmouth, UK
Modified BNW TechTree.lua and TechButtonInclude.lua files adding support for ShowInTechTree column for all tech dependant primary tables -Buildings, Eras, Improvements, Processes, Projects, Resources, Routes, Technologies, UnitPromotions and Units.

To use
  1. Add a UI/InGame/TechTree folder to your mod
  2. Add the attached TechTree.lua and TechButtonInclude.lua files into the folder
  3. Set VFS=true for both of them
  4. Using SQL, alter the database table(s) that need a ShowInTechTree column, eg "ALTER TABLE Buildings ADD ShowInTechTree 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 ShowInTechTree = 0 for entries not to appear in the Tech Tree, eg "<ShowInTechTree>0</ShowInTechTree>"

(I haven't tested the effect of not showing an Era in the Tech Tree)



Related Post: ShowInPedia for (almost) all primary tables and ShowInCityView for Buildings, Resources and Specialists
 

Attachments

  • TechTree.zip
    11.3 KB · Views: 120
Option for TechButtonInclude.lua

The code in magenta will exclude yield bonuses (the silver star in the blue circle) from Improvements not buildable by the active player. That is, only an Incan player will see yield bonuses from Terrace Farms

Code:
function ShowInTechTreeLookup(table, key)
	local row = GameInfo[table][key]

	if not(ShowInTechTreeShow(table, row)) then
		return nil
	end

[COLOR="Magenta"]	if (table == "Improvements" and row.SpecificCivRequired) then
		if (GameInfoTypes[row.CivilizationType] ~= Players[Game.GetActivePlayer()]:GetCivilizationType()) then
			return nil
		end
	end[/COLOR]

	return row
end
 
Top Bottom