Need Help with Adding ERA Tech-Information to Civilopedia (CvGameTextMgr.cpp)

Cybah

Emperor
Joined
Jun 22, 2007
Messages
1,481
You probably know the

Code:
	<Era>ERA_XYZ</Era>

entry in CIV4TechInfos.xml.

How can I add this to civilopedia listed under "Special Abilities" like " Will start 'ERA_XYZ' " ?
 
It would possibly be better to change the color of the technology displayed in the Tech Tree based on era.

Gaining ANY tech from an era, starts that era for you. Thus absolutely every tech would claim to start some era, even if the tech before it was the same era. Unless you loop over all technologies twice (nested double loop) so that for each tech you check all possible prereqs and ensure that NONE of them share the same era. Then you can safely say that this is a "gateway" tech which triggers an era.

in CvTechChooser.py look for something like this (Code posted is from Fall Further, we have tweaked this screen a bit, but not too much, so should be the same as yours, just I can't give an accurate line number)

Code:
			if ( gc.getTeam(gc.getPlayer(self.iCivSelected).getTeam()).isHasTech(i) ):
				screen.setPanelColor(szTechRecord, 85, 150, 87)
				self.aiCurrentState.append(CIV_HAS_TECH)
			elif ( gc.getPlayer(self.iCivSelected).getCurrentResearch() == i ):
				screen.setPanelColor(szTechRecord, 104, 158, 165)
				self.aiCurrentState.append(CIV_IS_RESEARCHING)
			elif ( gc.getPlayer(self.iCivSelected).isResearchingTech(i) ):
				screen.setPanelColor(szTechRecord, 104, 158, 165)
				self.aiCurrentState.append(CIV_IS_RESEARCHING)
			elif ( gc.getPlayer(self.iCivSelected).canEverResearch(i) ):
				screen.setPanelColor(szTechRecord, 100, 104, 160)
				self.aiCurrentState.append(CIV_NO_RESEARCH)
			else:
				screen.setPanelColor(szTechRecord, 206, 65, 69)
				self.aiCurrentState.append(CIV_TECH_AVAILABLE)

This says that if you already have a Tech it is Color A (85, 150, 87 - in RBG format), if you are currently researching a tech, it is Color B, if you are planning to research it (clicked a tech with some prereqs, so have a "Study this next" queue going) it is Color C.

After that is where you want to modify, the next bit says that if you are capable of researching the tech to make it Color D. You want to insert an IF hashtable to break up the Eras, or make the numbers used for the color be multiplied by the Era value. The second approach means you don't have to worry about someone using your code who has more eras, or tweaking this code if you add additional eras. But the first one means you select each color yourself so can make it "pretty"

And the last part of the posted code is the red color of a tech you are incapable of researching.


Though another drawback of the color approach is that it doesn't tell you anything extra when you are looking at the "What to research next?" pop up, or choosing from the main display by clicking on the research progress bar.
 
Top Bottom