[PYTHONCOMP] Civ4lerts: Alert messages about in game events

Download BUG guys. You can set up the INI through options within the game, even set up alerts for Gold and GPT not to trigger unless they are of a certain amount.

Just follow the link in my sig.

Thanks for the reply. This new mod of your team does look interesting. I do have a question about it though, but I'll ask that in your own forum. :)
 
No, the work to backport the mod to Warlords is rather large, and we'd rather put that effort into adding new features and fixing bugs.

If you want a great unaltered modpack for Warlords, download Ruff_Hi's excellent RuffMod. Most of what's in BUG was in or taken from Ruff's mod, and he's on the BUG team to boot.
 
edit: already answered.
 
If you want a great unaltered modpack for Warlords, download Ruff_Hi's excellent RuffMod. Most of what's in BUG was in or taken from Ruff's mod, and he's on the BUG team to boot.

Or you could try my jrayUGH modpack :D (see my sig). I haven't tested it with 2.13, but I'd bet that it works fine since IIRC 2.13 didn't change any Python or XML from 2.08. RuffMod is more user-friendly since it has the in-game option configuration screen, but jrayUGH has some extra stuff (like Plot List Enhancements and Great Person art) that Ruff_Hi didn't want to include because he was emphasizing succession games.
 
Hey guys,

I'm looking for the code needed to display an alert for the following conditions:

Civ is now willing to become a vassal
Civ is now willing to capitulate
Civ is now willing to form a permanent alliance
Civ is now researching Liberalism

I'm also wondering from where queries about other Civs should be called from in the eventmanger.

Mostly I need help in writing the syntax for querying on other Civs.

Any ideas? All I need are a few examples and I can go nuts from there!!
Spocko
 
BTS Espionage points built high enough over a period of time, will allow you to see a civs research, but iirc it's shown in the score already.
 
Thanks alerum68.

Yes, it is true that having enough espionage points allows us to see what is being researched. What I'm wanting instead is a triggered popup alerting me to the fact that someone is chasing Liberalism, for example, and I had best do the same if I want that extra Tech for researching it first. The same holds for a few other Techs whereby the first-to-research gets a GP (e.g, Physics yields a GS).

I dug around in the HOF mod and found code, invoked by the eventmanager during "onBeginPlayerTurn", that gives me a point in time to run a query on, say, whether another Civ is interested in open borders, vassal, permanent alliance, and defensive pact, which I rewrote as follows:

tradeData = TradeData()
tradeData.ItemType = TradeableItems.TRADE_OPEN_BORDERS
if ((((iturn -11+currentPlayer) % 3) == 0) and (pActivePlayer.canTradeItem(currentPlayer, tradeData, False))):

if (pTargetPlayer.getTradeDenial(activePlayer, tradeData) == DenialTypes.NO_DENIAL): # will trade

As you can see, the "iturn -11+currentPlayer) % 3) == 0" staggers this popup for each interested Civ to repeat every three turns (I have several other alerts set up, and I don't want them to all pileup on the same turn).

Credit for this goes to the guys that worked on the HOF mod.

There is code in there that will loop through resources to report on whether a Civ is willing to trade any of them - I'm in the process of figuring this out and modifying it for my own mod.

Thought I'd share what I found. Querying on whether there is a "TRADE_DENIAL" is something I wouldn't have figured out myself. So I appreciate the work the HOF modders did to figure this out.

Spocko
 
Yes, it is true that having enough espionage points allows us to see what is being researched. What I'm wanting instead is a triggered popup alerting me to the fact that someone is chasing Liberalism, for example, and I had best do the same if I want that extra Tech for researching it first. The same holds for a few other Techs whereby the first-to-research gets a GP (e.g, Physics yields a GS).

Do you want this when your espionage already shows it to you? (In which case it's shown directly on your screen at all times, so I don't see why you would need an alert.) Or do you want this when espionage won't reveal it? (In which case it would be a cheat, the mod is not supposed to allow you to know things you wouldn't otherwise know.)
 
Do you want this when your espionage already shows it to you? (In which case it's shown directly on your screen at all times, so I don't see why you would need an alert.) Or do you want this when espionage won't reveal it? (In which case it would be a cheat, the mod is not supposed to allow you to know things you wouldn't otherwise know.)

Good point on whether to popup this whenever espionage doesn't show it. I would want to keep it clean and have the popup be, yes, redundant in this case, not popping unless I had access to such information.

The way I play, I don't read everything in the scoreboard every turn, or if I'm in the midst of battle I can forget to check on these tedious issues. So, I'll be creating a redundant popup as a reminder (and sometimes I forget whenever a certain tech yields a GP upon being first - a popup would remind me of the significance for any of these specific techs).

The HOF code shows a loop from which I can discern how to do this with my mod.
 
If we are going to have popup messages for techs, I would choose to have them go off every time an opponent starts researching any new tech.

I suspect the AI never changes research targets until it's finished the last research target, so, if you have espionage data, when an opponent starts researching a new tech, you could also conclude that the opponent has learned the previous tech.
 
If we are going to have popup messages for techs, I would choose to have them go off every time an opponent starts researching any new tech.

I suspect the AI never changes research targets until it's finished the last research target, so, if you have espionage data, when an opponent starts researching a new tech, you could also conclude that the opponent has learned the previous tech.

Yes, I bet you're right about the AI not switching, DaviddesJ - the only time I've noticed the AI switching was when I was racing with Saladin to research, you guessed it, Liberalism first - the moment I got it (and the extra tech), espionage showed Saladin switching to something else (he as about 15 turns away from Liberalism, so unless he popped a GS or something, he didn't finish it: I should have checked the Foreign Advisor to see if he was "still seeking" Liberalism).

As to a popup for every new tech research target, I think it could be, for me anyway, overwhelming and I would lose sight of which researches were more significant than others (like, which ones have a free GP upon being first, free tech, etc.). Just my being selective about redundancy :)

Spocko
 
I tried to install this mod and it didn't work. Can somebody help? I have no previous experience with mods, this is the first one I've tried because I think these alerts would be so helpful.

I downloaded the file, unzipped the folder and put the folder in the "mods" folder. Then from the game, I go to "load a mod" and hit civ4alerts and it tells me it needs to reset in order to work and then I can start a new game. However, I'm not seeing the alerts come up.

Can somebody please tell me what I need to do? I'm playing on Vanilla with whatever the latest patch is.
 
I don't know if this works on version 3.17 of BTS. Try downloading BUG. It's got on-screen alerts, more then contained here, and you can customize which ones you want. There are alot of other goodies too.
 
I'm playing on Vanilla with whatever the latest patch is.

Try downloading BUG.

But Steven P doesn't have BTS, so BUG is out of the question. However, this guy named Alerum68 had an unaltered gameplay modpack back in the day for vanilla Civ4, right? ;)
 
It's been so long since I touched it, that I'm not even sure if has alerts or not. Also, is it even still on the website after it got hacked??
 
Top Bottom