[mod] Log changes

eotinb said:
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.

  1. 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.
  2. 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.
 
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.
 
I never payed much attention to onSetPlayerAlive() before. Thanks again, Doc.

Edit: Well that was easy. Working like a charm now.
 
eotinb said:
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:
    1. Can anyone confirm that what I have just described (regarding settlers) is true?
    2. 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
 
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.
 
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.
 
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>.
 
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.
 
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.
 
Tubby Rower said:
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

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

use

Code:
		[B]if (popupReturn.getButtonClicked() != 1):[/B]

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

Req
 
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.
 
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?
 
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!
 
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
 
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.
 
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
 
eotinb said:
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. :)
 
Also this may be a problem:
civ4screenshot03281jh.jpg
 
Back
Top Bottom