autolog v1.2
by eotinb
this mod is part of the eotinb mod suite
A mod to facilitate note taking, with succession games in mind. This mod has been approved for GOTM use: see DaveShack asking in this post in the GOTM01 thread and ainwood giving permission here.
UPDATE
Possible solution to some of the path problems people are having: Make sure your path variable is enclosed in double, not single, quotation marks. Like this: "C:\\civ" not this: 'C:\civ'. The reason is that if you use a directory three that includes \Sid Meier's Civilization 4\ python will interpret the apostrophe in Meier's as the end of the path string if you use single quotation marks.
CHANGES IN VERSION 1.2:
Fixed one of the last quirks -- now all tribal village results are known (before some showed as integers rather than what was actually received). For those who are curious, the possible results are: low gold, high gold, map, settler, warrior, scout, worker, experience, healing, tech, weak hostiles, and strong hostiles.
CHANGES IN VERSION 1.1:
New events logged:
Cities acquired and lost through combat and trade
First contact with another civ
More information added to events logged in previous versions:
Combat notes now display the after-combat strength of the victor.
Log now notes when another civ founds a religion (previously just when you founded a religion) and when a religion spreads and either of the following is true: 1. you control the Holy City, or 2. you control the city to which the religion spreads (previously only the second was true).
New features:
Annoying autosave quirk eliminated. If you don't know what this means, don't worry about it -- just be glad that you didn't have to deal with it.
Alt+E messages are now displayed in both the text file and the in-game log.
You can now see changes to the log file while the game is running (although you cannot edit it until the game is shut down or you make a new log file active).
You can now pick the name of the text log on starting a new game or loading a game, or use the default file name of autolog.txt.
There is now an option to have your log notes color-coded for forum posts. See autolog.py's "color" variable.
Alt+E entries are now preceded with a notification that they are custom user entries. The lead-in message can be changed in autolog.py's "prefixTag" variable.
Removed features:
All additions to the in-game event log have been removed. I will soon be coming out with another mod which will replace some of these functions and add more (my notifications mod). Also, Ctrl+E has been disabled.
INSTRUCTIONS:
Unzip file to My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\python\ (or equivalent)
!!!DO NOT OVERWRITE FILES IN GAME DIRECTORY!!! (i.e. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\Python)
The three following files will be added:
CvEventManager.py
CvUtil.py
autolog.py
In order to facilitate combining with other mods that also change CvEventManager.py and/or CvUtil.py, the additions (and two minor changes to the original code) have been noted in these files. Feel free to cut and paste to combine.
SETTINGS:
You can select the default file name for the external text file in autolog.py. Check the directory where you want the file to go. THE DEFAULT DIRECTORY MAY NOT WORK ON YOUR COMPUTER, so check it. Just open autolog.py with any text editor and look for "path = ..." and make sure whatever follows the equal sign is a valid directory. Most problems with this mod have been path problems, so check a couple of things: 1. folders in directory structure are separated with a double backslash, and 2. the last folder in the tree does not end with a backslash. Example: "C:\\games\\civ4" would be correct while "C:\games\civ4\" would not.
If you do not change the file name or rename the previous log, a new log will append to an existing log with the same name. This is so you won't accidentally overwrite your old log(s).
You can select what type of tags (<HTML>, [forum], none) for simple pre-formatting in the "style" variable in autolog.py. Also, you can change whether or not forum-style notes are color-coded in the "color" variable in autolog.py. Changing which events get which color or which colors are used is also possible but is not easy -- you have to be willing to dig into the code. If you want to do this and need some guidance from me, feel free to ask in this thread.
FEATURES:
Alt+E: Custom text log entry (also appears on the screen and in the in-game event log). Alt+E entries are preceded with a notification that they are custom user entries. The lead-in message can be changed in autolog.py's "prefixTag" variable.
Events logged in text file:
City founded, city growth, city border expansion, city acquired/lost, city razed, tech learned/started, unit started/built, building started/built, combat results, Golden Age start/end, Great Person birth, tribal village results, promotions, and religion founding/spread.
All of the text file entries can be turned on or off individually via settings in autolog.py. Also, more detail on each type of event can be found in the same place.
QUIRKS:
If when you found a new city you do not use the default name, the log will still show the default name for the city founded event. All subsequent events for that city will display the name you typed in.
UPCOMING:
Ability to alter what is logged in-game (rather than through editing autolog.py).
Ability to export the actual in-game event log (maybe).
Some co-ordination with screenshots.
CREDITS:
Puppeteer at CFC had the original idea that led to this mod.
HawaiiFive-O, Calanor, and a few others at Apolyton worked out how to use CyInterface.addMessage().
TheDarkside at Apolyton lent moral support.
CivGeek and Tubby Rower at CFC had some great ideas which led to the custom user comment prefix and the color-coding.
Requies at CFC told me where to find all the tribal village results.
Note: This updates and replaces eotinbLog, adding enough additional features that I decided a rename (a less self-promoting rename at that
) was in order. If you use this mod, you can completely erase or overwrite any files that came with eotinbLog.
Here is a sample output (now in color!):
by eotinb
this mod is part of the eotinb mod suite
A mod to facilitate note taking, with succession games in mind. This mod has been approved for GOTM use: see DaveShack asking in this post in the GOTM01 thread and ainwood giving permission here.
UPDATE
Possible solution to some of the path problems people are having: Make sure your path variable is enclosed in double, not single, quotation marks. Like this: "C:\\civ" not this: 'C:\civ'. The reason is that if you use a directory three that includes \Sid Meier's Civilization 4\ python will interpret the apostrophe in Meier's as the end of the path string if you use single quotation marks.
CHANGES IN VERSION 1.2:
Fixed one of the last quirks -- now all tribal village results are known (before some showed as integers rather than what was actually received). For those who are curious, the possible results are: low gold, high gold, map, settler, warrior, scout, worker, experience, healing, tech, weak hostiles, and strong hostiles.
CHANGES IN VERSION 1.1:
New events logged:
Cities acquired and lost through combat and trade
First contact with another civ
More information added to events logged in previous versions:
Combat notes now display the after-combat strength of the victor.
Log now notes when another civ founds a religion (previously just when you founded a religion) and when a religion spreads and either of the following is true: 1. you control the Holy City, or 2. you control the city to which the religion spreads (previously only the second was true).
New features:
Annoying autosave quirk eliminated. If you don't know what this means, don't worry about it -- just be glad that you didn't have to deal with it.
Alt+E messages are now displayed in both the text file and the in-game log.
You can now see changes to the log file while the game is running (although you cannot edit it until the game is shut down or you make a new log file active).
You can now pick the name of the text log on starting a new game or loading a game, or use the default file name of autolog.txt.
There is now an option to have your log notes color-coded for forum posts. See autolog.py's "color" variable.
Alt+E entries are now preceded with a notification that they are custom user entries. The lead-in message can be changed in autolog.py's "prefixTag" variable.
Removed features:
All additions to the in-game event log have been removed. I will soon be coming out with another mod which will replace some of these functions and add more (my notifications mod). Also, Ctrl+E has been disabled.
INSTRUCTIONS:
Unzip file to My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\python\ (or equivalent)
!!!DO NOT OVERWRITE FILES IN GAME DIRECTORY!!! (i.e. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\Python)
The three following files will be added:
CvEventManager.py
CvUtil.py
autolog.py
In order to facilitate combining with other mods that also change CvEventManager.py and/or CvUtil.py, the additions (and two minor changes to the original code) have been noted in these files. Feel free to cut and paste to combine.
SETTINGS:
You can select the default file name for the external text file in autolog.py. Check the directory where you want the file to go. THE DEFAULT DIRECTORY MAY NOT WORK ON YOUR COMPUTER, so check it. Just open autolog.py with any text editor and look for "path = ..." and make sure whatever follows the equal sign is a valid directory. Most problems with this mod have been path problems, so check a couple of things: 1. folders in directory structure are separated with a double backslash, and 2. the last folder in the tree does not end with a backslash. Example: "C:\\games\\civ4" would be correct while "C:\games\civ4\" would not.
If you do not change the file name or rename the previous log, a new log will append to an existing log with the same name. This is so you won't accidentally overwrite your old log(s).
You can select what type of tags (<HTML>, [forum], none) for simple pre-formatting in the "style" variable in autolog.py. Also, you can change whether or not forum-style notes are color-coded in the "color" variable in autolog.py. Changing which events get which color or which colors are used is also possible but is not easy -- you have to be willing to dig into the code. If you want to do this and need some guidance from me, feel free to ask in this thread.
FEATURES:
Alt+E: Custom text log entry (also appears on the screen and in the in-game event log). Alt+E entries are preceded with a notification that they are custom user entries. The lead-in message can be changed in autolog.py's "prefixTag" variable.
Events logged in text file:
City founded, city growth, city border expansion, city acquired/lost, city razed, tech learned/started, unit started/built, building started/built, combat results, Golden Age start/end, Great Person birth, tribal village results, promotions, and religion founding/spread.
All of the text file entries can be turned on or off individually via settings in autolog.py. Also, more detail on each type of event can be found in the same place.
QUIRKS:
If when you found a new city you do not use the default name, the log will still show the default name for the city founded event. All subsequent events for that city will display the name you typed in.
UPCOMING:
Ability to alter what is logged in-game (rather than through editing autolog.py).
Ability to export the actual in-game event log (maybe).
Some co-ordination with screenshots.
CREDITS:
Puppeteer at CFC had the original idea that led to this mod.
HawaiiFive-O, Calanor, and a few others at Apolyton worked out how to use CyInterface.addMessage().
TheDarkside at Apolyton lent moral support.
CivGeek and Tubby Rower at CFC had some great ideas which led to the custom user comment prefix and the color-coding.
Requies at CFC told me where to find all the tribal village results.
Note: This updates and replaces eotinbLog, adding enough additional features that I decided a rename (a less self-promoting rename at that

Here is a sample output (now in color!):
----------------------------New entries----------------------------
Turn 0 (4000 BC)
Rome founded
Rome begins: Warrior
Research begun: Sailing
Turn 1 (3950 BC)
Turn 2 (3900 BC)
Tech learned: Sailing
Tribal village results: technology
Research begun: Bronze Working
User comment: Hut teaches Sailing
Rome's borders expand
Tribal village results: lots of gold
Turn 3 (3850 BC)
Turn 4 (3800 BC)
Rome grows: 2
Turn 5 (3750 BC)
Rome begins: Worker
User comment: Put Warrior on hold while I build a Worker
Buddhism founded in a distant land
Turn 6 (3700 BC)
Turn 7 (3650 BC)
Turn 8 (3600 BC)
Turn 9 (3550 BC)
Tech learned: Bronze Working
Turn 10 (3500 BC)
Research begun: Mysticism
Tech learned: Hunting
Tribal village results: technology
User comment: More techs from huts -- Hunting this time
Turn 11 (3450 BC)
Turn 12 (3400 BC)
Tech learned: Mysticism
Rome finishes: Worker
Turn 13 (3350 BC)
Research begun: Polytheism
Turn 14 (3300 BC)
Turn 15 (3250 BC)
Rome finishes: Warrior
Turn 16 (3200 BC)
Rome begins: Settler
Turn 17 (3150 BC)
Turn 18 (3100 BC)
Hinduism founded in Rome
Hinduism has spread: Rome
Tech learned: Polytheism
Turn 19 (3050 BC)
Research begun: Agriculture
Rome's borders expand
Turn 20 (3000 BC)
Turn 21 (2950 BC)
Rome finishes: Settler
Turn 22 (2900 BC)
Rome begins: Stonehenge
Tech learned: Agriculture
Turn 23 (2850 BC)
Research begun: Animal Husbandry
Rome grows: 3
Turn 24 (2800 BC)
Settler loses to: Barbarian Lion (2.00/2)
Turn 25 (2750 BC)
Turn 26 (2700 BC)
Turn 27 (2650 BC)
Turn 28 (2600 BC)
Tech learned: Animal Husbandry
Turn 29 (2550 BC)
Research begun: The Wheel
Rome grows: 4
Turn 30 (2500 BC)
Turn 31 (2450 BC)
Turn 32 (2400 BC)
Warrior defeats (2.00/2): Barbarian Lion