Questions from a cIV modding rookie

Snuffs

Chieftain
Joined
Aug 21, 2006
Messages
6
Location
Somewhere in cyberspace
I have 2 questions so far regarding modding cIV. They are probably fairly basic questions that I should be able to figure out myself, but the problem is that I haven't, and even after doing a couple of searches through this forum, I still haven't found any answers.

First: I would like to get into map scripting, but have been frustrated in just about all of my efforts. Basically what I have done so far is minimal editing of the Terra script that comes with the game. I was able to remove all continents besides Eurasia (and probably could have removed Eurasia as well; I just wasn't trying to - I was just trying to isolate one continent which I could work from), and then my successes ended. I started messing with the variables that, judging from their names, looked like they defined the size of the continent. Each time I tested it, I got one of three results:
1. The game crashed.
2. The entire map filled with land (no ocean at all), sometimes with randomized plots, other times with only grassland.
3. Nothing happened. The game generated Eurasia as if I had not changed anything.
I should also mention that even after I completely removed the part of the script that randomizes where Eurasia appears, Eurasia still appeared in a random area. So, basically what I've gotten out of this is that changing stuff in a map script doesn't change anything in-game. This seems to me to be a lesson I should not be learning, and the truth is something else.

The second question is quite a lot simpler: I would like to add techs to a civilization when the game starts. I saw the thread that gave techs based on starting location and other vectors, but I would like to know if there is a way to give techs without digging through the SDK. The answer from the aforementioned thread appeared to be "no," but since that was adjoined to mentions of the dawn of man screen, I wondered if you could still give techs using Python if you didn't care what the dawn of man screen said.

All right, I've asked my questions, now let the newb-bashing begin. :)
 
Snuffs said:
The second question is quite a lot simpler: I would like to add techs to a civilization when the game starts. I saw the thread that gave techs based on starting location and other vectors, but I would like to know if there is a way to give techs without digging through the SDK. The answer from the aforementioned thread appeared to be "no," but since that was adjoined to mentions of the dawn of man screen, I wondered if you could still give techs using Python if you didn't care what the dawn of man screen said.

All right, I've asked my questions, now let the newb-bashing begin. :)

Hello,

I don't know for the first question but for the second you have to modify the CIV4CivilizationInfos XML file. I didn't made it for Tech but it works perfectly for unique units... Unique Techs of each civilizations are described in this file and I think you can add what you want...:)
 
Thanks for your reply, but I'd prefer not to edit the civilization infos so that somebody playing can choose any civ they want and still get the techs. In case I was unclear, I'm not trying to add unique techs, I'm trying to give human players the entire tech tree at the beginning of the game.
 
For your mapscript problem - I haven't done much mapscript work, but have you got python error logging enabled? Sounds like something's going wrong with the python.

For the techs, assuming that there is only one human, in CvEventManager.py in your mod directory:

Code:
def onGameStart(self, argsList):
	pTeam = gc.getTeam(0)
	
	for iTech in range(gc.getNumTechInfos()):
		pTeam.setHasTech(iTech, true, 0, false, false)
Should do the trick.
 
I don't think I had Python error logging enabled, but I'm not sure how I would go about doing that: when I tried flipping values that seemed relevant in the config file, cIV froze when initializing Python.

However, thank you for your help regarding the techs. I had not previously known that techs were handled by teams, not players.

I actually gave your script my own twist, which should theoretically give all techs to all human players:

Code:
def onGameStart(self, argsList):
	for iTeam in range(gc.getMAX_TEAMS()):
		pTeam = gc.getTeam(iTeam)
		if pTeam.isHuman():
			for iTech in range(gc.getNumTechInfos()):
				pTeam.setHasTech(iTech, true, 0, false, false)

Now, I just have to find a way to deal with all the era popups and simultaneously founding every religion... :mischief:
 
In the main .ini file:
Code:
HidePythonExceptions = 0
ShowPythonDebugMsgs = 1
LoggingEnabled = 1
OverwriteLogs = 1
SynchLog = 1
RandLog = 1
MessageLog = 1
 
Back
Top Bottom