View Full Version : [mod] Log changes


Pages : [1] 2

eotinb
Nov 15, 2005, 07:43 PM
autolog v1.2
by eotinb

this mod is part of the eotinb mod suite (http://forums.civfanatics.com/showthread.php?p=3386098#post3386098)

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 (http://forums.civfanatics.com/showpost.php?p=3371160&postcount=71) in the GOTM01 thread and ainwood giving permission here (http://forums.civfanatics.com/showpost.php?p=3373845&postcount=122).

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!):

----------------------------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

Simetrical
Nov 15, 2005, 08:42 PM
I think this will probably be a good thing for people to include as a stock feature of their mods. People who make significant changes with a mod that becomes popular are going to be getting lots of bug reports, and better logs would undoubtedly be helpful in solving them.

eotinb
Nov 15, 2005, 09:19 PM
Not to discourage people from using my mod, but bug reports, etc. can already be viewed by turning on debug, error, etc. logs in the ini file.

Simetrical
Nov 15, 2005, 11:45 PM
Wait, so then what's the advantage of your mod?

eotinb
Nov 16, 2005, 12:52 AM
Certain events now appear in the in-game event log, such as founding a city, etc. There is more detail in the log -- the idea being for SGs, GOTM, or other cases when you want to document what you have done for others (or for your own memory). You can also add your own entries to the log. I eventually want to be able to export the log, hopefully with some formatting options, so that it can be cut'n'pasted right into a forum post.

Methos
Nov 16, 2005, 08:09 AM
Wait, so then what's the advantage of your mod?

For those of us who play SG's this may be a great benefit. Most of us (read SG players) used MS Word in CivIII and just Alt-Tab'ed back and forth to write down turn notes. CivIV seems to have several bugs when Alt-Tab'ing around.

I'll have to check this out, thanks!

Simetrical
Nov 16, 2005, 06:19 PM
Ahh, I get it now.

Tubby Rower
Nov 17, 2005, 10:13 AM
Thanks eotinb. I've been looking for something to export the log. Is there somewhere that the code behind the saved files are.

Since I came in late to [c3c], I never knew how people deciphered it or where it originally come from. But since I'm starting on ground level with [civ4] I'm expecting to write a couple of laziness inspired programs. :)

eotinb
Nov 17, 2005, 04:13 PM
Tubby Rower -- I'm still working on exporting the log. I bought civ3 the day it came out or thereabouts, but then went into a very long hiatus, only recently coming back to the civ community -- the effect being that I have no better idea than you how to look inside the save files.

As an alternative to exporting the log, it wouldn't be too hard to rig up something in Python to duplicate the log to a text file. I haven't done that because I think its inelegant and I hope it won't be too long before I can do it the better way. But I'm thinking I may as well get something working -- I've tried posting screenshots of the log in place of my write-ups but it just doesn't work as well. Some kind of text file that you can go in and edit is a better starting point. I guess I'm saying watch this space, as I may have a new version coming out pretty soon.

BeefontheBone
Nov 17, 2005, 04:43 PM
That is a brilliantly simple idea - very handy for SGs and GOTMs. Presumably though no use for PBEM reports or anything since the game ignores custom assets in multiplayer (although maybe it doesn't, given the OOS reports I get which might be caused by the clock and domestic advisor mods - in which case it should!)

grahamiam
Nov 17, 2005, 07:44 PM
I see the chat log sitting there. maybe there's a way to mod that so that you just type your turnlog in there (no need for chatting in single player), and then cut and past or dump it to a .txt file?

eotinb
Nov 17, 2005, 11:06 PM
For anybody who cares, I've started the process of echoing log entries to a txt file. It works pretty well. So far I can do custom user entries and the following events generate auto-messages: city founded, city growth, tech started/completed, unit started/completed, building started/completed, combat results, city razed, and borders expand. I'm a bit tired of this process at the moment, so tomorrow I'll tackle: promotions, goody hut results, great people born, golden age begin/end, and religion spread (which looks to be the toughest). These may get auto-messages, but right now I'm not planning to do them: city acquired (through trade or conquest), city lost (ditto), first contact with another civ, and war declared/ended. The way the events are set up for those makes them more difficult, and I'm in low-hanging-fruit-gathering mode.

grahamiam, your idea is very good, but I've actually solved the problem of allowing the player to enter a custom log entry that goes to a text file with a keyboard shortcut. The thing that is taking so much time is duplicating all the in-game messages to the txt log file.

eotinb
Nov 18, 2005, 01:03 AM
Ooh! I think this is going to work out very well once I'm finished. Below is a cut and paste from the txt file (simple formatting was done automatically).

4000BC (0): You have learned Mysticism
4000BC (0): You have learned Fishing
4000BC (0): Madrid has been founded
4000BC (0): Madrid has begun building a Warrior
4000BC (0): Research has begun on Meditation
3840BC (4): Madrid's borders have expanded
3720BC (7): Madrid has grown to size 2
3680BC (8): You have learned Meditation
3640BC (9): Research has begun on The Wheel
3640BC (9): Your Warrior has defeated a Barbarian Bear.
3560BC (11): Madrid has finished building a Warrior
3520BC (12): Madrid has begun building a Work Boat
3400BC (15): Madrid has grown to size 3

I'm not terribly fond of the repetition of year/turn. I could make it look something like this (let's call it Option 2):
Turn 0 (4000 BC)
You have learned Mysticism
You have learned Fishing
Madrid has been founded
Madrid has begun building a Warrior
Research has begun on Meditation

Or like this (Option 3):
4000 BC (Turn 0): You have learned Mysticism. You have learned Fishing. Madrid has been founded. Madrid has begun building a Warrior. Research has begun on Meditation.

Any thoughts on how to display the entries? I'm partial to Option 2.

Note: I didn't put in any custom messages, but they work nicely. And I really want to figure out a way to note when you snapped a screenshot and do most of the work for those (you'll still have to edit it to put in the links once you get them hosted, but I could make a tag with everything but the final url).

I should have a new version ready and posted tomorrow.

Tubby Rower
Nov 18, 2005, 06:42 AM
I love you man :cry:

I'll be a beta tester for you. :D

Option 2 is best. The other two are too cumbersome.

deKoven
Nov 18, 2005, 07:29 AM
I'm partial to Option 2 also. Neither of the others gets me going at all. I'm gonna be using this all da time from now. Heh heh heh!

:D

grahamiam
Nov 18, 2005, 07:32 AM
option 2 looks very good :thumbsup:

Civgeek
Nov 18, 2005, 08:24 AM
Excellent work man! Notice you couldn't tear yourself away after midnight. Option #2 definitly looks the best. :goodjob:

Gyathaar
Nov 18, 2005, 08:47 AM
Wrote a simple program for dumping the event log from the save-file that you can use in meantime :)
http://forums.civfanatics.com/showthread.php?t=141769

I didnt include the year in the output thou.. just the turn number :)

Tubby Rower
Nov 18, 2005, 08:57 AM
Check the first post.... It's already uploaded.

eotinb
Nov 18, 2005, 12:27 PM
@Gyathaar: Any chance I could see the source code for that? I'd like to know more about reading CIV save files.

@everyone: Funny story. I got up this morning, and after I read the posts I decided to quickly change the formatting to Option 2 and post the new version (beta, I guess) to let others play around with it until I get everything polished and then grab some breakfast. So I make the changes and start a game intending to play ~15-20 turns. But I got a really nice start so I played a bit more than that (to 50 BC :blush:). When I finally tore myself away from the game, I realized the log didn't look right. It ended up being much trickier than I thought to implement Option 2, but here it is (now well past lunchtime). One note -- the header at the beginning of each turn is printed when the game saves, which has two implications: 1. If you want a header every turn (which I assume you do) you need to have the game autosave every turn -- that's probably wise for SGs anyway; 2. If you save manually (or quicksave, I guess) during a play session, you will get extra turn headers. Hopefully I can fix these problems, but for now they seem like they're not too irksome.

Here is a sample log from a game (not the one that hooked me):

--------------Start of new log entries--------------
Turn 0 (4000BC)
Persepolis has been founded
Persepolis has begun building a Warrior
Research has begun on Animal Husbandry

Turn 1 (3960BC)
You have learned Animal Husbandry
Research has begun on Mining
hut gives AH

Turn 2 (3920BC)
Persepolis's borders have expanded

Turn 3 (3880BC)

Turn 4 (3840BC)

Turn 5 (3800BC)

Turn 6 (3760BC)
hut gives 40 gold

Turn 7 (3720BC)
You have learned Mining
Persepolis has grown to size 2

Turn 8 (3680BC)
Research has begun on Archery

Turn 9 (3640BC)
Your Scout has defeated a Barbarian Lion.

Turn 10 (3600BC)
scout injured to 0.4/1

Turn 11 (3560BC)
scout begins to heal on wooded hill
Persepolis has finished building a Warrior

Turn 12 (3520BC)
Persepolis has begun building a Barracks
warrior guarding persepolis

Note the custom log entries.

Beta of new version attached (I don't intend to change the first post until I get a more complete v2.0). The readme has not been updated, but the install works the same way. Additional notes added to eotinbLog.py. Hotkey for custom log echoes (echoes go to txt file, where entries go to in-game event log) is Alt+E.

Edit: first post updated, so I removed the file here.

Tubby Rower
Nov 18, 2005, 12:42 PM
I'll try it tonight.

Eyemaze
Nov 18, 2005, 12:55 PM
Very cool indeed!

eotinb
Nov 18, 2005, 08:08 PM
New version released (with a rename). See the initial post.

Venom3
Nov 18, 2005, 10:38 PM
ok I may just be stupid. But I put the files where the readme directed and now I get an error message as civ4 boots up... 'failed to load python module cvEventInterface'

any ideas on what I'm doing wrong?

eotinb
Nov 19, 2005, 12:49 AM
You may be stupid, but this error is not evidence of it. :) There are a lot of things that could be causing this problem, but I'm guessing it's a path situation. Did you set the varaible "path" in autolog.py to a valid directory on your computer? (The easiest way to do this IMHO is to navigate to the directory you want to use in Windows Explorer and then select the directory tree from the address bar and copy it to the clipboard with Ctrl+C. Then paste into the correct place and add an extra backslash every place there already is one, so that it looks like "C:\\civ4" instead of "C:\civ4".) If you are absolutely certain that you have entered a correct path, try another directory -- something shorter if the path is pretty long (as the default one is). Let me know if that doesn't fix your problem.

Tubby Rower
Nov 19, 2005, 07:55 AM
I tried it out and suffered a quick lost to egypt (intential) to test this out. I guess it worked but My game's not set up to autosave every turn. Anyone know how to change that?


EDit::: it's still not working. I played another game a little longer and saw that it was autosaving and also I saved it manually a couple of times. It didn't create the log. I'm not sure what I did wrong.

eotinb
Nov 19, 2005, 09:09 AM
Autosave options are in CivilizationIV.ini (in My Documents\My Games\Sid Meier's Civilization 4\). As for why it's not working, did you get the new in-game events? (city growth, for example)? Did Ctrl+E and Alt+E open popups? If not, there was a problem with the install. If so, I suspect a path problem. I just realized that python needs path variables to have two backslashes between directories. The weird thing is my default entry only has single backslashes but still works OK. Try something simple like path = "C:\\" and see if that works. If so, you should be able to make it work with the directory you want to use. If not, let me know and I'll take another look at it.

Zotyesz
Nov 19, 2005, 09:15 AM
Guys, the idea so great! :goodjob:

After I saw it, how simple it is to make things like this, i tried to extend the eotinb's logger with the score.
My last info is that nobody knows exactly how the scoring system works, maybe it could help.

See the attached picture, it shows how game scores and victory scores change.

Diagrams like this can be easily made with the extended logger.
Note that you have to give two text file names: one for the event logger (eotinb's) and one for the score logger.

Hope it helps somebody! :crazyeye:

eotinb
Nov 19, 2005, 09:27 AM
Interesting, Zotyesz. Does this mean you actually got my mod to work? If so, you wil be the first I've heard of.

Zotyesz
Nov 19, 2005, 10:40 AM
Yep, it works fine. I had the same error message the first time, but when I turned on error logging in Docs\My Games\Civilization 4\Civ4 config file, I realized that the path was not okay.
I think it ended with a '\' when I set the path first time. Maybe python didn't like it? :confused: Dunno, but now it works for me. :)
Yeah, checked it. With a '\' at the end it gives the error, must be the problem in most cases! :king:
Eotinb, if you improve your mod, what do you think, score logging can be useful?

Tubby Rower
Nov 19, 2005, 10:47 AM
I'll try this later. I have to go now.

Gyathaar
Nov 19, 2005, 12:30 PM
My last info is that nobody knows exactly how the scoring system works, maybe it could help.

See the attached picture, it shows how game scores and victory scores change.

Actually It isnt hard to figure out how the score system works.. its all in python code in CvGameUtils.py and CvUtil.py

Tubby Rower
Nov 19, 2005, 12:31 PM
I reinstalled civ4 to start clean. I followed instructions above. All of the pop-ups activate and I the file is created, but nothing gets added. One time the 4000BC stuff was added but nothing else.

The fact that it's adding the file tells me that the path is correct and the pop-ups are telling me that it (at least that module) loaded correctly. I'm lost. Not sure what else to do.

Any other ideas?

BeefontheBone
Nov 19, 2005, 12:41 PM
This is (potentially - will test it later) the best thing since sliced bread. My hat is well and truly off to you.

Tubby Rower
Nov 19, 2005, 01:02 PM
I think that it's working now. Apparently checking it while the game is in progress doesn't work. I just re-opened it and there were a ton of turn in there. Thanks a lot for the help :worship: .

Puppeteer
Nov 19, 2005, 01:52 PM
Sweeeeeet! This mod will be handy for anyone who wants to annotate game turns for instruction, bragging, cooperative play or competitive play.

My suggestion was (http://forums.civfanatics.com/showthread.php?t=137055#1):

My idea is for you Python hackers. There is already a game log function in the UI. Perhaps someone can add a turnlog user form UI to the game for QSCs, SGs and turnlog-style storytellers. The game knows what year it is and what events are happening, so just direct the log or portions of the log (techs, religions, new cities, production, new civs met, etc.. standard QSC stuff) to a text, HTML or XML file along with (optional) freeform text input from the user for comments on that turn.

Lucky-special bonus points for:
* Integrating screenshots
* XML-XSLT translation to any or all of: HTML, text, forum vB code, OpenDocument
* Theme-able stylesheets

Here is a screenshot of the log in-game; some of the green entries were typed in by the player (from eotinb's eo2 SG (http://forums.civfanatics.com/showthread.php?t=137765&page=3#59)):

http://i13.photobucket.com/albums/a288/eotinb/eo2/eo1_shot008.jpg

Thanks for credit on the idea, although I'll concede it's an obvious idea for anyone who's played and SG and has an inkling of CivIV's features and programming capability.

eotinb
Nov 19, 2005, 02:05 PM
I think that it's working now. Apparently checking it while the game is in progress doesn't work. I just re-opened it and there were a ton of turn in there. Thanks a lot for the help :worship: .
I guess I should have mentioned that -- I'll change the readme so no one else has the same problem. Sorry you re-installed. :(

Zotyesz
Nov 19, 2005, 03:44 PM
Actually It isnt hard to figure out how the score system works.. its all in python code in CvGameUtils.py and CvUtil.py

I saw the python code, but I was not able to tell that only population counts! If you knew, I raise my hat to you. :goodjob:

This chart shows it, I was a bit surprised. :eek:
(How can I include a pic in the message body?:blush:)

Civgeek
Nov 19, 2005, 03:50 PM
I installed and ran this afternoon; works fine (great in fact!). Only thing I had to do was verify the directory was accurate. Great work! :goodjob: :goodjob:

Gyathaar
Nov 19, 2005, 04:12 PM
I saw the python code, but I was not able to tell that only population counts! If you knew, I raise my hat to you. :goodjob:

This is mainly because population has a score modifier of 5000, land and tech just has 2000, and wonders just 1000.

This means that if you have max pop, max land, all techs (or enough furure techs to make up for the loss of the ones you lack from earlier ages), and all the wonders.. you can have a total of 10000 score (without the victory bonus), and half of this is from population..

However, it is much to early get a large fraction of the max score from population than for the other parts.. for a game that makes it into modern/future ages the tech part will take a good size of the score too. (ancient ages techs are worth 1 points each, classical ages ones 2 points, up to 6 points each for modern and 7 points for future techs.. up to a total of 300 points)

You also only get score for land tiles (water ones dont count), so that makes land score harder to get too.

For victory bonus, the pop part get an extra boost too because initial population is counted as 1, and initial land is counted as 21, so the ratio between max pop and initial pop much higher than max land/initial land.. and shews the calculation even further for population

All this assumes that the default values has not been modded ofcourse.

Zotyesz
Nov 19, 2005, 04:33 PM
For victory bonus, the pop part get an extra boost too because initial population is counted as 1, and initial land is counted as 21, so the ratio between max pop and initial pop much higher than max land/initial land.. and shews the calculation even further for population

All this assumes that the default values has not been modded ofcourse.
Gyathaar, I raise my hat to you. :goodjob:
There is only one thing I missed: I thought inital population is 0, such as initial land. :(
Are the score components (land, pop etc.) stored in the savegame separately too, or the sum only?
I ask it because it would be interesting to see player comparisons in the GOTM's.

Venom3
Nov 19, 2005, 05:40 PM
I've got it working and I would just like to say thank you for this extremely useful mod.

I've got some fiddling to do with the settings yet, but it works 100% for me.

I know alot of the guys at the Apolyton university were looking for a program to allow them to take notes while in game and the silent log entry feature you have here is perfect for that.

I hope you dont mind but I've taken the liberty of linking them to your mod :)

so thanks again for the extremely useful addition and I wish you the best with it

eotinb
Nov 19, 2005, 06:15 PM
@Venom3: I don't mind at all. I posted the initial version of this mod over at Apolyton, but I don't frequent those boards, so I haven't updated with the newest version. Thanks for doing my dirty work for me. :)

Methos
Nov 20, 2005, 02:39 AM
Decided to upload the latest version and have adjusted the path for the text file. I'm about to play my turnset for LK108 so we'll see how it works out.

Methos
Nov 20, 2005, 04:05 AM
Okay, gave it a shot and this is how it turned out:

Delhi finishes: National Epic
Bombay finishes: Hindu Missionary
Toledo grows: 2
Hinduism has spread: Karakorum (Mongolian Empire)

Delhi begins: Aqueduct
Bombay begins: Hindu Missionary
Bombay has tons of health and happiness yet growth is stagnant. Set to grow.
Turn 251 (1155 AD)
Send the missionary to Seville.
Calcutta finishes: Maceman
Karachi grows: 2

Turn 252 (1160 AD)
Calcutta begins: Maceman
Adjust Calcutta so that it can grow into its health.
Maceman promoted: Combat I
Maceman promoted: Shock
Madras finishes: Hindu Missionary

Madras begins: Catapult
Send Hindu missionary to Cardoba
Hinduism has spread: Seville
Tech learned: Engineering
Seville finishes: Jewish Temple

Research begun: Guilds
Decide on Guilds as we badly need more commerce. We're currently running at -26 gpt.
Set science at 90% which gets us -8 gpt.
Turn 254 (1170 AD)
Bombay finishes: Hindu Missionary
Madras finishes: Catapult
Cordoba finishes: Confucian Temple

Bombay begins: Hindu Missionary
Madras begins: Aqueduct
Cordoba begins: Courthouse
Send Hindu missionary to Barcelona
Catapult promoted: Barrage I
Catapult promoted: Accuracy
Hinduism has spread: Cordoba
Bombard Madrid, bringing defenses down from 60% to 33%.
Karachi finishes: Granary
Toledo's borders expand
Toledo finishes: Hindu Temple

Turn 256 (1180 AD)
Karachi begins: Library
Karachi needs some culture bad.
Bombard Madrid, bringing defenses down from 33% to 6%.
Hinduism has spread: Barcelona
Delhi finishes: Aqueduct
Seville grows: 4

Delhi begins: Market
Catapult loses to: Spanish Archer.
Catapult loses to: Spanish Archer.
Catapult defeats: Spanish Archer.
Maceman defeats: Spanish Archer.
Swordsman defeats: Spanish Archer.
Swordsman defeats: Spanish Archer.
Judaism has spread: Madrid
Bombay finishes: Hindu Missionary
Calcutta grows: 7
Lahore finishes: The Colossus
Seville finishes: Lighthouse

Bombay begins: Hindu Missionary
Lahore begins: Market
Seville begins: Harbor
Went with the harbor in Seville as that'll gain us an additional 2 gpt.
Swordsman promoted: City Raider III
Hindu missionary heads towards Madrid.
Madras finishes: Aqueduct
Lahore grows: 9
Karachi's borders expand
Cordoba grows: 2

Madras begins: Hindu Missionary

Turn 260 (1200 AD)
Hinduism has spread: Madrid
Turn 260 (1200 AD)

As you noticed I forgot to save every turn so it sort of runs together. In truth I do not like having to manually save the game every turn just to get the heading. Is there a way to set the autosave to do it every turn rather than every fourth?

Why is it that sometimes there's a space between the heading and the text above and sometimes there's not? I'd prefer the spacing as it's easier to view.

eotinb
Nov 20, 2005, 09:01 AM
Methos, the autosave settings are in My Documents\My Games\Sid Meier's Civilization 4\CivilizationIV.ini.

The extra carraige return is the separation between each turn. I think that the header sometimes appear in the middle of each turn because certain events happen before you can manually save, but as far as I know autosave happens before anything else, so the turns that look right were probably the autosave ones. For now, you can pretty easily edit this log for posting with the knowledge that the blank space is the indicator of turn change, putting in the missing headers and moving the misplaced ones, which would look like:

Turn 250 (1150 AD) [I added this line]
Delhi finishes: National Epic
Bombay finishes: Hindu Missionary
Toledo grows: 2
Hinduism has spread: Karakorum (Mongolian Empire)

Turn 251 (1155 AD) [I moved this line]
Delhi begins: Aqueduct
Bombay begins: Hindu Missionary
Bombay has tons of health and happiness yet growth is stagnant. Set to grow.
Send the missionary to Seville.
Calcutta finishes: Maceman
Karachi grows: 2

Turn 252 (1160 AD) [This line was OK as is]
Calcutta begins: Maceman
Adjust Calcutta so that it can grow into its health.
Maceman promoted: Combat I
Maceman promoted: Shock
Madras finishes: Hindu Missionary

Turn 253 (1165 AD) [I added this line]
Madras begins: Catapult
Send Hindu missionary to Cardoba
Hinduism has spread: Seville
Tech learned: Engineering
Seville finishes: Jewish Temple

And so on...

grahamiam
Nov 20, 2005, 10:10 AM
how are you guys adding your own text to the file? I was hitting ctrl+e to add text, and it would show during the game, but it didn't get added to the text file :(

edit: crap, is it supposed to be alt+e? damnit! :(

eotinb
Nov 20, 2005, 10:12 AM
Ctrl+E adds messages to the in-game log. Alt+E adds them to the text log. They could be combined to one hotkey, but I thought better to start with more flexibility and make a change if one seemed appropriate.

grahamiam
Nov 20, 2005, 10:31 AM
yeah, I think I'm going to mod the mod to show in both :) thanks, it is a great tool! i'm just a moron :D

eotinb
Nov 20, 2005, 10:56 AM
I figured people using this mod might be a good source of ideas for another mod I'm working on that would create in-game notifications of addiitonal events. The idea came from the city growth event in this mod. If this interests you, please check out this thread (http://forums.civfanatics.com/showthread.php?p=3345364#post3345364) and make any suggestions that come to mind.

Shevek
Nov 20, 2005, 02:38 PM
Hi eotinb, great mod.:goodjob:
I got it to work for me by changing the path as suggested.

But I got carried away and also changed the auto save frequency in CivilizationIV.ini.
And now I keep getting the following error message on loading civ: 'Failed to load Python module CvEventInterface'. :confused:

Where did I go wrong? Any idea what I can do??
I have de-installed and re-installed civ, just in case that I inadvertantely scewed up some important file. But the same error message still occures.

Edit: It looks like de-installing civ has not deleted the folders in My Games??

Shevek
Nov 20, 2005, 03:13 PM
OK, no sweat, got it fixed myself.
Just had to manually delete all in My Games folder after de-installing and then re-install again.

Still wonder where I went wrong.

eotinb
Nov 20, 2005, 07:09 PM
Not sure what happened to you Shevek, but I suspect it had to do with editing the ini file for autosaving. It frustrated me that two people (that I know of) have felt the need to re-install to get my mod working. That should not be necessary and I know it can be a pain in the rear, so I'm sorry you did it. :(

The autosave thing is a real pain, so I'm going to look into improving how the headers get created.

Tubby Rower
Nov 21, 2005, 05:08 AM
My re-install was because I didn't follow the directions and switched out the files. I guess the cache was screwing stuff up. I was also installing the time mod in my sig at the same time. It uses a *.py file in the screens sub-directory and I was trying to get them both working at the same time.

It works great. Don't get down on yourself. It'll take a while before the installation directions sink into our thick heads ;) .

I did notice one thing in a Prince level game I was playing over the weekend.... I got a barb pop out of a goodie hut and apparently the logging feature gacked on it. It didn't crash the game just didn't log it and game me an error report. I thank you for this mod. It will save me tons of time :) .

eotinb
Nov 21, 2005, 06:41 AM
I did notice one thing in a Prince level game I was playing over the weekend.... I got a barb pop out of a goodie hut and apparently the logging feature gacked on it. It didn't crash the game just didn't log it and game me an error report. I thank you for this mod. It will save me tons of time :) .
Good to know. I bet I know what happened, so I'll see what I can do.

Civgeek
Nov 21, 2005, 07:07 AM
I used the autologger extensively with little problems this weekend; again nice job. One feature that would be nice however; the ability to change the name of the log file in game. Playing (and logging) a couple of games at once (suc or otherwise), it become a bit tedious to have to keep moving, renaming autolog (or autooog) .txt files or having to open up and edit the .py file. How hard woudl this be to implement?

Tubby Rower
Nov 21, 2005, 07:11 AM
There was a line entered into my text file that says something like

-----------------new log start------------------

or somthing like that. I'd imagine that you would just need a keystoke combination to have a pop-up then type in the new file name. The problem would be that you would have to switch immediately after loading a game....

eotinb, is there a "game loaded" event? if so, you could prompt the user to enter in a file name and have the default file name already entered.

eotinb
Nov 21, 2005, 07:20 AM
There is an onLoad event, and that should allow me to do something in this regard. At least I could put that "new log" divider in during every load. At most, I could have load trigger a popup to ask if you wanted to start a new log or choose to extend an existing log and then let you navigate to it like you do when loading a cIV save game. More likely middle ground is just an edit box where you enter the file name.

eotinb
Nov 21, 2005, 11:50 AM
OK, after a couple of hours of work, I'm almost done with a new version that addresses many issues raised by users. I probably won't post it for a while (one or two things left to work out and I have other obligations at the moment), but here's what is coming:

Stupid header problem is fixed. Now it doesn't matter when/if you save or what your autosave settings are, you get one and only one header every turn.
Ctrl+E and Alt+E both do the same thing, which is put the text entered into the edit box into the in-game log and the text log. (Before, one did one and one did the other).
Now you choose the name of the log file every time you start a new game or load a game. If you do nothing you get the default. If you use a name that already exists, it appends to that file.
You can see updates to the text file without having to quit cIV.
First contact with another civ is noted in the text log.
Combat results display the after-combat strength of the winner (in the form: x.xx/y, where x.xx is current strength and y is base strength)
Text log notes when all religions are founded, not just religions founded by you.

I'm also trying to get declarations of war to log automatically and exploring the possibility of logging trade deals when they are started and ended. Anything else you want me to try to cram into this revision, let me know.

Tubby Rower
Nov 21, 2005, 11:53 AM
#6 is an awesome idea.

EDIT::: I saw gram's message below, and I can help out with some debugging since I'm good at screwing things up... remember that if you make things idiot-proof, they'll find a better idiot ;)

grahamiam
Nov 21, 2005, 11:58 AM
thanks eotinb :) I think most of my problems deal with the equipment that connects the chair to keyboard, not your program. if you want, you can pm me a version and i'll try to see if it's idiot proof tonight.

eotinb
Nov 21, 2005, 12:20 PM
I was going to PM the rough version to the two of you, but I couldn't figure out how to attach a file to PM (if that is even possible). So you'll just have to wait like everyone else. :)

Shevek
Nov 21, 2005, 02:41 PM
Not sure what happened to you Shevek, but I suspect it had to do with editing the ini file for autosaving. It frustrated me that two people (that I know of) have felt the need to re-install to get my mod working. That should not be necessary and I know it can be a pain in the rear, so I'm sorry you did it. :(
...


Don't worry about that re-install thingy.:) It had really more to do with me not understanding how civ works. I think I now figured out that I had only to delete the files in 'My Games'. Civ will restore them with the next game start, right?

Overall I really appreciate all the efford you put into this. It's just great.
I am looking forward to the new version.

Shevek
Nov 21, 2005, 02:42 PM
Sorry, double post.

Civgeek
Nov 21, 2005, 02:44 PM
Another nice option would be to be able to set a default prefix tag to be automatically entered when you Alt-E a comment, so it stands out from the other information. For instance I find I'm always starting my comments "Civgeek - ...." so I can easily see them in the log file. Just a thought.

eotinb
Nov 21, 2005, 02:58 PM
Another nice option would be to be able to set a default prefix tag to be automatically entered when you Alt-E a comment, so it stands out from the other information. For instance I find I'm always starting my comments "Civgeek - ...." so I can easily see them in the log file. Just a thought.
That would be quite easy to do. It could be made optional or not, as well.

Grimshok
Nov 21, 2005, 03:01 PM
Can you have the prefix tag be the user name?

eotinb
Nov 21, 2005, 04:44 PM
Can you have the prefix tag be the user name?
I think I can pull something like that out of the game, but I'm not sure. I can certainly make the tag one of the variables at the beginning of autolog.py so you can make it what you like.

Methos
Nov 21, 2005, 04:45 PM
Like the sounds of the newest version. Looking forward to checking it out. Thanks for all your work!

Tubby Rower
Nov 22, 2005, 06:56 AM
fwiw eot, here is a thread on apolyton that explains some stuff. It also has some events that you might be interested in.

Initial Python Reference (http://apolyton.net/forums/showthread.php?s=&threadid=140611)

AndrewN
Nov 22, 2005, 07:14 AM
What a wonderful mod, thanks eotinb.

I downloaded and unzipped the files, changed the path and it works fine :)

eotinb
Nov 22, 2005, 09:16 AM
fwiw eot, here is a thread on apolyton that explains some stuff. It also has some events that you might be interested in.

Initial Python Reference (http://apolyton.net/forums/showthread.php?s=&threadid=140611)
That was actually posted here as well. It is pretty helpful -- the link to the API has been critical to everything I have done.

eotinb
Nov 22, 2005, 10:09 AM
I thought I would have enough time this morning to polish up the new version, but I don't. So to appease my clamoring fans, I will release the rough version. There is no readme, and no documentation of new features, so caveat downloader. I would recommend backing up the copy that works, as this will overwrite those files. Let me know about any problems. And don't be shy to sing my praises if you like it. :)

Edit: First post updated with cleaned up v1.1. File removed here.

Civgeek
Nov 22, 2005, 12:14 PM
I thought I would have enough time this morning to polish up the new version, but I don't. So to appease my clamoring fans, I will release the rough version.

Used V1.1 over lunch ;) Seems to work fine. One small hiccup, the game seemed to hang briefly on start-up and I didn't get a chance to change the log file name. It came-up over the opening movie; is that right? Anyway, looks fine (here's an example). :goodjob: I think I may edit to make the comment prefix be bold.

----------------------------New entries----------------------------
Turn 130 (375 AD)
Civgeek: Stating new log with V1.1
Thebes finishes: Archer
Elephantine grows: 5
Elephantine finishes: Library
Kyoto finishes: Barracks
Judaism has spread: Kyoto

Turn 131 (400 AD)
Tech learned: Calendar
Civgeek: Cyrus offers Calander plus gold for Currancy (Accept)
Thebes begins: Market
Elephantine begins: Lighthouse
Kyoto begins: Lighthouse
Civgeek: Starting to build Lighthouses now we know Sailing.
Osaka finishes: Jewish Missionary
Alexandria finishes: Library
Kyoto grows: 5

Turn 132 (425 AD)
Osaka begins: Lighthouse
Alexandria begins: Lighthouse
Thebes grows: 9
Memphis finishes: Jewish Missionary
Heliopolis finishes: Granary
Osaka grows: 5
Tokyo grows: 6
Tokyo finishes: Library

Turn 133 (450 AD)
Memphis begins: Market
Tokyo begins: Lighthouse
Heliopolis begins: Barracks
Civgeek: Just another test comment.
Civgeek: Is there a way to turn off the sound when cities grow? It is annoying.
Memphis grows: 7
Giza's borders expand
Christianity founded in a distant land

Turn 134 (475 AD)
Civgeek: Caeser looks weak; no iron. So sad.
Judaism has spread: Tokyo
Judaism has spread: Heliopolis
Civgeek: Convert to Judaism; get some happiness and bonus on building construction.
Tech learned: Monarchy
Alexandria grows: 5
Kyoto finishes: Lighthouse
Christianity has spread: Pi-Ramesses

Tubby Rower
Nov 22, 2005, 12:58 PM
Is the crtl-E pop-up allowed while the diplo screen is up?

is it possible to record the deals made automatically?

eotinb
Nov 22, 2005, 04:10 PM
@Civgeek: I have the movies turned off, so I'm not sure about your experience. If you have trouble, you could always save and reload -- that would trigger the file name event again. I can make the prefix stand out with bold or italics or something.

@Tubby Rower: Alt+E should work in the diplomacy screen -- try and find out. And I'm trying to autolog trade deals but it's going to be tricky.

Civgeek
Nov 23, 2005, 07:21 AM
@Civgeek: I have the movies turned off, so I'm not sure about your experience. If you have trouble, you could always save and reload -- that would trigger the file name event again. I can make the prefix stand out with bold or italics or something.

I took a quick look (I'm not familiar with Python), but couldn't see where the actual text is written to the log file. :( I think it would help the readability of the log file to bold the prefix and add a line return after each user comment.

Tubby Rower
Nov 23, 2005, 08:37 AM
search the cvEventManager for "self.log.write". there's a section of code for each type of event (battles, building completions, etc). This would be useful to automatically add vbCode to these messages to change the color, bold, underline, etc. This could keep them seperate when glancing at them after copying & pasting them into a turnlog on CFC.

ie: Battles are always red and bold, research is always green, etc.

hmm.. I'll be editing mine tonight. eot, if you want me to upload it let me know

eotinb
Nov 23, 2005, 09:06 AM
@Civgeek: Look in autolog.py at the function write(). type = 2 is custom user entries, so this is where you would add bold tags or whatever.

@Tubby Rower: Interesting idea. I think I might do this myself later tonight, and I don't think I'm going to do it the way you describe, so for now there is no need to upload. But let me know how it works out, and maybe show us an example.

@all: This is intended to be a tool to help you keep notes to write logs. I don't think a straight cut and paste from the text file into a forum post is a very good way to go. Of course, use it as you see fit, but what I've done is edit the text file after my turnset to combine the auto notes and my notes, and to add more notes after the fact (here (http://forums.civfanatics.com/showpost.php?p=3358005&postcount=165) is an example of what I mean). I just wanted to say that because I have seen some feedback in at least one SG that this autolog was eliminating the storytelling component, and I'd hate to see that happen.

grahamiam
Nov 23, 2005, 09:19 AM
@eotinb: i've been getting better with my logs :) -> http://forums.civfanatics.com/showpost.php?p=3357605&postcount=61

Tubby Rower
Nov 23, 2005, 09:30 AM
@all: ......I just wanted to say that because I have seen some feedback in at least one SG that this autolog was eliminating the storytelling component, and I'd hate to see that happen.
I think that there is a factor of that in SG's anyway. The story tellers will always tell stories regardless of the tool used (or lack of tool). Some of the civ3 SG's were starting to get the same way. Some people like me aren't too creative with the stories. OTOH, others like soul_warrior, Coinich, jb1964, and a bunch of others have a great amount of creativity with their stories. I could try to make up a story like they do but it would be extremely dull and Thunderfall might run me off ;).

Civgeek
Nov 23, 2005, 09:41 AM
@Civgeek: Look in autolog.py at the function write(). type = 2 is custom user entries, so this is where you would add bold tags or whatever.

Thanks!

@Tubby Rower: Interesting idea. I think I might do this myself later tonight, and I don't think I'm going to do it the way you describe, so for now there is no need to upload. But let me know how it works out, and maybe show us an example.

I really like the idea of color-coding for clarity; makes a lot of sense and for long logs saves a lot of post-session editing.

@all: This is intended to be a tool to help you keep notes to write logs. I don't think a straight cut and paste from the text file into a forum post is a very good way to go. Of course, use it as you see fit, but what I've done is edit the text file after my turnset to combine the auto notes and my notes, and to add more notes after the fact (here (http://forums.civfanatics.com/showpost.php?p=3358005&postcount=165) is an example of what I mean). I just wanted to say that because I have seen some feedback in at least one SG that this autolog was eliminating the storytelling component, and I'd hate to see that happen.

Also agree; story-telling is important, but I usually inlcude mine with the screen shots or in post-session edits. I think autolog actually should encorage more story-telling (by those so inclined) since it saves signiifcant time on the routine event reporting and frees up more time for those creative juices.

eotinb
Nov 23, 2005, 09:51 AM
I'll work on color codes later tonight. Nice log, grahamiam.

Tubby Rower
Nov 23, 2005, 02:32 PM
Here's what I'm trying to do... I'll test it soon and report back. Comment on the colors
contact made - Persians
warrior beats tank
warrior loses to tank
my city finishes library (building)
my city finishes Manhatten Project (project)
my city finishes gunship (unit build)
maceman promoted: combat III
Tribal village results: hostiles
Moses born in my city
Tech learned: Typing
research begun: correct typing
Christianity founded in my city (same for distant land)
Christianity has spread to another city (another civ)
Golden Age begins
Golden Age ends
New York founded
Razed Their City
Our City razed by the Jerks
City's borders expand
City grows to 300
my city begins: Horse Archer

eotinb
Nov 23, 2005, 02:42 PM
Personally, I think too many different colors is more confusing than no colors. Fewer colors also means all the colors you use can be easily readable and distinct enough that if, say, the author of this mod were partially colorblind, he could avoid using colors he has trouble telling apart. I'm thinking something like:

1 for combat (wins, losses, promotions, war [if I can get this to work])
1 for builds (units, buildings, projects)
1 for city stuff (founded, growth, razed, borders, acquired, lost [last two coming soon!] -- may get combined with previous)
1 for religion (founded, spreads)
1 for technology
1 for everything else (tribal village, golden age, great people -- may get combined with previous)
1 for a new feature, perhaps

That makes 4-6 for current and upcoming features, depending on if I collapse where indicated. And I'm leaving the open spot for diplomacy, if I can get it to work.

Civgeek
Nov 23, 2005, 02:54 PM
Personally, I think too many different colors is more confusing than no colors. Fewer colors also means all the colors you use can be easily readable and distinct enough that if, say, the author of this mod were partially colorblind, he could avoid using colors he has trouble telling apart. I'm thinking something like:

1 for combat (wins, losses, promotions, war [if I can get this to work])
1 for builds (units, buildings, projects)
1 for city stuff (founded, growth, razed, borders, acquired, lost [last two coming soon!] -- may get combined with previous)
1 for religion (founded, spreads)
1 for technology
1 for everything else (tribal village, golden age, great people -- may get combined with previous)
1 for a new feature, perhaps

That makes 4-6 for current and upcoming features, depending on if I collapse where indicated. And I'm leaving the open spot for diplomacy, if I can get it to work.


I like this color scheme (without bolds or underlines (would still like to see the prefix in bold). Perhaps add Golden Age/Great People in yellow

Methos
Nov 23, 2005, 03:45 PM
I like the color indications too, especially with only a few colors. I agree that with too many colors it becomes too confusing. With just a few colors you can easily look for specific information throughout the log.

With [civ4] I think I need to take the time to learn Python, or how to mess with stuff. :hmm:

eotinb
Nov 23, 2005, 04:22 PM
@Civgeek: I'm still planning to set off custom entries somehow -- probably bold.

@Methos: If you know anything at all about programming, I think you'll find Python pretty easy to use. Prior to fooling around with Python for a project at work, I had taken one C class many years ago in college and fooled around with Java once for about a month -- hardly a coding fool. It helps that the documentation is really good.

Edit: One more thing about Python. I've tried to make my mod relatively end-user friendly. Although I probably could have used more comments, I did make sure to mark the parts I added so that they would clearly stand out. As a result, it should be very easy to open up any of the files in this mod and see what I coded, and from that it's not too much farther to figure out how I did what I did. I'm happy to answer any Python questions (to my limited ability) and explain anything I did in this mod to someone trying to puzzle through on their own.

StanNP
Nov 23, 2005, 05:05 PM
Ok, stupid question :rolleyes: and I'm at work so I can't check this easily.

Does the \\CustomAssets\Python directory exist when the game is installed or do you need to create it? I'm pretty sure I created it (likely a mistake) and then had problems getting the mod to work.

I would re-word the install directions slightly to be specific about this directory (exists?), plus say something about how files in \\CustomAssets\Python get invoked by game. e.g. CiVIV is smart enough to look for files in \\CustomAssets\Python and use them during the game to replace files with the same name from \\Assets\Python.

BTW, great job on this eotinb, :cool: will same much time doing IVOTM.

StanNP

grahamiam
Nov 23, 2005, 05:15 PM
imho, if you're going to start coloring the text output, then the only "uncolored" text should be the echo that's typed by the player. That way, our thoughts, stories, etc stand-out a little bit :)

again, I have to say, your doing wonderful work here!

Tubby Rower
Nov 23, 2005, 05:21 PM
Ok I have a version that sort of works. The in game log has none of the tags and the text file looks like this (this is before I change the color scheme to eot's version above).

----------------------------New entries----------------------------
Turn 0 (4000 BC)
Tenochtitlan founded
Tenochtitlan begins: Scout
Research begun: Meditation

Turn 1 (3960 BC)

Turn 2 (3920 BC)
Tribal village results: lots of gold

Turn 3 (3880 BC)

Turn 4 (3840 BC)
Tenochtitlan's borders expand

Turn 5 (3800 BC)

Turn 6 (3760 BC)

eotinb
Nov 23, 2005, 05:51 PM
@StanNP: Yes, the Custom Assets folder is created upon install. The rest of what you wrote is exactly correct.

@Tubby Rower: Looking good. Did you make the changes in CvEventManager.py mainly or autolog.py? I don't want you to spend a lot of time on this if I'm just going to redo it my way anyway (which would be to add additional types in autolog.py and then change the CvEventManager.py calls to autolog.write() to match the type).

Tubby Rower
Nov 23, 2005, 06:06 PM
how about...

1 for combat (wins, losses, promotions, war [if I can get this to work])
1 for builds (units, buildings, projects)
1 for city stuff (founded, growth, razed, borders, acquired, lost [last two coming soon!] -- may get combined with previous)
Diplo stuff (first meeting and hopefully trades
1 for religion (founded, spreads)
1 for technology and tribal villages
1 for golden age, great people
Tubby: user created entries


This combines a couple of them. I noticed that there was no diplo color. Also I dropped the brown. Bold & black for custom comments.

Making the final touches and hopefully will be up tonight.

eot, mainly what I'm doing is changing the cvEventManager file. I created a new variable called logmessage (as opposed to message). this way the in game log won't have the tags on it. I'm also thinking of adding a variable up top so that the user can turn it off or on depending on what the use is. Do you want me to PM it to you or just post it here?

grahamiam
Nov 23, 2005, 06:43 PM
that yellow is pretty brutal

how about magenta

or perhaps yellow green, or two up from yellow, olive?

Tubby Rower
Nov 23, 2005, 07:52 PM
OK here is a sample game where I met George Washington and immediately declared. direct copy & paste from log file
Turn 6 (3760 BC)
Tribal village results: experience
Tech learned: Mysticism
Contact made: American Empire

Turn 7 (3720 BC)
Research begun: Polytheism
Warrior promoted: City Raider I
Warrior promoted: City Raider II
Thebes finishes: Warrior

Turn 8 (3680 BC)
Thebes begins: Warrior

Turn 9 (3640 BC)

Turn 10 (3600 BC)
Thebes grows: 2

Turn 11 (3560 BC)
Warrior loses to: American Warrior (0.40/2)

Turn 12 (3520 BC)

Turn 13 (3480 BC)
Thebes finishes: Warrior

Turn 14 (3440 BC)
Thebes begins: Barracks

Turn 15 (3400 BC)
Hinduism founded in a distant land

Turn 16 (3360 BC)

Turn 17 (3320 BC)
Tech learned: Polytheism

Turn 18 (3280 BC)
Research begun: Meditation
Warrior loses to: American Warrior (0.98/2)

Turn 19 (3240 BC)

Turn 20 (3200 BC)
Warrior defeats (0.08/2): American Warrior

Turn 21 (3160 BC)
Warrior promoted: City Raider I

Turn 22 (3120 BC)
Thebes grows: 3

Turn 23 (3080 BC)

Turn 24 (3040 BC)
Thebes's borders expand

Turn 25 (3000 BC)
Buddhism founded in Thebes
Buddhism has spread: Thebes
Tech learned: Meditation

Turn 26 (2960 BC)
Research begun: Hunting


Turn 167 (1070 AD)
Archer loses to: Barbarian Archer (2.64/3)
Archer loses to: Barbarian Archer (1.47/3)
Archer defeats (1.62/3): Barbarian Archer
Archer loses to: Barbarian Warrior (0.72/2)
Thebes begins: Archer
Thebes finishes: Archer
Archer defeats (0.60/3): American Archer

Turn 168 (1080 AD)
Archer promoted: Medic I
Archer promoted: Combat II
Archer promoted: Combat I
Archer loses to: American Archer (0.24/3)

Turn 169 (1090 AD)
Archer loses to: American Archer (0.36/3)

Turn 170 (1100 AD)
Thebes begins: Archer
Thebes finishes: Archer
New York finishes: Worker

Turn 171 (1110 AD)
New York begins: Worker
Archer promoted: Combat I
Tech learned: Currency

Turn 172 (1120 AD)
Research begun: Construction
Islam founded in a distant land
Archer defeats (2.55/3): American Archer

Turn 173 (1130 AD)
Archer promoted: Cover

Turn 174 (1140 AD)
Archer loses to: American Archer (3.00/3)
Thebes begins: Archer
Thebes finishes: Archer
Boston finishes: Worker

Turn 175 (1150 AD)
Boston begins: Worker
Archer loses to: American Archer (1.86/3)
Archer defeats (2.49/3): American Archer
Archer promoted: Combat I
Tech learned: Horseback Riding
Tech learned: Calendar
Philadelphia begins: Archer

Turn 176 (1160 AD)
Archer promoted: City Garrison II

Turn 177 (1170 AD)
Thebes begins: Archer
Thebes finishes: Archer

I personally like the yellow. GA's & great people should stand out.

eotinb
Nov 23, 2005, 08:03 PM
Hmmm. I guess I actually don't care for the colors that much, personally. It's a good idea but I think it ends up being meaningless in that because everything stands out, nothing does. TR, feel free to post what you've got, but I don't think color will make it into my next revision. I may put it in as an optional thing in the future.

Tubby Rower
Nov 23, 2005, 08:15 PM
I'm having trouble getting the custom log entry back in there. I changed a few settings but I'll look at it more tomorrow sometime.

Methos
Nov 24, 2005, 06:45 AM
Several things I need to remember as I’m beginning to run into stupid problems. First off after you download the zip file it’s best to extract it so it can be used.:blush:

Secondly is to change the path of the autolog save file so that the file is created. I forgot to change the \Owner\ to my name.:blush:

After playing my turnset in Math08 and purposely adding things to check out the latest version I came to the realization that I failed to change the path. As in everything was lost.:mad:

After this realization I adjusted the change and went back into the game to attempt to copy down the turnlog file from in-game. Interesting problem came up. After naming the log file Math08 and the came finished loading I could not access the turnlog at all. Ctr-Tab didn’t work, nor did Ctr-E, Alt-E, and the Esc key. In order to exit out of the game I had to click on the button to exit to Main Menu. Reloading the game I than did not rename the file and just used the default autolog. Everything worked fine. I don’t even have to leave the game just exit to the Main Menu and reload the save game and keep the default autolog text file.

I went back and double checked the path to make sure I had the correct one and it was. So what could be causing this problem?:confused:

BeefontheBone
Nov 24, 2005, 07:43 AM
Quick note - don't know if you've noticed, but some of the "City begins" messages are showing up before the corresponding "City finishes" ones - looks to be when they happen on the same turn, i.e. if there's some overflow on construction. Not sure how easy it'd be to get them to appear the other way around, though.

@methos - did you try a different nondefault name, without any numeric characters? seems unlikely but worth a try.

DaveShack
Nov 25, 2005, 12:12 AM
This looks pretty cool, added it to my subscriptions. :D

If I might suggest, as new versions are created please update the first post with a link to the current version. I'm having to scan the thread to find the latest one.

DaveShack
Nov 25, 2005, 01:46 AM
Is the current version v1.1? Also is this compatible with patch 1.09, or a better way to ask would be are there changes in the 1.09 versions of the python files this mod is based on? That might be a hole in the whole modding process, for mods which require manipulation of the existing game files.

A minor bug, because of the way "research begun" events are posted, if you set a list of techs to research, all of the techs in the chain show as beginning research.
Turn 78 (925 BC)
Research begun: Mathematics
Research begun: Drama
Research begun: Music
Kyoto begins: Settler

Tubby Rower
Nov 25, 2005, 08:05 AM
Dave, this is based off of the events that are generated by the game. I've noticed that if you select one tech to research then select another one, they'll both show up. In your instance, it might be good to show them all so that the next in line knows that multiple techs are selected.

And yes v1.1 is the latest revision. If anyone wants to colorized version let me know and I'll send it to them. eot (understandably) wants to keep his code his code. That way if someone has a problem with it then he doesn't have to weed through my code to figure out what's wrong.

Civgeek
Nov 25, 2005, 08:39 AM
Same thing happens if you are indecisive about builds and set a build then change it, then change it back, then change it to something else; each change initiates a log entry for "Starts build". Can be annoying.

Civgeek
Nov 25, 2005, 08:40 AM
If anyone wants to colorized version let me know and I'll send it to them. eot (understandably) wants to keep his code his code. That way if someone has a problem with it then he doesn't have to weed through my code to figure out what's wrong.

I'd like to get a copy, or at least see how you coded it; still learning the ins and outs of the files.

Tubby Rower
Nov 25, 2005, 08:54 AM
Here is the only file that I changed for the color. I think that there might be something wrong with the custom log entry but I'll look at that today. Basically all I did is
- copy the "message = blah blah blah" line and paste it right below it.
- rename the pasted variable to "logmessage"
- added the appropriate vbCode tags
- renumbered the changes to their appropriate numbers (there was some spots called autolog change XX/XX) I think that there are ~ 30 additions in there.
- changed all of the lines like "self.log.write(1, message)" to "self.log.write(1, logmessage)"

That's it. the reason for the additional variable is that some of them were reported on the screen and the vbCode tags were showing up. So I just made a copy that had them for the log

Civgeek
Nov 25, 2005, 09:55 AM
Thanks! I'll take a look tonight.

eotinb
Nov 25, 2005, 10:23 AM
@DaveShack: I haven't gotten around to cleaning up v1.1, which is why I haven't updated the first post. I haven't checked the 1.09 patch Python files, but I've been running v1.1 of my mod with the patch installed and haven't seen any problems. As to the annoyances you and Civgeek mentioned, those are due to the way the events work in the game, and I don't see an easy workaround -- I'm still going for the low-hanging fruit, so any fixes to those problems are in the future.

Bede
Nov 25, 2005, 10:50 AM
@eotinb,

I gotta throw up my hands. autolog will not run at all. Not sure what's happening. Read through the thread and made sure the directory existed but ALT+E or CTRL+T gets nothing.

Any ideas?

Civgeek
Nov 25, 2005, 11:17 AM
As to the annoyances you and Civgeek mentioned, those are due to the way the events work in the game, and I don't see an easy workaround -- I'm still going for the low-hanging fruit, so any fixes to those problems are in the future.

Not really a problem; just requires some post-game edting and clean-up of the log file (which I do anyway to expand on my own in-game comments).

eotinb
Nov 25, 2005, 04:02 PM
Bede, which version are you using? 1.0 is on the first post of this thread, but I also posted a rough version of 1.1 a page or so back. If you are using 1.1, do you get the popup window on game load or game start asking for the fiile name you want to use? I'm guessing not. For either version, is it creating a file in the directory you specified? If Alt+E isn't doing anything, I'm guessing it's not loading at all. Check that the path directory does not end with a backslash ("C:\Bede" is OK but "C:\Bede\" gives some people problems).

If the files are in the right place and there isn't a problem with the path variable, I'm not sure what else could be giving you trouble. If error logging is not turned on (in My Documents\My Games\Sid Meier's Civilization 4\CivilizationIV.ini -- LoggingEnabled = 1) turn it on and see what kind of error messages you get. If it says something along the lines of "Failed to load CvEventManager.py" that usually means there was a path problem. If it says something else, let me know and I'll see if I can decipher it.

Sorry this is giving you so much trouble. I hope you find it worth the effort (assuming you ever get it working).

Bede
Nov 25, 2005, 04:47 PM
@eotinb, I am sure it will be worth the trouble. I will start the debugger and see what messages I get.

i have tried renaming the path with C:\ and C:\\ to no effect.

And I get the same lack of response with either 1.0 or 1.1 and as far as I can tell nothing in the setup instructions changed.

But now that i know where to find the debugger that will help.

Thanks

Methos
Nov 25, 2005, 06:16 PM
@Bede: Are you naming the autolog file at the start of the game? I've found on my computer whenever I name the file other than the default none of the Ctr-E, Alt-E, Ctr-Tab, nor even the Escape key works.

As long as I leave it with the default name it works just fine.

Unfortunately I haven't been able to try the suggestion given me about not adding numerical digits in the name so am unsure if that was causing the problem.

Bede
Nov 25, 2005, 07:14 PM
Don't even get an option to name the file at the start. And the only line I changed in the autolog.py file was the directory path using cut and paste from the adress bar and adding \\ as needed.

eotinb
Nov 25, 2005, 08:50 PM
That's just odd Bede. And what you report does not match with my experience Methos. I had no problem creating and adding to LK108.txt for my most recent turns there.

DaveShack
Nov 25, 2005, 11:20 PM
Bede, that's really strange that it isn't working. I'll take a crack at some diagnostic questions, sorry that some of them seem pretty obvious but you'd be surprised how many obvious questions turn into forehead slaps on the other end. :D

Here's my "path" line from the autolog.py file. Just an offhand question to start with, you don't have any non-printable characters in the directory you want to use, and you've already created the directory, right?


path = "C:\Documents and Settings\david\My Documents\My Games\Sid Meier's Civilization 4\Saves\succession"


Do you have the 3 files installed in the customassets folder off the my documents path? Any non-printable or other strange characters in this path on your system? On my system it is here:


C:\Documents and Settings\david\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets


Also did you make any modifications to the CivilizationIV.ini file? I have no idea what might break it but it's a possibility. Also it will work best if AutoSaveInterval = 1 is specified, but I expect pretty much everyone will have updated that as soon as they found out about it.


BTW my path does not have any double backslashes, just singles.
Also I had Python installed on my system before Civ4. If the others who have it working had Python and you don't that would be an interesting little tidbit.

Bede
Nov 25, 2005, 11:47 PM
@Dave, the only modification I made to the .ini file was to set FullScreen mode to "ask" as I found that worked best for handling screenshots and such. If autolog works I won't have to do that as I can then make an entry followed by the screenshot number. So I will change it back and see what happens.

Thanks for the review as it always helps me to see someone else wrtie it all down in a logical fashion.

Edit: And now it works!!! Interesting to say the least. This has metamorphosed from a trial to a triumph.

DaveShack
Nov 26, 2005, 01:43 AM
For grins I set FullScreen to "ask" and the prompt appeared, so that probably wasn't it. Interesting to say the least, glad to hear it's working now. :)

Tubby Rower
Nov 26, 2005, 07:10 AM
Edit: And now it works!!! Interesting to say the least. This has metamorphosed from a trial to a triumph.
:dance: looks like your a computer nerd after all Bede ;)

eotinb
Nov 26, 2005, 08:44 AM
Glad you got it working Bede. Any idea what the problem was?

Methos
Nov 26, 2005, 09:21 AM
Messing around with the mod and have a few questions/observations.

In the autolog.py file there is several statements that begin with EVENT_LOG_....=0 or 1. Typically 0 equals false and 1 equals true, yet this doesn’t seem to follow along with the way my turnlog came out. So my question is what does the 0 and 1 mean?

Edit: Looking further into the file makes me wonder if the 0, 1, and possibly 2 are actually indications of how the log is shown.

Moved the mod into CustomAssets and renamed the original files to their original names. Checked everything in CivIV and it works great. In fact the mod works better now than it did before. Prior to this I was unable to use anything other than the default autolog.txt file. Now I can individually name them. Surely moving it to the CustomAssets folder wasn’t what was causing the problem? Oh well, its working now.

Tubby Rower
Nov 26, 2005, 11:22 AM
I had some issues with putting it into the main python folder too. I un-installed everything just to make sure and after I re-installed it I placed the mod into Custom Assets and then everything started working.

It shouldn't have mattered but it seemed to. I think that the difference in autolog.py is that one of the groups are for the in-game log and the other is for what is output to the text file... not too sure on this but

eotinb
Nov 26, 2005, 12:24 PM
EVENT_LOG_XXX are for the in-game event log
AUTO_LOG_XXX is for the text log

I never use the event log additions now that I have the text log working the way I want it to. I think I'm going to move the one additional feature out of that suite that I think is useful (the city growth message) to another mod I'm working on.

Methos
Nov 26, 2005, 01:35 PM
<snip> to another mod I'm working on.

:confused: Care to enlighten us on the other mod. Especially if it is as beneficial as this one.:D

eotinb
Nov 26, 2005, 04:03 PM
Notifications. To mimic some of the useful functions of CivAssist II. So far I have gity growth (exactly the way it works here), and a warning when a city is about to grow past its happiness/healthiness limit. A key feature I have yet to fully figure out is new techs/resources on the market. I'm still soliciting ideas here (http://forums.civfanatics.com/showthread.php?t=142212).

StanNP
Nov 28, 2005, 01:13 PM
EVENT_LOG_XXX are for the in-game event log
AUTO_LOG_XXX is for the text log

I never use the event log additions now that I have the text log working the way I want it to. I think I'm going to move the one additional feature out of that suite that I think is useful (the city growth message) to another mod I'm working on.

I've been using 1.1 for the last few nights while playing IVOTM1. The echo into the EVENT_LOG does not seem consistant. Sometimes it works, sometimes it does not. It also is not consistant using alt+e instead of ctrl+e, often one or the other seems to work, sometimes neither.

But I really like it. :cool: Good job!

StanNP

eotinb
Nov 28, 2005, 04:28 PM
Well, Stan, I wonder uf your problems are specific to the GOTM since it is supposed to prevent the use of mods that alter the Python files (which this does).

eotinb
Nov 29, 2005, 08:57 AM
Official version 1.1 now available in first post. For those who have been using the unofficial v1.1, there are a few changes: optional color-coding now implemented, city acquired and lost events now logged, all in-game event log changes removed except Alt+E still shows up there, Ctrl+E does nothing. All changes from v1.0 noted in changelog.

Tubby Rower
Nov 29, 2005, 09:12 AM
eot, I popped a scout from a goodie hut the other day and I got an error. Not sure how to fix it but I thought that I'd let you know.

eotinb
Nov 29, 2005, 10:18 AM
Good to know, although that shouldn't be happening. I'll look into it.

Tubby Rower
Nov 29, 2005, 10:23 AM
I can send you a save tonight

Hyfrydle
Nov 30, 2005, 11:21 AM
Hi when I check my log of a game it seems to need alot of tidting up is this correct?

Here's an example of what I'm getting:

Turn 0 (4000 BC)
User comment: Start location looks quite good for the first city we have a corn resource and plenty of high yield food tiles.
Washington founded
Washington begins: Warrior
User comment: Decide to build warrior as it shouldn't take long for the city to grow and then we can get a worker started to take advantage of the resources.
Tribal village results: technology Mysticism
[color="Green"]Research begun: Hunting
User comment: Decide to research hunting to enable scouts so we can explore.

Turn 1 (3960 BC)
User comment: Move warrior E and uncover a large desert which will slow down city growth in that direction.
User comment: Deserts are good for oil later in the game though.
User comment: City growth in 7 turns and warrior should be ready in14.

Turn 2 (3920 BC)
User comment: Move warrior S uncovering the coast.
User comment: Hunting completes in 3 turns.

Turn 3 (3880 BC)
User comment: Warrior continues S

Any help would be much appreciated.

Looks ok in the forum my mistake it's due to the formatting.

eotinb
Nov 30, 2005, 11:58 AM
That's the forum formatting, Hyfrydle, as you discovered. You can turn it off by setting the "style" variable in autolog.py to 0.

Tubby Rower
Nov 30, 2005, 12:09 PM
eot, My user comments don't show up in the file. Is there a setting in the .ini file that needs to be changed?

JamieCiv4Files
Nov 30, 2005, 01:52 PM
mirrored this at http://civilization4.filefront.com/ for you eotinb :)

Methos
Nov 30, 2005, 02:10 PM
eot, My user comments don't show up in the file. Is there a setting in the .ini file that needs to be changed?

I had a problem with this until I noticed something I was doing. With the custom log entry after you have written your statement don't just hit the enter button. Mouse over the ok and click that instead. I noticed (after the fact) that when you just pressed the enter button the statement didn't show in the log. Basically if the ok isn't highlighted the log won't take it.

To know for sure its in the log after you make your custom entry and press okay your statement will pop up as a text message in the top left, the same as all the other information. Or just Ctrl-Tab and see if its there.

Try mousing over and clicking ok see if that fixes it.

If thats not the problem your having than I just informed everyone how intelligent my, er, problems are! :D

Gwyned
Nov 30, 2005, 02:35 PM
Alright, long time lurker, rare poster. For whatever reasons, I cannot get Civ4 to acknowledge the existence of this mod. I have placed the python files in both \CustomAssets\python and \CustomAssets without any noticeable difference (and yes, off My Documents not over the main game files). I have checked the "path=" parameter several times, making sure that the path is indeed valid and trying with both single backslashes and double backslashes. I even tried turning on the log in civ.ini and sorting through the various error logs, none of which make any mention of the files in question. Basically, the game runs the same regardless of whether I have the mod installed or not, and I can't seem to figure out what I am doing wrong. I have tried all three versions without any difference there either. Any suggestions would be appreciated, and thanks for all your hard work!

BeefontheBone
Nov 30, 2005, 05:16 PM
Regarding the backslashes, the issue seems to be whether you have one at the END of the path (you shouldn't) - I *think* Python will ignore the double slashes before that. Not sure about the rest, haven't actually tried this yet (meant to use it for 4OTM01 but started that when I was a bit high and forgot, which was daft).

EDIT: Did the same to me, but I just remembered I never cleared the cache, which might be it.

eotinb
Nov 30, 2005, 08:20 PM
@Gwyned: Like BeefontheBone said, try clearing the cache. You can do that one of two ways. The easy way is to hold shift during startup (of cIV, not your OS). The other way is to find the cache directory and delete the files. Let me know if that doesn't work.

@Tubby and Methos: I should do something about that so enter = OK. Another problem that I've noticed and I'm not sure I can fix is that if the mouse pointer happens to be hovering over one of the buttons on the popup, hitting space will activate that button, which is really annoying. Hovering over the edit box or anywhere else is OK.

Gwyned
Nov 30, 2005, 09:51 PM
@Gwyned: Like BeefontheBone said, try clearing the cache. You can do that one of two ways. The easy way is to hold shift during startup (of cIV, not your OS). The other way is to find the cache directory and delete the files. Let me know if that doesn't work.


That indeed did the trick. Thanks guys! Also, you might want to include that tip in the readme file, in case others like encounter the same problem. :goodjob:

Tubby Rower
Dec 01, 2005, 05:30 AM
There is a message that pops up that says something like "Debug Event ()" or something like that. I think that I've got it working by turning on logging in the Civ4.ini file but then other stuff doesn't work.

btw, I am using 1.1 instead of my version (actually the combined eot mod). I also got Whomp up and running without ;) reinstalling Civ4 :D.

eotinb
Dec 01, 2005, 07:06 AM
I also got Whomp up and running without ;) reinstalling Civ4 :D.
Finally! Best news I've heard all day (all 30 minutes I've been awake).

Requies
Dec 01, 2005, 09:18 AM
autolog v1.1
by eotinb

QUIRKS:

The type of result you get from a tribal village is handled in the game as an integer. I have figured out some of them through trial and error, but some results are pretty rare and in any case I don't have all of them yet. Right now, if the result is something I don't know the code for, I just report the integer, so you might see "Tribal village result: 4." If documenting goody hut results is important to you, I recommend using a custom log entry (Alt+E) for now. Please pass along any additional codes you figure out (or any corrections to the ones I already have) and I'll make the changes.

From the cIV API website:

-1 = NO_GOODY
0 = GOODY_LOW_GOLD
1 = GOODY_HIGH_GOLD
2 = GOODY_MAP
3 = GOODY_SETTLER
4 = GOODY_WARRIOR
5 = GOODY_SCOUT
6 = GOODY_WORKER
7 = GOODY_EXPERIENCE
8 = GOODY_HEALING
9 = GOODY_TECH
10 = GOODY_BARBARIANS_WEAK
11 = GOODY_BARBARIANS_STRONG

Those should be correct, even if it's not defined properly in Python (like the Specialist info :rolleyes:)

eotinb
Dec 01, 2005, 09:21 AM
From the cIV API website:

-1 = NO_GOODY
0 = GOODY_LOW_GOLD
1 = GOODY_HIGH_GOLD
2 = GOODY_MAP
3 = GOODY_SETTLER
4 = GOODY_WARRIOR
5 = GOODY_SCOUT
6 = GOODY_WORKER
7 = GOODY_EXPERIENCE
8 = GOODY_HEALING
9 = GOODY_TECH
10 = GOODY_BARBARIANS_WEAK
11 = GOODY_BARBARIANS_STRONG

Those should be correct, even if it's not defined properly in Python (like the Specialist info :rolleyes:)
Excellent! Was that at http://civilization4.net/files/modding/PythonAPI/? Because I'm sure I looked there and I never saw this. Anyway, thanks.

Requies
Dec 01, 2005, 09:25 AM
Excellent! Was that at http://civilization4.net/files/modding/PythonAPI/? Because I'm sure I looked there and I never saw this. Anyway, thanks.

Yup. Look in the Lower Left Corner Frame (which holds all the different Types they defined), and click on GoodyTypes.

It's an very useful resource to at least get you an idea of what is what. (help and dir is great for getting DETAILED and up-to-date info, but that site gives you the information at a glance).

Req

Wallabulla
Dec 02, 2005, 08:12 AM
Thanks alot for this great app, gonna be usefull in GOTM games :) :goodjob:

Mysterio10000
Dec 02, 2005, 09:29 AM
Thanks alot for this great app, gonna be usefull in GOTM games :) :goodjob:

Since I've never played a GotM game, I'd be interested in knowing why this mod would be useful for those. Could someone enlighten me? :scan:

Requies
Dec 02, 2005, 09:43 AM
Since I've never played a GotM game, I'd be interested in knowing why this mod would be useful for those. Could someone enlighten me? :scan:

I've never played on either, but I believe they like to keep logs of what happens so that they can compare notes on what each person did, and therefore learn from their mistakes.

I believe this mod was originally meant for SGing, though.

Req

eotinb
Dec 02, 2005, 10:30 AM
Req is exactly right. I played GOTM1 without it thought, as it seemed like it might be disallowed beause any modifications to the Python files give opportunities to cheat. I am not aware of anyone actually using this mod with GOTM1, although several have mentioned something along those lines.

Mysterio10000
Dec 02, 2005, 10:33 AM
I believe this mod was originally meant for SGing, though.

SGing? :confused:

eotinb
Dec 02, 2005, 10:35 AM
SG = Succession Game. A few people take turns playing a single-player game and learn from each other. Check out this thread (http://forums.civfanatics.com/forumdisplay.php?f=168) for plenty of examples

Methos
Dec 02, 2005, 01:36 PM
I am not aware of anyone actually using this mod with GOTM1, although several have mentioned something along those lines.

I used it in GOTM1. IN GOTM games theres whats called a QSC competition. Basically you keep track of everything you do up until 1000 BC and submit your log and your save into the GOTM site. Your QSC game is checked and rated by production, population, #cities, #units, technology, contacts, and possibly a few others I can't remember. There's no awards that are given for best overall QSC score, but it does allow you to see how your beginning game compares to everyone else.

I was once ranked like 2nd in QSC score and ended the game ranked in the 90's or worse.:lol:

BTW, when I say you log everything for your QSC submission, I mean everything. Such as stating:

Scout N, N. Worker moves NW and begins road.
Learn Writing, begin research on Alphabet at 100% science.

See what I mean? With this mod it was very easy for me to keep a log for my QSC submission.

If you're really curious check out the QSC results (http://gotm.civfanatics.net/results/qsc_results.php) page.

For your information, no QSC submissions were being accepted for CivIV GOTM1 according to AlanH.

MeteorPunch
Dec 02, 2005, 03:38 PM
Eotinb: Just started using your latest log and it is great. :goodjob: It's one of the top 2 or 3 mods out right now. I have a little problem though: would your log in any way cause the icons above the city names (religions, top science/gold/production, etc.) to disappear...or was it something I did? :blush:

back when I did QSC, I logged everything including unit movement. Towards the end I was lazier and I just put important stuff like techs, trades, and cities founded. Some people who turned in QSCs hardly put anything on their logs. :spank: My point is that I think eotinb's log is pretty adequate for a QSC log if it includes trades, and of course your thoughts on why you did certain actions.

Methos
Dec 02, 2005, 05:00 PM
I played GOTM1 without it thought, as it seemed like it might be disallowed beause any modifications to the Python files give opportunities to cheat.

DaveShack asked Ainwood (GOTM Staff) if this mod was allowed in the GOTM games and he stated it was. The GOTM game doesn't seem to mind the mod as I already mentioned I am using it in GOTM1.

Venom3
Dec 02, 2005, 07:06 PM
yeah I had checked with Ainwood as well and he gave this mod the ok.

eotinb
Dec 02, 2005, 09:41 PM
Glad you like it MP. As to your question, I can't think of any reason my mod would do that. If, however, you had tried one of the many excellent Domestic Advisor mods out there (I like Requies', linked to in his sig above), or went back to the default from one, that could happen -- it certainly has to me. Just clear the cache (hold shift during startup).

And I'm trying to get trades to work out. At first I thought it was hopeless (really just too difficult to bother with) but I'm doing much of the same work that is required anyway for the notifications mod I'm working on (to replicate many of the useful functions of CivAssistII), so maybe it will make it into a future version.

MeteorPunch
Dec 03, 2005, 06:29 AM
Sorry for the confusion. I just figured out that it was another program causing the problem.

DJMGator13
Dec 03, 2005, 07:04 AM
@eotinb - you may want to indicate in your first post that it is allowed for GOTM use. Confirmed answer, see this post (http://forums.civfanatics.com/showpost.php?p=3373845&postcount=122).

I've seen your notes in LK108 but was waiting to hear if it could be used in GOTM before I installed it.

eotinb
Dec 03, 2005, 11:48 AM
Thanks Gator -- I've made the change.

Also, I went ahead and put in all the tribal village results Req found and updated to the first post to v1.2. Still working on getting trades to work -- I think that's the last major missing piece (other than getting war and peace declarations to work properly).

One more thing: I have found when I use autolog that I get frustrated when selecting city builds from the popup because I can't use Alt+E to explain my reasoning until all the build orders for that turn have been entered, by which point I may have forgotten some of the cities that have new builds. I found a workaround for this by clicking "Examine City" -- from within the city screen you can click on the build and then use Alt+E to state your case before exiting the city screen and going to the next city as usual. Just thought I'd pass that along.

eotinb
Dec 03, 2005, 11:54 AM
Req (or anyone else who might know): know where I can find all the keyboard InputTypes? In CvEventManager.py there are some references to InputTypes.KB_T or whatever. I'm trying to find the InputType for PrintScreen some way other than trial and error (KB_PRTSCN? KB_PRINTSCREEN? etc.). This will allow me to coordinate with screenshots, which I really want to do -- I'm thinking after the screenshot you will get a prompt to input a caption and then there will be an entry in your log with the caption and the beginning of an img tag that you can complete after editing and hosting.

hIdDeN_eViL
Dec 04, 2005, 06:31 AM
in version 1.2, has CvEventManager.py been changed from v1.1

i ask this because i have merged your changes in v1.1 with another mod, and i need to know what has been changed from v1.1 to 1.2, so i don't have to go through copy and pasting all 30 sections.

thx

Requies
Dec 04, 2005, 06:45 AM
Req (or anyone else who might know): know where I can find all the keyboard InputTypes? In CvEventManager.py there are some references to InputTypes.KB_T or whatever. I'm trying to find the InputType for PrintScreen some way other than trial and error (KB_PRTSCN? KB_PRINTSCREEN? etc.). This will allow me to coordinate with screenshots, which I really want to do -- I'm thinking after the screenshot you will get a prompt to input a caption and then there will be an entry in your log with the caption and the beginning of an img tag that you can complete after editing and hosting.

Sorry, eotinb. Didn't see your post until now.

class CvPythonExtensions.InputTypes(Boost.Python.enum)
| Method resolution order:
| CvPythonExtensions.InputTypes
| Boost.Python.enum
| __builtin__.int
| __builtin__.object
|
| Data and other attributes defined here:
|
| KB_0 = CvPythonExtensions.InputTypes.KB_0
|
| KB_1 = CvPythonExtensions.InputTypes.KB_1
|
| KB_2 = CvPythonExtensions.InputTypes.KB_2
|
| KB_3 = CvPythonExtensions.InputTypes.KB_3
|
| KB_4 = CvPythonExtensions.InputTypes.KB_4
|
| KB_5 = CvPythonExtensions.InputTypes.KB_5
|
| KB_6 = CvPythonExtensions.InputTypes.KB_6
|
| KB_7 = CvPythonExtensions.InputTypes.KB_7
|
| KB_8 = CvPythonExtensions.InputTypes.KB_8
|
| KB_9 = CvPythonExtensions.InputTypes.KB_9
|
| KB_A = CvPythonExtensions.InputTypes.KB_A
|
| KB_APOSTROPHE = CvPythonExtensions.InputTypes.KB_APOSTROPHE
|
| KB_AT = CvPythonExtensions.InputTypes.KB_AT
|
| KB_B = CvPythonExtensions.InputTypes.KB_B
|
| KB_BACKSLASH = CvPythonExtensions.InputTypes.KB_BACKSLASH
|
| KB_BACKSPACE = CvPythonExtensions.InputTypes.KB_BACKSPACE
|
| KB_C = CvPythonExtensions.InputTypes.KB_C
|
| KB_CAPSLOCK = CvPythonExtensions.InputTypes.KB_CAPSLOCK
|
| KB_COLON = CvPythonExtensions.InputTypes.KB_COLON
|
| KB_COMMA = CvPythonExtensions.InputTypes.KB_COMMA
|
| KB_D = CvPythonExtensions.InputTypes.KB_D
|
| KB_DELETE = CvPythonExtensions.InputTypes.KB_DELETE
|
| KB_DOWN = CvPythonExtensions.InputTypes.KB_DOWN
|
| KB_E = CvPythonExtensions.InputTypes.KB_E
|
| KB_END = CvPythonExtensions.InputTypes.KB_END
|
| KB_EQUALS = CvPythonExtensions.InputTypes.KB_EQUALS
|
| KB_ESCAPE = CvPythonExtensions.InputTypes.KB_ESCAPE
|
| KB_F = CvPythonExtensions.InputTypes.KB_F
|
| KB_F1 = CvPythonExtensions.InputTypes.KB_F1
|
| KB_F10 = CvPythonExtensions.InputTypes.KB_F10
|
| KB_F11 = CvPythonExtensions.InputTypes.KB_F11
|
| KB_F12 = CvPythonExtensions.InputTypes.KB_F12
|
| KB_F2 = CvPythonExtensions.InputTypes.KB_F2
|
| KB_F3 = CvPythonExtensions.InputTypes.KB_F3
|
| KB_F4 = CvPythonExtensions.InputTypes.KB_F4
|
| KB_F5 = CvPythonExtensions.InputTypes.KB_F5
|
| KB_F6 = CvPythonExtensions.InputTypes.KB_F6
|
| KB_F7 = CvPythonExtensions.InputTypes.KB_F7
|
| KB_F8 = CvPythonExtensions.InputTypes.KB_F8
|
| KB_F9 = CvPythonExtensions.InputTypes.KB_F9
|
| KB_G = CvPythonExtensions.InputTypes.KB_G
|
| KB_GRAVE = CvPythonExtensions.InputTypes.KB_GRAVE
|
| KB_H = CvPythonExtensions.InputTypes.KB_H
|
| KB_HOME = CvPythonExtensions.InputTypes.KB_HOME
|
| KB_I = CvPythonExtensions.InputTypes.KB_I
|
| KB_INSERT = CvPythonExtensions.InputTypes.KB_INSERT
|
| KB_J = CvPythonExtensions.InputTypes.KB_J
|
| KB_K = CvPythonExtensions.InputTypes.KB_K
|
| KB_L = CvPythonExtensions.InputTypes.KB_L
|
| KB_LALT = CvPythonExtensions.InputTypes.KB_LALT
|
| KB_LBRACKET = CvPythonExtensions.InputTypes.KB_LBRACKET
|
| KB_LCONTROL = CvPythonExtensions.InputTypes.KB_LCONTROL
|
| KB_LEFT = CvPythonExtensions.InputTypes.KB_LEFT
|
| KB_LSHIFT = CvPythonExtensions.InputTypes.KB_LSHIFT
|
| KB_M = CvPythonExtensions.InputTypes.KB_M
|
| KB_MINUS = CvPythonExtensions.InputTypes.KB_MINUS
|
| KB_N = CvPythonExtensions.InputTypes.KB_N
|
| KB_NUMLOCK = CvPythonExtensions.InputTypes.KB_NUMLOCK
|
| KB_NUMPAD0 = CvPythonExtensions.InputTypes.KB_NUMPAD0
|
| KB_NUMPAD1 = CvPythonExtensions.InputTypes.KB_NUMPAD1
|
| KB_NUMPAD2 = CvPythonExtensions.InputTypes.KB_NUMPAD2
|
| KB_NUMPAD3 = CvPythonExtensions.InputTypes.KB_NUMPAD3
|
| KB_NUMPAD4 = CvPythonExtensions.InputTypes.KB_NUMPAD4
|
| KB_NUMPAD5 = CvPythonExtensions.InputTypes.KB_NUMPAD5
|
| KB_NUMPAD6 = CvPythonExtensions.InputTypes.KB_NUMPAD6
|
| KB_NUMPAD7 = CvPythonExtensions.InputTypes.KB_NUMPAD7
|
| KB_NUMPAD8 = CvPythonExtensions.InputTypes.KB_NUMPAD8
|
| KB_NUMPAD9 = CvPythonExtensions.InputTypes.KB_NUMPAD9
|
| KB_NUMPADCOMMA = CvPythonExtensions.InputTypes.KB_NUMPADCOMMA
|
| KB_NUMPADENTER = CvPythonExtensions.InputTypes.KB_NUMPADENTER
|
| KB_NUMPADEQUALS = CvPythonExtensions.InputTypes.KB_NUMPADEQUALS
|
| KB_NUMPADMINUS = CvPythonExtensions.InputTypes.KB_NUMPADMINUS
|
| KB_NUMPADPERIOD = CvPythonExtensions.InputTypes.KB_NUMPADPERIOD
|
| KB_NUMPADPLUS = CvPythonExtensions.InputTypes.KB_NUMPADPLUS
|
| KB_NUMPADSLASH = CvPythonExtensions.InputTypes.KB_NUMPADSLASH
|
| KB_NUMPADSTAR = CvPythonExtensions.InputTypes.KB_NUMPADSTAR
|
| KB_O = CvPythonExtensions.InputTypes.KB_O
|
| KB_P = CvPythonExtensions.InputTypes.KB_P
|
| KB_PAUSE = CvPythonExtensions.InputTypes.KB_PAUSE
|
| KB_PERIOD = CvPythonExtensions.InputTypes.KB_PERIOD
|
| KB_PGDN = CvPythonExtensions.InputTypes.KB_PGDN
|
| KB_PGUP = CvPythonExtensions.InputTypes.KB_PGUP
|
| KB_Q = CvPythonExtensions.InputTypes.KB_Q
|
| KB_R = CvPythonExtensions.InputTypes.KB_R
|
| KB_RALT = CvPythonExtensions.InputTypes.KB_RALT
|
| KB_RBRACKET = CvPythonExtensions.InputTypes.KB_RBRACKET
|
| KB_RCONTROL = CvPythonExtensions.InputTypes.KB_RCONTROL
|
| KB_RETURN = CvPythonExtensions.InputTypes.KB_RETURN
|
| KB_RIGHT = CvPythonExtensions.InputTypes.KB_RIGHT
|
| KB_RSHIFT = CvPythonExtensions.InputTypes.KB_RSHIFT
|
| KB_S = CvPythonExtensions.InputTypes.KB_S
|
| KB_SCROLL = CvPythonExtensions.InputTypes.KB_SCROLL
|
| KB_SEMICOLON = CvPythonExtensions.InputTypes.KB_SEMICOLON
|
| KB_SLASH = CvPythonExtensions.InputTypes.KB_SLASH
|
| KB_SPACE = CvPythonExtensions.InputTypes.KB_SPACE
|
| KB_SYSRQ = CvPythonExtensions.InputTypes.KB_SYSRQ
|
| KB_T = CvPythonExtensions.InputTypes.KB_T
|
| KB_TAB = CvPythonExtensions.InputTypes.KB_TAB
|
| KB_U = CvPythonExtensions.InputTypes.KB_U
|
| KB_UNDERLINE = CvPythonExtensions.InputTypes.KB_UNDERLINE
|
| KB_UP = CvPythonExtensions.InputTypes.KB_UP
|
| KB_V = CvPythonExtensions.InputTypes.KB_V
|
| KB_VOLUMEDOWN = CvPythonExtensions.InputTypes.KB_VOLUMEDOWN
|
| KB_VOLUMEUP = CvPythonExtensions.InputTypes.KB_VOLUMEUP
|
| KB_W = CvPythonExtensions.InputTypes.KB_W
|
| KB_X = CvPythonExtensions.InputTypes.KB_X
|
| KB_Y = CvPythonExtensions.InputTypes.KB_Y
|
| KB_Z = CvPythonExtensions.InputTypes.KB_Z
|
| NUM_INPUT_TYPE = CvPythonExtensions.InputTypes.NUM_INPUT_TYPE
|
| __slots__ = ()
|
| values = {1: CvPythonExtensions.InputTypes.KB_ESCAPE, 2: CvPythonExten...

ED: took out unwanted parts.

Req

Requies
Dec 04, 2005, 06:48 AM
BTW, that would be KB_SYSRQ, I think.

There's no actual Print Screen, but on my keyboard at least, SYSRQ and Print Screen occupy the same button.

Req

Requies
Dec 04, 2005, 06:51 AM
in version 1.2, has CvEventManager.py been changed from v1.1

i ask this because i have merged your changes in v1.1 with another mod, and i need to know what has been changed from v1.1 to 1.2, so i don't have to go through copy and pasting all 30 sections.

thx

Hehe, this is why subclassing rules!

Convert, eotinb :mischief:. I know, I know. It's a lot of work. I'll see if I can convert it sometime in-between my DA mod, my upcoming mods, playing cIV, and RL :p.

Req

hIdDeN_eViL
Dec 04, 2005, 07:59 AM
Hehe, this is why subclassing rules!

Convert, eotinb :mischief:. I know, I know. It's a lot of work. I'll see if I can convert it sometime in-between my DA mod, my upcoming mods, playing cIV, and RL :p.

Req

heh? did you accidently quote me, or am i missing something? (probably the latter)

anyway, i thought of another question.

with the logFile variable, would it still work if i change it to "autolog.html"?
opening the log file with notepad isnt real pretty especially with all the color codes. i thought if it were a html file, you could at least admire all the pretty colors when you open it :D.

Requies
Dec 04, 2005, 08:37 AM
heh? did you accidently quote me, or am i missing something? (probably the latter)

anyway, i thought of another question.

with the logFile variable, would it still work if i change it to "autolog.html"?
opening the log file with notepad isnt real pretty especially with all the color codes. i thought if it were a html file, you could at least admire all the pretty colors when you open it :D.

Heh, the reason subclassing is great for this is that when you're working on a mod and trying to get the changes all you would have to do is just copy the file over. You wouldn't have to worry about cut and pasting all the changes in all the files that were modified because subclassing would just create NEW files.

So, for example. Instead of modifying CvEventInterface, eotinb, w/ subclassing, could create a CvLoggingEventInterface which you could then subclass with your own special class CvHiddenEvilEventInterface. And all you would need to do would be to get the new file and install it and modify CvScreensInterface (assuming you didn't want to alter one of the functions that CvLoggingEventInterface altered, but that check can be done easily) and it would inherit all the code of the superclass (CvLoggingEventInterface) unless you specifically overrode that function.

Also, about the html, I don't see why you couldn't save it as an html file since it doesn't say anything about naming the files specifically, but then again, I haven't played with the mod yet.

Req

hIdDeN_eViL
Dec 04, 2005, 08:54 AM
Heh, the reason subclassing is great for this is that when you're working on a mod and trying to get the changes all you would have to do is just copy the file over. You wouldn't have to worry about cut and pasting all the changes in all the files that were modified because subclassing would just create NEW files.

So, for example. Instead of modifying CvEventInterface, eotinb, w/ subclassing, could create a CvLoggingEventInterface which you could then subclass with your own special class CvHiddenEvilEventInterface. And all you would need to do would be to get the new file and install it and modify CvScreensInterface (assuming you didn't want to alter one of the functions that CvLoggingEventInterface altered, but that check can be done easily) and it would inherit all the code of the superclass (CvLoggingEventInterface) unless you specifically overrode that function.

Also, about the html, I don't see why you couldn't save it as an html file since it doesn't say anything about naming the files specifically, but then again, I haven't played with the mod yet.

Req

:eek: :eek: i understood... maybe less than half of that. is subclassing like putting all the codes into a seperate file then simply refering to that file when needed??? is that the oversimplified version, or am i completely on the wrong track?

as for the html thing, i was thinking that it shouldn't matter either, because although the extention is different, it shouldn't make a difference when it is opened for appending. it would just be more convinient to open it as a html doc rather than a .txt file.

anyway, far far away from home atm, so won't be able to test for a longlong time.


edit: req, any chance you can tell me if CvEventManager has been changed?

Requies
Dec 04, 2005, 08:57 AM
:eek: :eek: i understood... maybe less than half of that. is subclassing like putting all the codes into a seperate file then simply refering to that file when needed??? is that the oversimplified version, or am i completely on the wrong track?

as for the html thing, i was thinking that it shouldn't matter either, because although the extention is different, it shouldn't make a difference when it is opened for appending. it would just be more convinient to open it as a html doc rather than a .txt file.

This wiki entry (http://en.wikipedia.org/wiki/Subclass_%28computer_science%29) probably explains it better than I would.

So, are you forced to save it as a .txt file? Or can you save it as a .html file? I thought you could just change the file type output, but then again, I could be wrong since I haven't played with it yet.

Req

Requies
Dec 04, 2005, 08:59 AM
edit: req, any chance you can tell me if CvEventManager has been changed?

Unfortunately, I can't as I haven't even looked at his code. Sorry :/.

Req

hIdDeN_eViL
Dec 04, 2005, 09:07 AM
This wiki entry (http://en.wikipedia.org/wiki/Subclass_%28computer_science%29) probably explains it better than I would.

So, are you forced to save it as a .txt file? Or can you save it as a .html file? I thought you could just change the file type output, but then again, I could be wrong since I haven't played with it yet.

Req
dammit... cant visit wiki where i am (china) for some reason.

i am in no position to test anything.. i dont have access to civ4 at the moment. im just dling mods and merging them so that when i get back i dont have to spend time doing it.

the default filename variable is "autolog.txt" so if i change it to "autolog.html", it should save to exactly that filename. when appending, i assume it will still function like any other text file. of course im only assuming all of this...

Requies
Dec 04, 2005, 09:27 AM
dammit... cant visit wiki where i am (china) for some reason.

i am in no position to test anything.. i dont have access to civ4 at the moment. im just dling mods and merging them so that when i get back i dont have to spend time doing it.

the default filename variable is "autolog.txt" so if i change it to "autolog.html", it should save to exactly that filename. when appending, i assume it will still function like any other text file. of course im only assuming all of this...

Ah, ok. Gotcha. Yes, it should work (assuming the html tags work appropriately), because all in all, html is really just text. It's just highly stylized text :D. Hmmmm, I think I've just described code in general :crazyeye:. Anyways, I'm sure eotinb will correct me, if I'm giving you bad advice on his specific mod, but from a programmers' perspective there should be no difference whatsoever between a txt file and an html file except that a browser will be able to "read" and show html code that it wouldn't in the txt file (in the txt file that html code would be just simply text).

And since I'm rambling on, I think I'll shut up now :D.

Req

Requies
Dec 04, 2005, 09:28 AM
Oh yeah, from the wiki entry:

In object-oriented programming, a subclass is a class that inherits some properties from its superclass.

You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":

* A cat has fur, four legs, and a tail
o A Manx cat does not have a tail, but has all of the other characteristics listed above
* A rectangle has four sides with lengths w and h
o A square has all of the characteristics of a rectangle; in addition, w = h

In this way, a subclass is a more specific version of its superclass; that is, the facts about the cat state what is generally true for all cats, even if some kinds of cats happen to have no tail. And while all rectangles have four sides, the square has the more restricted feature that all of its sides have the same length.

Don't confuse the subclass-superclass relationship with that of classes and instances. An "instance of cat" refers to one particular cat. The manx cat in the table is still a class — there are many instances of manx cats. And if a particular cat (an instance of the cat class) happen to have its tail bitten off by a fox, that does not change the cat class. It's just that particular cat that has changed.

Some software manuals refer to subclasses as derived classes.

eotinb
Dec 04, 2005, 10:13 AM
in version 1.2, has CvEventManager.py been changed from v1.1

i ask this because i have merged your changes in v1.1 with another mod, and i need to know what has been changed from v1.1 to 1.2, so i don't have to go through copy and pasting all 30 sections.

The only change is to the onGoodyReceived() function (I may be getting the name a bit wrong, but just search for "goody" and you'll find it).

eotinb
Dec 04, 2005, 10:16 AM
On saving as html, the default save is as a txt file, but you can just change the extension to .html and go. You should change the "style" variable to whichever the value for html is (by the way, I didn't implement the color-coding in html, so if you change the style variable it will all be black text).

eotinb
Dec 04, 2005, 10:17 AM
Req, thanks for the KB_XXX info -- that'll be a big help. As for subclassing, I certainly see your point. I actually went to do this but got stuck because I don't know where to import my file with the subclass.

Requies
Dec 04, 2005, 10:35 AM
Req, thanks for the KB_XXX info -- that'll be a big help. As for subclassing, I certainly see your point. I actually went to do this but got stuck because I don't know where to import my file with the subclass.

Do you mean what files you want to import the subclass you created? If so, it depends upon what functionality you want. I believe CvEventInterface is imported at CvDawnofMan, CvMainInterface, and CvWorldBuilder in the Screens dir and CvGameInterface in the EntryPoints dir. I don't believe the WorldBuilder needs your logging functionality, but the others might (along with the obvious CvScreensInterface where you NEED to put it in). I guess it just depends where you need to call a function specific to your subclass. Otherwise, if Python implemented subclassing correctly, you SHOULDN'T have to import your class elsewhere.

For example, if CvMainInterface only uses the onKbdEvent function (hypothetically), then it should matter if you overload that function in the subclass. It should still work correctly. However, if you want it to call eotinbcustommadefunction function, then you would have to import your specific file.

Hmmm, it potentially seems like a non-trivial task. Anyways, if you need my help let me know.

Req

DaveShack
Dec 04, 2005, 11:12 AM
I found a bug, which only surfaces when a city changes hands between the AIs. It throws a Python exception because local variable message is not initialized before being used. Here is the code with the problem, in cvEventManager.

# autolog addition 25/30
#----------------------------------------------------------------------------------------------
if (autolog.AUTO_LOG_CITY_OWNERSHIP and city.getOwner() == CyGame().getActivePlayer()):
message = "%s lost" % (city.getName())
self.log.write(5, message)
#----------------------------------------------------------------------------------------------

The solution is to indent the line starting with "self.log.write".

Tubby Rower
Dec 04, 2005, 11:55 AM
I got that message the other day too, but it was pretty early in the game so I didn't know what was going on.

Whomp
Dec 04, 2005, 01:02 PM
Great stuff eotinb!! This should be used by all SG'ers.

Out of curiousity because I'm an idiot, with the colors can I adjust them to different websites? Tubby Rower and I have spoilers at CDZ and their color codes don't match.

DaveShack
Dec 04, 2005, 01:57 PM
Great stuff eotinb!! This should be used by all SG'ers.

Out of curiousity because I'm an idiot, with the colors can I adjust them to different websites? Tubby Rower and I have spoilers at CDZ and their color codes don't match.

In autolog.py you could edit the color codes. Note in this example I had to replace '[' with '{' to keep the text from being interpreted as the actual colors...

if (color == 1):
self.blueOpenTag = '{color="RoyalBlue"]'
self.blueCloseTag = '{/color]'
self.greenOpenTag = '{color="Green"]'
self.greenCloseTag = '{/color]'
self.redOpenTag = '{color="Red"]'
self.redCloseTag = '{/color]'
self.orangeOpenTag = '{color="DarkOrange"]'
self.orangeCloseTag = '{/color]'
self.purpleOpenTag = '{color="Purple"]'
self.purpleCloseTag = '{/color]'
self.brownOpenTag = '{color="Brown"]'
self.brownCloseTag = '{/color]'
self.yellowOpenTag = '{color="Yellow"]'
self.yellowCloseTag = '{/color]'


Alternatively, open the output file in a text editor, and use find/replace to put in the color codes you need. This way you don't need to edit the autolog.py file to swap between CFC and CDG colors. Another idea is to define both and have a popup during startup ask which set you want to use.

hIdDeN_eViL
Dec 04, 2005, 09:08 PM
The only change is to the onGoodyReceived() function (I may be getting the name a bit wrong, but just search for "goody" and you'll find it).
thx. much easier now:goodjob:

(by the way, I didn't implement the color-coding in html, so if you change the style variable it will all be black text)
:cry: :cry: :cry:
eagerly awaiting release with html color codes.

eotinb
Dec 04, 2005, 09:51 PM
New revision in the works, including:

Minor correction to the error DaveShack pointed out above (and any others that make themselves known between now and whenever I finish up).
HTML color codes for hIdDeN_eViL (only because he's in China -- ni hui bu hui shuo Zhongwen?).
Subclassing, because it's a better way to do it and will eliminate annoying problems using my mods and other mods.
Screenshot semi-automation (described above).

hIdDeN_eViL
Dec 04, 2005, 09:55 PM
New revision in the works, including:

Minor correction to the error DaveShack pointed out above (and any others that make themselves known between now and whenever I finish up).
HTML color codes for hIdDeN_eViL (only because he's in China -- ni hui bu hui shuo Zhongwen?).
Subclassing, because it's a better way to do it and will eliminate annoying problems using my mods and other mods.
Screenshot semi-automation (described above).


:crazyeye: :goodjob: xie xie! wo ke yi shuo zhong wen. 谢谢!我可以说中文。

thx heaps!

eotinb
Dec 04, 2005, 10:06 PM
I would continue my conversation in Chinese with hIdDeN_eViL (who I hope doesn't mind if I start using a less taxing capitalization method when writing his or her name from now on), but:

I don't know enough Chinese to talk about anything more interesting than studying Chinese (seems like that's all the introductory books teach you), and
Nobody else would care.

Anyway, can someone please tell me what hex HTML color codes match the vB colors I'm using? Or just point me to a place that lists the RGB values of the vB colors? I was going to get a best approximation from this site (http://html-color-codes.com/) but my colorblindness would lead me to do something stupid like mix up brown and green or blue and purple.

Dr Elmer Jiggle
Dec 04, 2005, 10:08 PM
Minor correction to the error DaveShack pointed out above (and any others that make themselves known between now and whenever I finish up).


The bold and underline tags in turn headers are closed in the wrong order (you get <b><u>...</b></u>). The following change to the end of the autolog constructor fixes this.


self.headerOpenTag = self.boldOpenTag + self.ulineOpenTag
self.headerCloseTag = self.ulineCloseTag + self.boldCloseTag


HTML color codes for hIdDeN_eViL (only because he's in China -- ni hui bu hui shuo Zhongwen?).


The code below isn't pretty, but it does the job if you put it in the autolog constructor inside the if style == 1 block. If you want to get fancy, it might be nicer to use a class name instead of style, so you could attach a CSS stylesheet to the page, but that might be overkill.


if (color == 1):
self.blueOpenTag = '<span style="color: RoyalBlue">'
self.blueCloseTag = '</span>'
self.greenOpenTag = '<span style="color: Green">'
self.greenCloseTag = '</span>'
self.redOpenTag = '<span style="color: Red">'
self.redCloseTag = '</span>'
self.orangeOpenTag = '<span style="color: DarkOrange">'
self.orangeCloseTag = '</span>'
self.purpleOpenTag = '<span style="color: Purple">'
self.purpleCloseTag = '</span>'
self.brownOpenTag = '<span style="color: Brown">'
self.brownCloseTag = '</span>'
self.yellowOpenTag = '<span style="color: Yellow">'
self.yellowCloseTag = '</span>'

Dr Elmer Jiggle
Dec 04, 2005, 10:14 PM
Anyway, can someone please tell me what hex HTML color codes match the vB colors I'm using?

Most (all?) browsers these days recognize a pretty large list of named colors including the ones used in vB code. In fact, if you take a look at the HTML source code for one of the posts in this thread where you've included colors, you'll see that it's just using the names directly. For example, take a look at this one:

http://forums.civfanatics.com/showpost.php?p=3359614&postcount=85

Edit: If you prefer hex colors (indeed, it would probably be better and more conformant to standards), you can get a nice list of all the X11 color names and their hex equivalents here:

http://blooberry.com/indexdot/color/x11makerFrameNS.htm

hIdDeN_eViL
Dec 04, 2005, 10:20 PM
I would continue my conversation in Chinese with hIdDeN_eViL (who I hope doesn't mind if I start using a less taxing capitalization method when writing his or her name from now on), but:

I don't know enough Chinese to talk about anything more interesting than studying Chinese (seems like that's all the introductory books teach you), and
Nobody else would care.



hehe, don't mind at all. everyone else seems to not bother and just go with lowercase straight off. actually, i don't know what i was thinking when i creatd the account name....makes loggin in hell...

and im glad for the chinese convo to die. im more fluent in english by far.

anyway. if you are subclassing, does that mean that changes to CvEventManager should be removed?

vbraun
Dec 04, 2005, 10:57 PM
Could we get something for when a civlization gets destroyed, please?

eotinb
Dec 04, 2005, 11:01 PM
@Dr Elmer Jiggle: Thanks. And you even wrote the code for me -- how sweet. Thanks for catching the close tag order error too. I was careful to avoid this in my first edition but got sloppy somewhere down the line. It's nice to know that the vB named colors are just a subset of the HTML ones. And though it would indeed be more conformant to go with hex, I'm not that uptight and it would make it more difficult for other users to switch around the colors themselves (unless I added another layer by creating my own named colors set to the corresponding hex values, but if I wanted more busywork I'd get a real job).

@HiddenEvil:
....makes loggin in hell...
:lol: I bet.
anyway. if you are subclassing, does that mean that changes to CvEventManager should be removed?
Not yet. When v1.3 is released all you will have to do in your case (using another mod that alters CvEventManager.py) is replace the combined version of CvEventManager.py with the version from the other mod. You could go through and erase all the "autolog addition XX/XX" sections but that would be the hard way.

eotinb
Dec 04, 2005, 11:03 PM
Could we get something for when a civlization gets destroyed, please?
Should be possible. Let me look into it. No promises that this will make it into the upcoming revision, though. Good catch, by the way. This is a pretty big missing feature since you mention it.

eotinb
Dec 04, 2005, 11:20 PM
Doc, I know next to nothing about CSS. As the main purpose of this mod (for me at least) is SGs, most of my focus has been on ease of use for vB code users. But I'm very interested in stylesheet functionality as a future direction.

And since I have the attention of all you guri, anyone have any ideas on how to make the path implementation less klunky and trouble-prone? What I'd like to do is have the default setting be ...\SM's Civ4\Saves but I don't know how to get around the fact that part of that directory chain is machine-dependent (the full path being "C:\Documents and Settings\Owner\My Documents\My Games\Sid Meier's Civilization 4\Saves" on my machine and at least the drive and the "Owner" part are very likely to be different for other people).

Dr Elmer Jiggle
Dec 04, 2005, 11:56 PM
Doc, I know next to nothing about CSS. As the main purpose of this mod (for me at least) is SGs, most of my focus has been on ease of use for vB code users. But I'm very interested in stylesheet functionality as a future direction.

You should probably use <div ...> instead of <span ...> as I had in my code. That will make each entry naturally occur on a new line. Without that, you need to do the breaks manually somehow. For similar reasons, it would probably be useful to enclose the header in a div as well, resulting in HTML something like this.


<div><b><u>Turn 1 ...</u></b></div>
<div style="color: red">some combat occurred</div>
<div style="color: purple">something was built</div>


Now if you wanted to get fancier and use CSS, you'd wind up with HTML more like this.


<h2>Turn 1 ...</h2>
<div class="combat">1 for combat (wins, losses, promotions, war [if I can get this to work])</div>
<div class="build">1 for builds (units, buildings, projects)</div>
<div class="city">1 for city stuff (founded, growth, razed, borders, acquired, lost [last two coming soon!] -- may get combined with previous)</div>
<div class="religion">1 for religion (founded, spreads)</div>
<div class="technology">1 for technology</div>
<div class="other">1 for everything else (tribal village, golden age, great people -- may get combined with previous)</div>


Then you'd attach CSS (at the beginning of the file) that looks something like this.


<style TYPE="text/css">
<!--
h2 { font-weight: bold; text-decoration: underline; margin-top: 2ex; margin-bottom: 0; }
.combat { color: red; }
.build { color: purple; }
.city { color: RoyalBlue; }
.religion { color: DarkOrange; }
.technology { color: green; }
.other { color: black; }
-->
</style>


Strictly speaking, the HTML file should probably have the full <html><head><title>...</title><style>...</style></head><body>...</body></html> structure, but that's not really necessary with most browsers, and it would present problems with appending to a running log, since you never really know when the log is "finished." In practice, simply putting the stylesheet at the beginning of the file is sufficient.

This is all probably a lot more complicated than it needs to be for succession games, but just FYI. You can decide how much or how little of it you actually want to do. ;) Personally, I'm most interested in it just to get better information out of the in-game event log (especially city growth; I can't believe they left that out of the standard event notifications), so I'm eagerly awaiting your new notifications mod. Especially now that you removed all the event log stuff from this one. :)

eotinb
Dec 05, 2005, 12:05 AM
Edit: Thanks for the CSS primer.
You should probably use <div ...> instead of <span ...> as I had in my code.
Right-o.
Personally, I'm most interested in it just to get better information out of the in-game event log (especially city growth; I can't believe they left that out of the standard event notifications), so I'm eagerly awaiting your new notifications mod. Especially now that you removed all the event log stuff from this one. :)
Yeah, after I did that I realized there was a bit of a hole where the city growth bit notification had been. Were I working more diligantly on the notifications mod, the hole would be filled. But as it is, every time I have some time I find myself playing instead of working on the notification thing. That's why I did that simple reminders mod, in part to fill the gap (although it's certainly not as elegant for purposes of monitoring city growth as the automatic feature). Alternatively, it would be pretty trivial to add the city growth notification code back in. In fact...

eotinb
Dec 05, 2005, 12:15 AM
Until I finish the notifications mod (no idea when that will be), I'm posting the code that notified you of city growth in the in-game event log for those that want to put it back in. The following two lines should go in the onCityGrowth() function in CvEventManager.py after the line that begins "CvUtil.pyPrint" (which would be line 686 in the unmodified 1.09 version):
message = "%s grows: %i" %(pCity.getName(), pCity.getPopulation())
CyInterface().addMessage(pCity.getOwner(), True, 30, message, 'AS2D_ALARM', 2, 'Art/Interface/Buttons/Actions/foundcity.dds', ColorTypes(11), pCity.getX(), pCity.getY(), True, True)
Note that the sounds that plays is the same alarm sound from my reminders mod. If you don't like it just change 'AS2D_ALARM' in the second of the above lines to None.

hIdDeN_eViL
Dec 05, 2005, 12:22 AM
Not yet. When v1.3 is released all you will have to do in your case (using another mod that alters CvEventManager.py) is replace the combined version of CvEventManager.py with the version from the other mod. You could go through and erase all the "autolog addition XX/XX" sections but that would be the hard way.
nope... looks like i'll have to do it the hard way. i've merged your reminder thingy as well. and changed the codes to the other mod thats merged in.

o well, at least with subclassing future updates will be a breeze.


do you have an eta on you next release?

eotinb
Dec 05, 2005, 12:33 AM
@HiddenEvil: I hate to make promises and not keep them, but I will let you know that I was shooting for tomorrow. Earliest something like 12 hours from now but if subclassing is more trouble than I expect, it could take longer. I think within the next day or two is reasonable.

@Doc: Would it be inelegant or otherwise inadvisable to use the span tags as you originally posted and nest them inside div tags? Because I was thinking of something like:
if (style == 1):
revisedMessage = "<div>%s</div>" % (logMessage)
logMessage = revisedMessage

Dr Elmer Jiggle
Dec 05, 2005, 01:16 AM
Would it be inelegant or otherwise inadvisable to use the span tags as you originally posted and nest them inside div tags? Because I was thinking of something like:
if (style == 1):
revisedMessage = "<div>%s</div>" % (logMessage)
logMessage = revisedMessage

Maybe slightly inelegant, but I wouldn't say inadvisable. If it works, it works! ;)

FWIW, my current local copy uses <div style="color: foo"> for the event color tags and <h3> for the "bold open tag." I'm guessing that solves the same problem you're working on (that is, getting the header surrounded by a div without impacting the vB code side of the fence). Whether it's better, worse, or the same as your approach is debatable.

BTW, thanks for the in-game event log code. I had been trying to figure it out myself, but I haven't found any documentation nor the source code for CyInterface, so it's no surprise that I wasn't getting anywhere.

hIdDeN_eViL
Dec 05, 2005, 01:28 AM
@HiddenEvil: I hate to make promises and not keep them, but I will let you know that I was shooting for tomorrow. Earliest something like 12 hours from now but if subclassing is more trouble than I expect, it could take longer. I think within the next day or two is reasonable.

in that case, dont rush anything on my account. after this evening i wont have net access until .... very late sunday.

eotinb
Dec 05, 2005, 09:42 AM
Req, you will be happy to hear that I have completed the conversion to a proper inherited class structure. It was a bit tricky, but nothing I couldn't handle (he says before all the bug reports come streaming in). I'm still having trouble with recognizing when PrtScn is hit -- at first I thought the keyboard event is consumed wherever in the code the screenshot is stored, but then I realized that with my code in, the screenshots I took were different (specifially, they were tga format but still had the .jpg extension and didn't have any interface) and as soon as I commented out my code it worked as before. But I never got my placeholder code (just a simple message to the in-game screen to let me know it was working) to trigger. I'll work with it a bit more and if I make no more headway, release the new version without it later today.

I'm also looking for some help on implementing vbraun's request on noting when a civ is destroyed, in particular:

It would be much easier if I could make this event-based. This means I need to figure out all of the events that could be triggered at the same time that a civ is eliminated (since there is no specific onCivEliminated() or similar event). From what I have read, a civ is eliminated when they lose their last city, regardless of if they have any units left (I think that's one of the hints that shows when the game is loading). This would mean that a civ with a settler out and about that loses its last city is gone even though it could found a new city with the settler. So I guess I have two questions:
Can anyone confirm that what I have just described (regarding settlers) is true? Are there other events that could fire at the same time a civ is eliminated besides losing a city? I think onCityLost() is fired every time onCityRazed() is, so there shouldn't be a need to check in both of those functions, but there may be some other way a civ is eliminated that I'm forgetting. Maybe if they lost their first settler before it founded the first city, although I can't see that ever happening. Something else?
Should the log only note when a civ you know is destroyed? If not, should you be told the name of the dead civ if you haven't met them? In other words, as I see it there are three options when a civ you don't know is destroyed (you are always told who died when the eliminated civ is one you know): You don't hear about it You get a message like "An unknown civ has been destroyed" You get a message like "The Aztecs have been destroyed"

Dr Elmer Jiggle
Dec 05, 2005, 11:09 AM
Can anyone confirm that what I have just described (regarding settlers) is true?

It wasn't true in Civ3 (that is, in Civ3 if you had a settler you were still in the game), but it's certainly possible that they changed it in CivIV.

You don't hear about it You get a message like "An unknown civ has been destroyed" You get a message like "The Aztecs have been destroyed"

I think B or C makes the most sense. You aren't giving away any information by announcing the destruction itself. You could always look at the victory conditions screen to see how many rivals are left in the game.

As for the name, that's a tougher call. Theoretically once they're eliminated it really doesn't help you to know who it was, so you might as well say the name just for the sake of interesting background information. On the other hand, if it doesn't help you, then why mention it? In other words, if it's not useful to know that it was the Aztecs, then you should be just as happy to know that it was "Unknown civilization." I'd say go with B unless someone can come up with a compelling reason why C is better.

You could actually make a case that knowing the civilization's name would, in fact, help you out. Knowing what traits and unique units were in play might tell you something about the remaining civilizations. For example, you might deduce that if the eliminated civilization had a strong unique unit in the current era, then the enemies might be weak from the war. Or you might be able to make a guess about which wonders and holy cities the conquerers took over. It's a stretch, but better to avoid the issue and just leave it as unknown.

eotinb
Dec 05, 2005, 12:37 PM
I agree, Doc. I'd add that knowing who is gone eliminates one possible remaining opponent.

Dr Elmer Jiggle
Dec 05, 2005, 12:57 PM
Are there other events that could fire at the same time a civ is eliminated besides losing a city? I think onCityLost() is fired every time onCityRazed() is, so there shouldn't be a need to check in both of those functions, but there may be some other way a civ is eliminated that I'm forgetting. Maybe if they lost their first settler before it founded the first city, although I can't see that ever happening. Something else?

A couple thoughts on this topic.


If a civilization is not eliminated until their last settler is dead, it seems like you could catch that in the onUnitLost event handler. onCityLost and onUnitLost together ought to cover all the bases regardless of the rules.
There is an onSetPlayerAlive event handler. I imagine that gets called when a civilization is eliminated. If so, that pretty much solves the problem without having to worry about checking for the last city, the last settler, etc.

BeefontheBone
Dec 05, 2005, 01:07 PM
I did see a post on here somewhere where someone had started with an AI settler adjacent to their warrior, so the AI was eliminated on turn 1 - with stupid numbers of civs on a tiny map it appears to be possible; checking onUnitLost might be sensible. If you wanted to check whether losing your last city destroys you even if you have a settler, you could throw that scenario together in the WB.

eotinb
Dec 05, 2005, 01:20 PM
I never payed much attention to onSetPlayerAlive() before. Thanks again, Doc.

Edit: Well that was easy. Working like a charm now.

Requies
Dec 05, 2005, 07:24 PM
Req, you will be happy to hear that I have completed the conversion to a proper inherited class structure. It was a bit tricky, but nothing I couldn't handle (he says before all the bug reports come streaming in). I'm still having trouble with recognizing when PrtScn is hit -- at first I thought the keyboard event is consumed wherever in the code the screenshot is stored, but then I realized that with my code in, the screenshots I took were different (specifially, they were tga format but still had the .jpg extension and didn't have any interface) and as soon as I commented out my code it worked as before. But I never got my placeholder code (just a simple message to the in-game screen to let me know it was working) to trigger. I'll work with it a bit more and if I make no more headway, release the new version without it later today.

I'm also looking for some help on implementing vbraun's request on noting when a civ is destroyed, in particular:

It would be much easier if I could make this event-based. This means I need to figure out all of the events that could be triggered at the same time that a civ is eliminated (since there is no specific onCivEliminated() or similar event). From what I have read, a civ is eliminated when they lose their last city, regardless of if they have any units left (I think that's one of the hints that shows when the game is loading). This would mean that a civ with a settler out and about that loses its last city is gone even though it could found a new city with the settler. So I guess I have two questions:
Can anyone confirm that what I have just described (regarding settlers) is true? Are there other events that could fire at the same time a civ is eliminated besides losing a city? I think onCityLost() is fired every time onCityRazed() is, so there shouldn't be a need to check in both of those functions, but there may be some other way a civ is eliminated that I'm forgetting. Maybe if they lost their first settler before it founded the first city, although I can't see that ever happening. Something else?
Should the log only note when a civ you know is destroyed? If not, should you be told the name of the dead civ if you haven't met them? In other words, as I see it there are three options when a civ you don't know is destroyed (you are always told who died when the eliminated civ is one you know): You don't hear about it You get a message like "An unknown civ has been destroyed" You get a message like "The Aztecs have been destroyed"


Nice work, dude. :goodjob:.

I like "An unknown civ has been destroyed or you don't hear about it." It seems kind of against the grain to know who was destroyed if you've never met them....

Req

lamaros
Dec 06, 2005, 02:06 AM
This looked great so I tried it out.

First time it worked a charm, then I realised it wasn't saving the logs. I fiddled around with the path and got it to save the logs fine.. except now it won't save my user comments! Which is the main reason I wanted to use it!

So I deleted it all and started over, but the user comments are still broken! They don't echo (show up as Debug events) or show up in the text log. Everything else seems to log fine.
Help!

Thanks.

eotinb
Dec 06, 2005, 07:18 AM
So it's keeping the log correctly but not your user comments? Do you get the popup when you hit Alt+E? Are you hitting enter or selecting OK with the mouse? I have a little error where doing the former doesn't work, only the latter.

lamaros
Dec 06, 2005, 07:28 AM
I was hitting enter I believe. I'll check tomorrow and see what happens.

Tubby Rower
Dec 06, 2005, 09:47 AM
Clicking the OK button works for me. For a while I just hit enter and nothing but Debug Event popped up. After I found out that enter <> clicking OK then I changed the way I enter messages. Just a habit of hitting <enter>.

DaveShack
Dec 06, 2005, 11:44 AM
Not a bug, but...

I've noticed another quirky thing about enter and window focus. When loading a game, typing in the popup window for the log file name takes focus away from the main interface. After you press OK, the keyboard may not work until you click on the main interface. In particular, I've noticed that if I saved right before hitting enter for end of turn, enter won't work until that extra click is done.

eotinb
Dec 06, 2005, 12:43 PM
I noticed the same thing today with a game I loaded up, DaveShack. The enter != OK I think I know what is going on, but the popup taking focus away is a bit of a mystery to me.

Requies
Dec 06, 2005, 12:48 PM
Clicking the OK button works for me. For a while I just hit enter and nothing but Debug Event popped up. After I found out that enter <> clicking OK then I changed the way I enter messages. Just a habit of hitting <enter>.

Oh, I found a workaround for this.

Instead of


def __eventCustomLogEntryApply(self, playerID, userData, popupReturn):
if (popupReturn.getButtonClicked() == 0):
CyInterface().addMessage(CyGame().getActivePlayer( ), True, 10, message, None, 2, None, ColorTypes(8), 0, 0, False, False)
self.log.write(2, message)


use

if (popupReturn.getButtonClicked() != 1):

I think it works fine because I believe the popup takes focus from ALL input until it's dealt with.

Req

BeefontheBone
Dec 06, 2005, 02:13 PM
I found an issue which appears to be to do with the autolog mod - I get a DEBUG event involving something about a PopUp window (can't remember exactly offhand) when running the autolog and reminder mods and loading the Earth Ice Age scenario, and the poup with "You (leader) are (trait) and (trait) and you have learned (tech) and (tech) blah blah" doesn't appear.

eotinb
Dec 06, 2005, 03:31 PM
BeefontheBone, I know about the Debug events (although I don't completely understand why they are created -- I have a suspicion but I haven't spent any time confirming it yet) but are you saying that you don't get the Dawn of Man screen when using autolog?

BeefontheBone
Dec 06, 2005, 05:05 PM
I only noticed it on the Earth_IceAge scenario but have only played one other game with the autolog on and I'm not sure whether it was there or not. I'll get back to you on that!

Skyfish
Dec 07, 2005, 08:25 AM
I love this utility, thanks a lot eotinb :worship:

Maybe a stupid question but
Is there any chance you could include a log of the DEALS made with the other civs in the log please ? Is it technically feasible ?

Thanks :D

eotinb
Dec 07, 2005, 08:58 AM
Skyfish, that's something I'm working on. It's a bit harder than it at first seems, but it's the last big feature I want to get into autolog. And I'm glad you like it.

LeSphinx
Dec 08, 2005, 07:10 AM
I can beleive how you do to develop some tools like this one.
I've donwloaded it and I will try it tonight.
Thanks, it will be very usefull the the GOTM purpose!!!
LeSphinx

vbraun
Dec 08, 2005, 07:19 AM
Should be possible. Let me look into it. No promises that this will make it into the upcoming revision, though. Good catch, by the way. This is a pretty big missing feature since you mention it.
Make sure its when they have 0 points, instead of when there last city was captured, because I use this in MP games and its very important when someone is destroyed. :)

vbraun
Dec 08, 2005, 07:21 AM
Also this may be a problem:
http://img228.imageshack.us/img228/2941/civ4screenshot03281jh.jpg

eotinb
Dec 08, 2005, 09:05 AM
vbraun, I don't get it. What am I supposed to be seeing in this screenshot?

Lord_Iggy
Dec 08, 2005, 07:42 PM
Is the interface missing, or did you set it that way?

Great mod you've got here eotinb.

Jeff1787
Dec 09, 2005, 08:17 PM
I have loaded the file and here is the log I get. What am I doing wrong?

Kindness
Dec 09, 2005, 08:33 PM
It's not meant to be opened in Notepad.
Copy the text into a quote here and it should work.

Jeff1787
Dec 09, 2005, 08:38 PM
ok, what file should I use to open it on my own computer?

Requies
Dec 09, 2005, 09:17 PM
ok, what file should I use to open it on my own computer?

Errrr, see the B, and U above where you type your message (well in advanced look). Try clicking on one of those....

Notice how there appear to be square brackets around a B and U. Notice how similar they appear to some weird symbols you've seen.....

Ponder what the point of a log would be for....

:D

Req

Jeff1787
Dec 09, 2005, 09:28 PM
I know what the log is for.....you don't need to talk down to me. Forget that I ever asked the question.

Requies
Dec 09, 2005, 09:38 PM
I know what the log is for.....you don't need to talk down to me. Forget that I ever asked the question.

Now, I'm :confused:. If he knows what the log was for why was he asking the question he did? Oh well, try to add some humor to the situation, and people seem to assume you're insulting them. C'est la vie.

Req

DaviddesJ
Dec 09, 2005, 09:49 PM
Now, I'm :confused:. If he knows what the log was for why was he asking the question he did?

The question is perfectly reasonable. He wants to know what would be a good way to view the log on his own computer. If you don't have an answer, that's fine, but there's no reason you have to be so condescending in your response.

Requies
Dec 09, 2005, 09:54 PM
The question is perfectly reasonable. He wants to know what would be a good way to view the log on his own computer. If you don't have an answer, that's fine, but there's no reason you have to be so condescending in your response.

Ok, I was referring to the first question he asked, but I guess it's just my time to be misunderstood. I was trying to make a funny, but I guess others interpreted it differently. My apologies if people were offended by my trying to make a joke.

Req

Kindness
Dec 10, 2005, 01:52 AM
All confusion aside - the point of the log is to paste as a message on these forums, so I don't know offhand what program would open it.
It uses [ ] as tags, which I think are basically only used for forum code.
If you want to see them with colour etc. then copy them as a message here and hit preview.

Edit: I just downloaded it, and yea - Beef already said it but:

"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."

That's in the readme - if you want to read it with notepad you may want to change it to none.

BeefontheBone
Dec 10, 2005, 01:54 AM
Or you could go into the python and edit the formatting variable to leave the formatting out, as documented in the readme...

eotinb
Dec 10, 2005, 08:34 AM
As others have said, you can change the style variable (to 0 I believe, I'd have to check to make sure -- it's documented in autolog.py) to eliminate the vB tags.

vbraun
Dec 10, 2005, 11:21 AM
vbraun, I don't get it. What am I supposed to be seeing in this screenshot?
In the middle of the map the pop-up still is part of the image when zooming out to global view. Zoom back in and its gone. And its not even functunal just an image of the pop-up. It was really weird.

eotinb
Dec 10, 2005, 12:46 PM
That is very odd. This was the popup that comes up on loading? Did you enter a file name and press OK and it didn't go away? Has this happened more than once?

KingG
Dec 10, 2005, 12:52 PM
Thanks eotinb for your modding efforts. I downloaded your mods and added the city growth code as you suggested.

At last I have notifications when my cities grow. :D This makes it much less fiddly to manage my cities' workers.

Your notifications mod will be great, and I look forward to it. May I suggest an option similar to "Show friendly moves" for our own units ? This would be useful, for example, for units on a multiple-length move so we don't miss goodys/barbarians/etc ? Don't know how feasible this is.

I am still a little amazed that the game was released without basic features and poor civilopedia/advisors. Let alone that it runs like a three-legged dog.

But with the efforts of civ modders (and no doubt more patches) I reckon civ IV will be simply awesome.

Great stuff eotinb. :goodjob:

eotinb
Dec 10, 2005, 01:36 PM
@KingG: So glad you like the mods. Sorry to you (and everyone) that notifications is taking so long -- I've run into a little problem and playing has been more attractive than figuring out what the problem is. As to showing your own moves, I also wonder why that isn't already in. There might be a way to do it, but I can assure you that it won't make it into notifications. Might be a suggestion to post in the main mod forum. I have been known to put a caravel on "explore" when there is only a little bit of aquatic fog left, only to never hear from it again. But running into enemy units (such as barbarians) will interrupt a goto movement, I believe.

KingG
Dec 10, 2005, 02:27 PM
Yes eotinb :)

If we could see barbarians and other nasties by a "Show own moves" perhaps we could avoid bumping into them with a settler etc. And also in times of war this would be helpful. I'll find another forum to suggest this in - hard to find my way around here.

And an unexpected benefit of your mods is that you highlighted the idea of succession games as a learning experience for a relative civ newbie like me. So I'll check that out too.

I'll keep an eye out for your notifications mod - maybe you'll work out the problem after just one more turn ? :)

hIdDeN_eViL
Dec 11, 2005, 04:58 AM
eotinb, i was wondering if you could put in another feature, so that it will write to two seperate files, with html in one, and forum in another?

oh... and you mentioned that you were starting another mod thats like civassist. have you started a thread for developeent/ideas?

Dr Elmer Jiggle
Dec 11, 2005, 09:35 AM
you mentioned that you were starting another mod thats like civassist. have you started a thread for developeent/ideas?

http://forums.civfanatics.com/showthread.php?t=142212

Gailainne
Dec 11, 2005, 10:37 AM
eotinb

Wonderful mod, I find it very useful when testing options on "what ifs", could I ask is it possible to have an option to add which folder to save the txt file too ?
I sometimes run a couple....nay 4 or 5 test options, it would be brilliant if I could set the log in the same folder as the saves when I start. Or would "//test01//log01.txt" work ?

Nope tried it programme freezes :(

eotinb
Dec 11, 2005, 05:44 PM
Gailainne, what you ask wouldn't be too difficult, but given the problems so many people have had with the path, I'm reluctant to fiddle with that aspect of autolog. and I don't think it's that hard to move the separate files after the fact. But if others express interest in this feature, I may reconsider. Also, feel free to dig into the code and make the change yourself.

Dusty4prez
Dec 11, 2005, 05:50 PM
where do these log files save to?

eotinb
Dec 11, 2005, 06:03 PM
Check the variable "path" in autolog.py. It has to be a valid directory on your PC or the files don't get saved at all. Check the first post for more hints at getting the formatting right for the path, and if you have trouble after that, there is a little more detail somewhere earlier in the thread, so slog through the whole thing. :)

Does that answer your question, Dusty?

Dusty4prez
Dec 11, 2005, 07:47 PM
Well whenever I search the word "path" it finds it once but it has nothing to do with saves.

eotinb
Dec 11, 2005, 09:56 PM
"path" is the directory where the log files created by autolog are saved to. The in-game event log is stored in the savefile. There is a utility to extract them here (http://forums.civfanatics.com/showthread.php?t=141769).

Gailainne
Dec 12, 2005, 06:26 AM
Eotinb

Thanks for the quick response, no worries I'll do it the old fashion way :), "make the change myself" shudder, I'd hate to think what the outcome of that would be, it took me 2 attempts to get the files in the right place hehe.

LeSphinx
Dec 12, 2005, 12:10 PM
Great utility.

I've try in order to figure it by myself.

here is my log files :
----------------------------New entries----------------------------
Turn 0 (4000 BC)
Washington founded
Washington begins: Warrior

Turn 1 (3960 BC)
Research begun: The Wheel

Turn 2 (3920 BC)
Tribal village results: lots of gold

But I can not see the differents colors!
How can I do ?
Thanks in advance...

LeSphinx

LeSphinx
Dec 12, 2005, 12:11 PM
Let see...
I can not see the color with notepad editor either word but I can see the color in my previous post!!!!!!!!!!!

DaveShack
Dec 12, 2005, 12:37 PM
Let see...
I can not see the color with notepad editor either word but I can see the color in my previous post!!!!!!!!!!!

If you have the colors being output in "forum" style, you need to look at it in a forum post to see the colors. If it is in "HTML" style, rename the file with a .html extension, and then Word will show the colors (and not show the HTML tags).

playshogi
Dec 13, 2005, 12:30 AM
If you have the colors being output in "forum" style, you need to look at it in a forum post to see the colors. If it is in "HTML" style, rename the file with a .html extension, and then Word will show the colors (and not show the HTML tags).

Actually, in order to view the output on your own computer, you have to paste autolog.py's output into a post and then preview your post. Then copy the preview back into Word. Don't forget to NOT actually post your reply unless you want the whole world to view it. There may be ways to change the options within autolog.py so you don't have to do this, but I didn't go there.