1.24.1 Released!

This one. iImportCitySize / iExportCitySize is calculated first and if condition is true it's always less than 1, so it is rounded down to 0 (or to nearest? not familiar enough with python, my city was more than twice as large anyway). Suggesting changing to full form (worked for me):

Ah, gotcha. Cheers!
 
Unfortunately there is no way to detect when the map has been regenerated (as far as I know), and thus no way to fix these problems. Regenerating the map can cause all sorts of issues in mods, not just HR. Best to never use it.
Isn't it possible to do by modifiyng K-Mod dll? It handles buttons from main menu, including button for regenerating map, and if i'm not mistaken, "GameStart" event is activated by it to begin with (well, at least i didn't found it's activation in vanilla dll).
 
I have question if AI is even capable using Battery Ram. Is AI ignore it because its not siege unit that it can be used? And probably its not possible use it as city/fortress attack only classification?

If Tactic Trail receive bonus, then it cannot be commando for mounted units. (we know that turns well bad fast.)
And if we talking about commando. How it will sound if aggressive trait dint have commando for melee, mounted, gun, but something like +100% free unit support or (+1 support for every 10 population) - I mean if someone its aggressive its does not mean he smart enfeoff to use opponent infrastructure. For me its mean he will boost the numbers of its military. - Or just have +4xp on start.

Out of trophic question: Can someone win the game on Monarch or Higher difficulty? (without editor help) After the K-mod its somehow hardly achievable. And i remember using Emperor difficulty.
 
Isn't it possible to do by modifiyng K-Mod dll? It handles buttons from main menu, including button for regenerating map, and if i'm not mistaken, "GameStart" event is activated by it to begin with (well, at least i didn't found it's activation in vanilla dll).

Regenerating the map doesn't trigger 'GameStart' or similar, which is the problem. However, I've had a look through the DLL code and it does trigger 'afterGeneration', meaning I can place the relevant code into each Mapscript instead.

I have question if AI is even capable using Battery Ram. Is AI ignore it because its not siege unit that it can be used? And probably its not possible use it as city/fortress attack only classification?

What makes you think the AI can't use Battering Rams?

If Tactic Trail receive bonus

I'm not going to give it another bonus.

And if we talking about commando. How it will sound if aggressive trait dint have commando for melee, mounted, gun, but something like +100% free unit support or (+1 support for every 10 population) - I mean if someone its aggressive its does not mean he smart enfeoff to use opponent infrastructure. For me its mean he will boost the numbers of its military. - Or just have +4xp on start.

I'm happy with free Commando promotions for Aggressive leaders. Suits the trait well.
 
Regenerating the map doesn't trigger 'GameStart' or similar, which is the problem. However, I've had a look through the DLL code and it does trigger 'afterGeneration', meaning I can place the relevant code into each Mapscript instead.
Well, I meant it's possible to make it do so by modifying dll. I actually wanted to try this myself but coudn't get it's source code to compile (way too many compilation errors). Maybe will try a bit later with another compiler.
 
Ok, I managed to rebuild dll, now I have to figure out why it spams error messages about some non-existing xml files on launching civ (it still works tho).

About 'afterGeneration', is it possible to remove old yields that way? K-Mod dll has getPlotExtraYield exposed to python, so you can check and then remove with this, but you are avoiding functions that are not present in vanilla dll, right? To not break things for Mac.
 
Ok, I managed to rebuild dll, now I have to figure out why it spams error messages about some non-existing xml files on launching civ (it still works tho).

The K-Mod DLL can't just be dropped in to HR, I've made quite a few changes to it. Most of these were to preserve Mac-compatibility. For example, K-Mod changes the 'NoUnhealthyPopulation' bonus used by the Hospital from a boolean to a percentage – which is better, but required an XML change that the Mac version couldn't cope with. So I had to disable that feature, unfortunately. Fortunately the Mac version will just skip any line in the XML it doesn't recognise, so adding new XML entries isn't a problem, just altered ones.

The XML errors you're getting will be due to these modifications. I can send you my DLL source files if you want though.

About 'afterGeneration', is it possible to remove old yields that way? K-Mod dll has getPlotExtraYield exposed to python, so you can check and then remove with this, but you are avoiding functions that are not present in vanilla dll, right? To not break things for Mac.

No need to check if the extra yield exists, I just use setPlotExtraYield to zero anything that's already there then apply new yields where necessary (Mountains and Natural Wonders). Extra Yield isn't used for anything else at this point of the game so it's fine to do it this way. And completely Mac-compatible.
 
No need to check if the extra yield exists, I just use setPlotExtraYield to zero anything that's already there then apply new yields where necessary (Mountains and Natural Wonders). Extra Yield isn't used for anything else at this point of the game so it's fine to do it this way. And completely Mac-compatible.
But setPlotExtraYield doesn't actually sets extra yields, it adds them instead. Here is how it looks in code: (*it).m_aeExtraYield[eYield] += iExtraYield . So calling it with 0 as argument will actually do nothing (well, except adding new elements to list of extra yields for plots that didn't have it set before, but that is not a good thing too). I couldn't find any function that could help with clearing or checking extrayields in vanilla dll (such functions exist, but they are not exposed to python). And there is no event fired before destroying map, so you have no way to know what plots was there before to clear yields blindly. It could be easily done for Windows by just clearing plots from dll itself though, and that will not require changing python code, so it will not break Mac (but will not fix this either).
The XML errors you're getting will be due to these modifications. I can send you my DLL source files if you want though.
I see. Well, I don't plan to make any mods myself. But if you have some ideas that require dll modification, I can help with that.
 
Btw, why in Cristo Redentor chared golden age code both sides are checked for having this wonder? Can it even work like that? Well, since there is no check if rival == player, it will at least increase player's own golden ages, but that's not what it is supposed to do.
 
But setPlotExtraYield doesn't actually sets extra yields, it adds them instead. Here is how it looks in code: (*it).m_aeExtraYield[eYield] += iExtraYield . So calling it with 0 as argument will actually do nothing (well, except adding new elements to list of extra yields for plots that didn't have it set before, but that is not a good thing too).

Oh, I hadn't noticed that. Rather annoying and quite out of line with how Civ usually names functions.

I couldn't find any function that could help with clearing or checking extrayields in vanilla dll (such functions exist, but they are not exposed to python). And there is no event fired before destroying map, so you have no way to know what plots was there before to clear yields blindly. It could be easily done for Windows by just clearing plots from dll itself though, and that will not require changing python code, so it will not break Mac (but will not fix this either).

Yeah, looks like it'll have to be a Windows-only fix. Will add to my todo list.

I see. Well, I don't plan to make any mods myself. But if you have some ideas that require dll modification, I can help with that.

Would you be willing to help me finish merging Advanced Diplomacy 2 into HR's DL? I've managed everything except for 1 function which is a bit beyond my ability and has led me to put the project aside indefinitely. Some further details in this thread.

Btw, why in Cristo Redentor chared golden age code both sides are checked for having this wonder? Can it even work like that? Well, since there is no check if rival == player, it will at least increase player's own golden ages, but that's not what it is supposed to do.

No idea what's happened there. That used to work fine but clearly I screwed it up at some point for some unknown reason. Fixed for 1.25, thanks again.
 
Would you be willing to help me finish merging Advanced Diplomacy 2 into HR's DL? I've managed everything except for 1 function which is a bit beyond my ability and has led me to put the project aside indefinitely. Some further details in this thread.
I'll see what I could do. You want AI to respond according to K-Mod rules but with extra trade types from AD, right?
 
I'll see what I could do. You want AI to respond according to K-Mod rules but with extra trade types from AD, right?

Exactly right. I really appreciate this, let me know if you want me to send you the rest of the source files.

Btw, you can ignore TRADE_POW and TRADE_CORPORATION as I'm not merging those.
 
Ok, I looked through both variants. K-Mod code is well commented and comprehensible, so no problems on that part. AD code is less comprehensible, but that is not a problem too since we are using K-Mod as a base. Now, about trade types - in AD AI_counterPropose there are only 2 extra trade types that are being considered for counter-offer - TRADE_CONTACT and TRADE_MILITARY_UNIT. Do you want to replicate this or do you want it to consider all of extra types excluding POW and CORPORATION? In second case some decisions need to be made about when it is appropriate to offer different types (it might be a bit strange to offer election votes when trying to end war, for example... or maybe it's ok, not sure since i'm not a politician :) ).
 
Ok, I looked through both variants. K-Mod code is well commented and comprehensible, so no problems on that part. AD code is less comprehensible, but that is not a problem too since we are using K-Mod as a base. Now, about trade types - in AD AI_counterPropose there are only 2 extra trade types that are being considered for counter-offer - TRADE_CONTACT and TRADE_MILITARY_UNIT. Do you want to replicate this or do you want it to consider all of extra types excluding POW and CORPORATION? In second case some decisions need to be made about when it is appropriate to offer different types (it might be a bit strange to offer election votes when trying to end war, for example... or maybe it's ok, not sure since i'm not a politician :) ).

I'm not sure. Most of the trading seems to be handled in AI_doDiplo and AI_dealVal, and AI_counterPropose is only used if the AI doesn't like the initial offer. It's been a while since I looked at it though, so my interpretation may be wrong. If I am right though , then I think TRADE_WORKER should perhaps be included as well, but not the others.

At this stage though I'd just be happy to have it working, and any balance or suitability implications can be figured out after everyone's played a few games.
 
If I am right though , then I think TRADE_WORKER should perhaps be included as well, but not the others.
Got it.
let me know if you want me to send you the rest of the source files
That would be helpful. There are a lot of dependencies that would take a lot of time to recreate to be able to check my changes by recompiling.
 
That would be helpful. There are a lot of dependencies that would take a lot of time to recreate to be able to check my changes by recompiling.

Attached.
 

Attachments

Ok, I added consideration for trading workers/units/contacts to counter-offer function (without restriction for war or peace). But one moment confuses me a bit, it is quite clear, that in AI_contactTradeVal first argument is supposed to be civ, contact to which is being offered, and second argument is offering civ. But for some reason, when evaluating contact and checking if civ is able to trade techs, embassies etc, it is offering civ that is checked instead of contact civ.
 

Attachments

Ok, I added consideration for trading workers/units/contacts to counter-offer function (without restriction for war or peace).

Thank you so much.

But one moment confuses me a bit, it is quite clear, that in AI_contactTradeVal first argument is supposed to be civ, contact to which is being offered, and second argument is offering civ. But for some reason, when evaluating contact and checking if civ is able to trade techs, embassies etc, it is offering civ that is checked instead of contact civ.

Hmm. That does sound like a bug.
 
Noticed, that recycling center does not remove pollution from mines and workshop. You have to remove and rebuild those to get rid of pollution. Seems to be due to python onBuildingBuilt code checking only specifically for public transportation instead of Polluting set.

Also, AI really underestimates pollution/unhealth. Started a game at digital era with one AI and it kinda killed itself without me doing anything. Well, it is not eliminated yet, but it has only one tiny city, splinter civ with 3 small cities, one or two tiny barbarian cities and a lot of deserts eveywhere. All because it happily built a lot of workshops everywhere and accumulated a lot of unhealth. And I don't think it even tried to build recycling centers, so this is not because of bug above. It was only normal difficulty, but still (and higher difficulty doesn't even gives health bonuses to AI iirc, so it will only be less revolts, but same amount of desertification).
 
An AI which was either friendly or pleased with me (I lost the save to confirm the attitude) declared war on me. It's strange because even after they declared war on me, they are still pleased with me. This is the first time I've had this happen so I'm wondering if it's a bug? I attached a save where they are both pleased with me and at war with me.
 

Attachments

Back
Top Bottom