Tech Era Limit

jdog5000

Revolutionary
Joined
Nov 25, 2003
Messages
2,601
Location
California
As requested by Goweigus ...

======== Description =========

The mod component will stop research for all players at a specified era. Using this you can, for example, play up to and then in the medieval era for as long as you want before allowing tech progress to continue.

By default the tech rate is halted in the Medieval era. To change this, open TechLimit\Assets\Python\CvGameUtils.py and change the number on line 147. The changed section is encased in

# <---------- begin tech limit changes ----------------->
# <---------- end tech limit changes ----------------->

as well. When you are ready to allow the game to advance, simply save and quit, edit the file as you like, and the start the game and load your save.

Techs which are disallowed by era will still appear in the tech tree but will be red and cannot be selected. When an AI civ has exhausted all available research avenues they will turn their science slider to 0. On their next turn after the maximum tech era is increased they will immediately switch back to doing research normally.

======== Download =========

Get the mod here.

======== Installation ==========

Unzip the folder into your Program Files/..../BTS/Mods folder so that the Assets folder is located at .../BTS/Mods/TechEraLimit/Assets

======== Merging ============

To merge this component into another mod, simply copy over the two files in this mod's Assets folder. If the other mod has copies of these same files, you will need to merge them. There is one place with changes in CvGameUtils.py as mentioned above, the only change in PythonCallbackDefines.xml is to enable USE_CANNOT_RESEARCH_CALLBACK.
 
Thanks a million man! I am going to install it and try it out right now!
Hopefully my messing with the gamespeed info wont screw with this, i will just paste it into Varietas Del

i will also see if i can just go into a game without it
instead of starting one new with it/.

Update: Turns out it wont work on a map that wasnt started that way, which is fine cause i frequently restart anyway! Thx man!!! woo
 
SSS? are you secrazi gold plunderer? harvesting the gold of jewish orphans working in a WoW sweat shop? :O

j.k. as long as you arent a total bot or something, you better try that mod!
 
:O Cripes, I've considered something like this before, actually having it is VERY cool. You should try expanding it a bit, maybe even make it a possible component of your Revolution Mod. Would make for a very tumultuous and lengthy Medieval Era. ;)

I can't quite figure out how to merge Revolution and Tech Era Limit myself, too. I swear I'm missing something when I read the instructions...
 
When an AI civ has exhausted all available research avenues they will turn their science slider to 0.

I guess it was not programmed in CvGameUtils.py. The human player must switch the slider back to 0 manually. My question is next. How can I disable the Science slider through SDK/Python/XML?
 
You could try turning off <bFlexiblePercent> for research in CIV4CommerceInfo.xml ... I think what will work.

I tried that. It disables the science slider. Instead all commerce becomes not gold, as I expected, but research. The same as 100% Science and 0% Gold, and you can't change it in game.
 
Hello. I don't have BTS and put this MOD in my regular CIV IV MOD folder. I can access the main screen (Tech Era Limit in right corner), setup a custom single player game, and get into the game. As soon as I try to settle my first city, the game locks up. Is this because the MOD is designed for BTS, not the regular Civ IV?

Please let me know. Thx.
 
Okay, thanks. Is there anyway you can modify the MOD so I can use it with Civ IV? If so, can you post it so I can make the changes?

Thx - Vtex
 
Really easy, copy CvGameUtils.py from Civ4 and replace the one in the mod's Python folder. Then, find the function cannotResearch in this file and change it to read:

Code:
	def cannotResearch(self,argsList):
		ePlayer = argsList[0]
		eTech = argsList[1]
		bTrade = argsList[2]
		
		# <---------- begin tech limit changes ----------------->
		# Change the following number to limit eras civs can tech to
		# 0 = Ancient, 1 = Classical, 2 = Medieval, 3 = Renaissance, 4 = Industrial, 5 = Modern, 6 = Future
		iMaxEra = 2
		
		iTechEra = gc.getTechInfo(eTech).getEra()
		
		if( iTechEra > iMaxEra ) :
			# True means cannot research
			return True
		
		# <---------- end tech limit changes ----------------->
		
		return False

Finally, delete the XML folder from the mod. That should do it.
 
Thanks for the post. I followed your instructions and it crashes as soon as I settle my first city. I pasted the info into the CvGameUtils.py and deleted the XML folder.

Do I need to change any of the # signs to 0, 1, 2, 3...etc. to work with the era I want to limit? Or, do I just change the number for the iMaxEra = ?

Thx again. Vtex
 
You would just change the iMaxEra = part.

To figure out why it's crashing, you'll need to enable Python errors and learn a little bit more about modding and Python. Start by setting HidePythonErrors (or something like that) to 0 in CivilizationIV.ini.

Python is very particular about indentation, so the code you (hopefully) inserted inside the cannotResearch function has to be at the proper indentation level (ie, look like above). Many simple text editors don't show you what's a tab and what's a space, you'll need to be sure they're the same type of indentation as the surrounding code.
 
Whenever I try to open up the .py file I get a message that says: Windows cannot open this file. It needs to know what program created it. What do you want to do?
A.Use the Web service to find the appropriate program
B.Select the program from a list


If I click A it brings me to http://shell.windows.com/fileassoc/0409/xml/redir.asp?Ext=py

Any ideas?
 
Whenever I try to open up the .py file I get a message that says: Windows cannot open this file. It needs to know what program created it. What do you want to do?
A.Use the Web service to find the appropriate program
B.Select the program from a list


If I click A it brings me to http://shell.windows.com/fileassoc/0409/xml/redir.asp?Ext=py

Any ideas?

Run a search either "Notepad++" or "IDlE (Python GUI)", you can use either one of those to open the .py file.
 
Hi JDog,
“TechEraLimit” is very a good idea, but… if you want that this is also used by poor modders, you should perhaps to also indicate us how to open a file “py”?! :crazyeye: If not, to facilitate the things to us, you could place directly at our disposal - for example a continuation of files which would gather the Eras by 2 or 3. What do you think about ? :drool:

Separately, I am unable to obtain that the game carries out the maximum number of Turns which I have preset in my Time Victory (I had programmed in “VictoryInfos”: Time_Short=180, T_Medium=360, T_Long=450). :wallbash:
Could you help me please? Or to propose it to us in alternative complement of your system? Thank you!
 
Thanks for information ! That with the very simple air, but I did not know them… Otherwise, I believe to understand that you do not want to answer my second question… Danke trotzdem !!!
 
Top Bottom