• In anticipation of the possible announcement of Civilization 7, we have decided to already create the Civ7 forum. For more info please check the forum here .

Changing GPP in Vanilla Civ4 1.61?

blaisepascal

Chieftain
Joined
Feb 16, 2002
Messages
9
Long time lurker, first time poster...

If I wanted to cheat and change the number of GPP in any city (mine or any of the AI rivals') at any time during the game, how would I go about doing this? IIRC in the WorldBuilder, there isn't any way to change the GPP in the Edit City mode (you can change the money and culture). I've also checked Karl Townsend's "Karls Lovely Guide To Cheating" thread and Starduster's "In-Game Cheats, Modding, & Debugging Using Console Commands" tutorial, and neither had info about changing the GPP points.

Would it involve programming with the SDK? I have the SDK downloaded, with the necessary compilers et al. (I've even successfully made a very small mod to the core dll, which was to change the city plots from a 21-square fat cross to a 25-square square.) But I have very little programming knowledge.

Or would it involve hacking the savegame file? Googling has turned up nothing. (Curiously enough, I've seen no info anywhere about hacking the savegame file in general for Civ4. Why is that?) Without knowing beforehand the format of the savegame file, I don't dare hex edit anything.

Any ideas? I'd appreciate any assistance.


BP


P.S. I do ask that you not reply by (1) asking me why I want to do this, or (2) lecturing me about the evils of cheating. I've ready plenty of posts regarding (2) (like Karl's cheats thread), and I am not interested in reading them again. Thank you.
 
city.setGreatPeopleUnitProgress(unitid, progress)

unitid is 78 for prophet, 79 artist, 80 scientist, 81 merchant, 82 engineer (in vanilla civ). you can also set unitid to something else if you want say a tank
 
I'm assuming that I can call city.setGreatPeopleUnitProgress(unitid, progress) in the Python interpreter console. But I need to define "city" first. Using espartaco's post in the "In-Game Cheats, Modding & Debugging..." thread:

This is very simple if you have the Python code on hand.
Example to give money to player 0 (the human):
in the Python console (invoked with shift-~ as explained before) type:
player = gc.getPlayer(0) [hit ENTER]
player.setGold(5000) [hit ENTER]

I would assume that if I define city in a similar manner, then I can call city.setGreatPeopleUnitProgress(unitid, progress). But what function would I need to set the city to one of my cities? I see a getCity function within the SDK code, but I need to pass a struct called IDInfo. What is IDInfo?

As you can see, I know very little C/C++ and no Python. Any further help would be appreciated.


BP
 
blaisepascal said:
I'm assuming that I can call city.setGreatPeopleUnitProgress(unitid, progress) in the Python interpreter console. But I need to define "city" first. Using espartaco's post in the "In-Game Cheats, Modding & Debugging..." thread:



I would assume that if I define city in a similar manner, then I can call city.setGreatPeopleUnitProgress(unitid, progress). But what function would I need to set the city to one of my cities? I see a getCity function within the SDK code, but I need to pass a struct called IDInfo. What is IDInfo?

As you can see, I know very little C/C++ and no Python. Any further help would be appreciated.


BP


To get the city, find out what plot the city is on. You can do this by holding down shift and mousing over the city. Since you've followed the guide, you should have debugging enabled, so you should get additional info on the plot, including it's X and Y location, in the little info pane on the bottom left.

Then, do this in the python console:

Then, type...

Code:
pCity = CyMap().plot(X, Y).getPlotCity()

..where X and Y are the X and Y plot coordinates that you found.

Then, you can do what you want with the pCity...

Code:
pCity.whatever()
 
The good news is that Gerikes' post did the trick. The bad news is that I found that setGreatPeopleUnitProgress(unitid, progress) isn't doing what I thought it would do. This function apparently changes the probabilities that the next great person will be a certain type. It isn't changing the number of great person points that have been accumulated. For example, in a city where the number of GPP is 247/1000, maybe I want to cheat and change it to 900/1000. How do I do this?


BP
 
Top Bottom