[MOD] MagisterModmod

wardec.png
So I had a Non-Agression Pact w/ the AI. They then broke the pact and declared war on me. What is the pact for, if not preventing this?
 
I have an odd thing happening. I'm working on a big world. So instead of conquering and ruling all, I've set up a bunch of vassal states. One of these I started in the city that happens to have the Mercurian Gate. I'm at war with the Mercurians and their allies. But my vassal summons Mercurian reinforcements, and is not at war with the Mercurians and their team. So I kill off the Mercurians, and my vassal summons them again. And since I have complete kills enabled, and it's a big world, and there are units scattered all over the damned place, it's taking a long time to find and kill all each civ's units. And in the meantime my vassal keeps reinforcing my enemies....
 
Is there a way for a building in a city to apply more than one promotion to units that are built in the city?

The Tablets of Bambur grant Guerilla II to units built in the city. But they don't grant Guerilla I. So when a unit built in the city then goes to upgrade, Guerilla I is shown as an option. I presume the intent is to apply both Guerilla promotions cumulatively but that isn't happening. I went and looked in the XML for the Tablets and here is what I found:

<FreePromotion>PROMOTION_GUERILLA2</FreePromotion>
 
I think it is normal.
doesn't guerilla 2 give 2 mvt in hills ? I think it is the effect sought after.
for that, you don't need the further 40% combat in hills of guerilla 1.

:D
 
Javelin Throwers should have a higher draft priority than axemen. It doesn't make sense that building a Training Yard gives me a cheaper unit to draft than if I hadn't built it.
 
Kylorin would roll in his grave if he wasn't immortal: I just managed to convert the Amurites to the White Hand, completely voluntarily, just by bribing them with a tech. One would think the Amurites of all people would be the most distrusting of the Illians' attempts at starting another age of ice, but in this game they are my very best friend.

The witch event happens a little too often for my taste, I got like a dozen Witch Hunters out of it.
 
Th Amurite leaders do have a -99 weight towards The White Hand, which is as negative a weight as can be given without making it impossible even for human players to adopt a religion. I thought Kael said a -99 would mean an AI would never ever choose to adopt it, but maybe it works differently through diplomacy.


Yeah, right after releasing this I decided that the Witch Hunters were much too easy to get. I decided to make them Balseraph only, since the text used for the existing Balseraph-only option was from the same Monty Python scene as I used for heir pedia entry.

I also noticed that I accidentally omitted a - sign in the code that adjusts other player's attitudes towards you, so arcane leaders wrong like you more for usign witch hunters.

The units are still available from the other event, for turning down Gaelan.
 
I believe the Crown of Akharien's Civilopedia entry has a typo, claiming that "the strong need no suck knowledge".

Edit: Also how come the Crown is only available with Arcane Lore when the Civilopedia claims the new Laeran Cord was founded early in the Age of Rebirth? Matter of fact, wouldn't it make more sense if its effects were weaker but it is available through exploring a dungeon instead?

Unrelated edit: Enchantment 3 allows a unit to enchant a spellstaff, which it can break in order to cast again that round. It can do that the same round, so a unit with Enchantment 3 could theoretically create a spellstaff, break it, creater another, break that one, create another and so one for an infinite number of times in the same turn. Obviously a human wouldn't do that, but is there anything safeguarding the AI from getting stuck in an infinite loop that way?
 
Last edited:
two python exceptions, easily testable via worldbuilder, I believe: 1. on casting hope from royal guard and 2. on attempt to dominate a demon ( with special spell)

population hard cap is 140: AI duke sallos is not adding manes to pop anymore but sends at the field. It aint right. probably lacks financing for upgrades.
 
Last edited:
I'm certainly not getting an exception from casting Hope with a Royal Guard. I haven't tested the other yet.

Can you provide your PythonErr.log file from the game with those exceptions? And maybe a saved game, MPLog.txt, and BBAI - [player name].txt too?
 
Ok, I think if figured out the problem.

In both cases, the bug comes from the statement "if pUnit.isImmuneToSpell(pCaster, eSpell):continue"

bool CvUnit::isImmuneToSpell(CvUnit* pCaster, int spell) const is not written to take in account the possibility that spell could be undefined.


In the case of Hope the problem comes from the fact that I did not pass on eSpell to the PyHelp function, but let it revert to the default of -1.

You can fix this easily by replacing (lpUnits)</PyHelp> with (lpUnits, eSpell)</PyHelp> in Civ4SpellInfos.xml

For the Demon Lord Domination spell, the xml defines do pass the eSpell variable through <PyRequirement>reqDemonLordDominationDemon(pCaster, eSpell)</PyRequirement>, but I opted to make the code cleaner by making it reference reqDominationDemon(pCaster) and forgot to pass on eSpell there too.

You can fix this by editing line 4400 of CvSpellInterface.py to change "return reqDominationDemon(pCaster)" to "return reqDominationDemon(pCaster, eSpell)"
 
I think it is normal.
doesn't guerilla 2 give 2 mvt in hills ? I think it is the effect sought after.
for that, you don't need the further 40% combat in hills of guerilla 1.

:D

It just seems strange to me to give Guerilla 2 but not Guerilla 1. I was wondering if the intention specifically was only to give one of the two?

If not, I'd still like to mod for myself to have the Tablets of Bambur give both but I'm not sure if that is possible with buildings right now, that is, to give two promotions?
 
The main point was to make it easier for units to purchase Mountaineer, without being so overpowered as giving Mountaineer to everyone.


It is not possible through XML alone, but would not be difficult to apply both promotions through python. You can check out CvEventManager.py under def onUnitCreated(self, argsList): around line 2943 for examples. If you only want to apply multiple promotions only to units who would otherwise be able to purchase it or get it through xml, you could use .canAcquirePromotion(iProm) like this:

Code:
            if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_TABLETS_OF_BAMBUR')) > 0:
                for iProm in [gc.getInfoTypeForString('PROMOTION_GUERILLA1'), gc.getInfoTypeForString('PROMOTION_GUERILLA1')]
                    if unit.canAcquirePromotion(iProm):
                        unit.setHasPromotion(iProm , True)
 
Thanks, Magister -- much appreciated.

I've noticed some of the mapscripts have a lot of issues. PerfectWorld in particular is still throwing Python errors for me and warning me upon map generation that "a rare bug" happened and the world generation was probably unfair -- but I get this message every time.

Are there still known issues with various mapscripts? Which mapscripts do you tend to stick with?
 
Fatal Map Error

I am about 700 turns into my first game of Magister in awhile (love it!), and had a great game going until I clicked for the grid map. Magister immediately crashed. I went to reload the saved game from just before I had clicked on the grid ..... and it crashed. So, I went back to a previous Magister save several turns earlier ... and it crashed. I tried to start a brand new Magister game ... and it crashed. So, I loaded the vanilla ffh2 instead and it started up just fine. Then, I went back to Magister ... and it crashed. When loading, everything looks fine until the final part when, logically, the map would show. Yet, ffh2's vanilla map works fine. Is there any way of getting this to work without losing 700 turns? Does it have to be deleted and re-downloaded? It's obviously the grid because the crash was immediate. I don't understand why the saves before the grid click won't load. Any help would be appreciated.
 
Last edited:
Fatal Map Error

I am about 700 turns into my first game of Magister in awhile (love it!), and had a great game going until I clicked for the grid map. Magister immediately crashed. I went to reload the saved game from just before I had clicked on the grid ..... and it crashed. So, I went back to a previous Magister save several turns earlier ... and it crashed. I tried to start a brand new Magister game ... and it crashed. So, I loaded the vanilla ffh2 instead and it started up just fine. Then, I went back to Magister ... and it crashed. When loading, everything looks fine until the final part when, logically, the map would show. Yet, ffh2's vanilla map works fine. Is there any way of getting this to work without losing 700 turns? Does it have to be deleted and re-downloaded? It's obviously the grid because the crash was immediate. I don't understand why the saves before the grid click won't load. Any help would be appreciated.

You can unload the mod and start up a bts game and turn off the grid, then start up magister again to make it the game work again.
 
"We love the Prime Minister" sounds a little weird when I am running Theocracy as Auric Ulvin. Wouldn't it make more sense to change it to "We love our God" or something?
 
Man. I played some Civ VI and after completing a game it just got me more and more excited for MMM FFH2. Already completed a game as the Illians, one as the Calabim and one as the infernal. This is so good. I just keep coming back. Great work Magister!
 
Back
Top Bottom