[MOD] MagisterModmod

I have to say that I love the randomization of city names. I recently came across a Calabum city called "Don'tgonearthecastle."
 
I have to say that I love the randomization of city names. I recently came across a Calabum city called "Don'tgonearthecastle."

It is only the order in which the names are given that is randomized. (Technically, the cities are renamed in python just after being settled. It does not work for cities created in worldbuilder. I also chose to exclude the capital, as there are multiple references in the lore to the names of the capital cities of several civs.)

Spoiler :
Code:
	def onCityBuilt(self, argsList):
		'City Built'
		city = argsList[0]
		pPlot = city.plot()
		iPlayer = city.getOwner()
		pPlayer = gc.getPlayer(iPlayer)
		iCiv = pPlayer.getCivilizationType()

		if not city.isCapital():
			listCityNames = []
			CivFile = open("Mods/Magister Modmod for FfH2/Assets/XML/Civilizations/CIV4CivilizationInfos.xml")
			bCiv = False
			for line in CivFile.readlines():
				if "<Type>" in line:
					sCiv = line[line.find(">") +1 : line.find("</")]
					if iCiv == gc.getInfoTypeForString(sCiv):
						bCiv = True
					else:
						bCiv = False
				elif bCiv:
					if "<City>" in line:
						txtKeyCity = line[line.find(">") +1 : line.find("</")]
						sName = localText.getText(txtKeyCity, ())
						bUsed = False
						for iLoopPlayer in range(gc.getMAX_PLAYERS()):
							pLoopPlayer = gc.getPlayer(iLoopPlayer)
							(loopCity, iter) = pLoopPlayer.firstCity(False)
							while(loopCity):
								if not loopCity.isNone(): #only valid cities
									if loopCity.getName() == sName:
										bUsed = True
										break
								(loopCity, iter) = pLoopPlayer.nextCity(iter, False)
							if bUsed:
								break
						if not bUsed:
							listCityNames.append(txtKeyCity)
			if len(listCityNames) > 0:
				txtKeyCity = listCityNames.pop(CyGame().getSorenRandNum(len(listCityNames), "Name city"))
				sName = localText.getText(txtKeyCity, ())
				city.setName(sName, False)

The names themselves still have to be listed in CIV4CivilizationInfos.xml.

(Actually the TXT_KEYs are listed in the civilization defines and the names to which those TXT_KEYs refer are found in a text file. You could define a city name in any xml file in the Text folder, but only CIV4GameText_FFH2.xml and Magister_CIV4GameText_FFH2.xml actually do so.)


I added "Don'tgonearthe Castle" to the list of Calabim city names as an homage to home of the Magpyre clan of vampires from Terry Pratchett's Carpe Jugulum, just after I finished reading that book.
 
I have encountered a strange bug while playing Calabims. Some of my recently conquered cities have a *negative* production and it keeps on decreasing (or increasing in absolute value).
For instance in the screen shot below, current production is -50, but was -40 the previous turn.

What is the problem (and is there a fix)?

I tried to reproduce the problem and it is very easy to do that. It seems related to the Pillar of chains (or maybe with the prod from unhappy polulation feature).

Start a new game with Calabims, create 6 cities in WB, add the Pillar of Chains to one of your cities and after a couple of turns one or more of your cities (up to 3 in my experiments) will get a negative production. Strangely I also had the problem with some others civs (Ljos), but I was unable to reproduce it with the clan, for instance. In this case, the problem was only located in the city with the pillar.

I tried in vain to find the problem in the assets dir. The problem is that this bug makes the game presently unplayable (at least while using the pillar of chains).
 
Yeah, but if he happens to survive past that he's just an axeman. This isn't really important to balance since the best use of Lucian is always going to be early rushing which has a high chance of getting him killed, but sometimes I like to save units from the early game and make them into immortals or whatever.

He's not the only hero who declines to irrelevancy. Gilden Silveric and Rantine are also irrelevant in the late game, for example. (It always seemed odd to me that the three civs with the earliest heroes are the two rush civs and... the most builder-y of builder civs.)
 
He's not the only hero who declines to irrelevancy. Gilden Silveric and Rantine are also irrelevant in the late game, for example. (It always seemed odd to me that the three civs with the earliest heroes are the two rush civs and... the most builder-y of builder civs.)

True, I guess it'd make more sense to me if all the heroes could be upgraded. It doesn't make much sense that Gilden can never learn to use a longbow. Well, actually it kind of does since learning to be a proper longbowman without having been raised for the job was kind of impossible, but this is a fantasy game.
 
I encountered an interesting variation of the Waiting for Other Civilizations bug yesterday that I think might help in figuring out where it's coming from. (This is on the most recent revision.) What happens in the attached save game is that, when you end turn 228 the game will go *entirely* into the next turn (229)--I discover a new tech, all information updates--and *then* the Waiting for Other Civilizations message appears, even though it's clear all AIs have already made their moves. Some functions were still available, so I even managed to get a save on the turn with the Waiting for Other Civilizations bug having already happened.

Thoughts?

Using the latest version, I get this bug too. If I go back a couple of turns, and replay through, the turn then proceeds as normal, but not if I reload the previous turn. This means that whatever is causeing the 'waiting for other civs' freeze is related to a units action, rather the a particular building. I have included the only logs that this error gave. Spent a lot of time on this gave, shame to give it up.

Cheers

Edit: Playing as the calabim I took over the EMPYREAN holy city, and am now getting the occasional message 'trying to overthrow vampiric oppressors'. I cannot see that this is actually doing anything, so just wonder what going on, ie is there a chance to lose the city/things I can do to combat the problem (I really want to keep the city as the previous owner was kind enough to build the dies wonder for me).

Edit 2: Got to a point where the game would not continue on (waiting for other civs error), so in a desperate attempt to save my game I went into the world builder and started deleting.

1. Finally discovered that if I removed the clan of embers the game would continue.

2. Because none of their cities were finishing anything, I started deleting their units.

3. Found that a particular wolf rider was the culprit, and simply removing this one unit allowed me to continue. I had a look the wolf rider to see if there was anything of particular note, and it had the flanking 3 promotion, but more importantly (I think) it was going past the pristine pass unique feature. Anyway see a bit weird but will see if this has eliminated the error.
 

Attachments

Hi Magister,

I was having a fun time as the Svarts running over the map. I decided that the best course of action would be for some hidden nationality units to visit the Ljosalfar, where they would carry on a philosophical discussion about reuniting the elves.

Sadly, when I cast Veil of Night, nothing happened. None of my units gained HN, or any other promotion.

I have attached a save.

Thanks in advance for your time.
 
Using the latest version, I get this bug too. If I go back a couple of turns, and replay through, the turn then proceeds as normal, but not if I reload the previous turn. This means that whatever is causeing the 'waiting for other civs' freeze is related to a units action, rather the a particular building. I have included the only logs that this error gave. Spent a lot of time on this gave, shame to give it up.

Cheers

Edit: Playing as the calabim I took over the EMPYREAN holy city, and am now getting the occasional message 'trying to overthrow vampiric oppressors'. I cannot see that this is actually doing anything, so just wonder what going on, ie is there a chance to lose the city/things I can do to combat the problem (I really want to keep the city as the previous owner was kind enough to build the dies wonder for me).

Edit 2: Got to a point where the game would not continue on (waiting for other civs error), so in a desperate attempt to save my game I went into the world builder and started deleting.

1. Finally discovered that if I removed the clan of embers the game would continue.

2. Because none of their cities were finishing anything, I started deleting their units.

3. Found that a particular wolf rider was the culprit, and simply removing this one unit allowed me to continue. I had a look the wolf rider to see if there was anything of particular note, and it had the flanking 3 promotion, but more importantly (I think) it was going past the pristine pass unique feature. Anyway see a bit weird but will see if this has eliminated the error.

PythonErr2.py is almost never of any use to anyone.

It is fairly common, unfortunately, for a specific unit to get stuck in an AI loop or something like that. The easiest way to identify those units is using BBAILog - [insert player name here].txt (before the last release of MNAI, this would just be BBAI.log), looking at the bottom of the file and finding the unit ID of the unit that is listed multiple times. You can then open worldbuilder, go to that unit's owner's player data screen, go to Units + Cities, and locate that unit in the unit table by its ID, and delete it. (I think that in the last release you still have to select the unit and go to the unit data screen in order to have the option to delete it, but in the version on my computer I changed things so that you can delete the problem units from the Units + Cities screen directly.)


The Empyrean revolts in Calabim cities should cause a small increase to the occupation timer, hurry anger, and revolution index.

It won't destroy buildings, but if the advanced tactics game option is active then there is a chance of a revolution causing you to loose the city to rebels.

You can completely eliminate the risk by building the Pillar of Chains or Tower of Complacency wonders in the city, or by having a unit cast Unyielding Order there. (If it wasn't the holy city, then you could also emininate the issue by eliminating the religion. That could be done most effectively through the Inquisition ability or Purge of the Unfaithful ritual, but there is also a chance of it being randomly removed by the spread of the Council of Esus or Ashen Veil religions or by the vampire's Feast ability.)

Spoiler :
Code:
				if pCity.getNumBuilding(iComplacency) > 0 or pCity.getNumBuilding(iUnyielding) > 0:
					iChange = -9
					pTimer = pCity.getHurryAngerTimer()
					if pTimer < 9:
						iChange = 0 - pTimer
					pCity.changeHurryAngerTimer(iChange)
					pCity.setOccupationTimer(0)
					CyGame().changeCrime(-5)
					if pCity.getRevolutionIndex() > 0:
						pCity.setRevolutionIndex(0)

				elif pCity.getNumBuilding(iChains):
					pCity.setOccupationTimer(0)
					CyGame().changeCrime(-5)
					if pCity.getRevolutionIndex() > 0:
						pCity.setRevolutionIndex(0)
				else:
					if pCity.isHasReligion(iDragonCult):
						if not self.isHasDragon(pPlayer):
							iRnd = CyGame().getSorenRandNum(100, "Dragon Cult Revolt")
							if iRnd < 2:
								pCity.changeOccupationTimer(iRnd)
								pCity.changeHurryAngerTimer(iRnd)
								CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_DRAGON_CULT_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Acheron.dds',ColorTypes(7),iX,iY,True,True)
[COLOR="Red"]					if pCity.isHasReligion(iEmpyrean):
						if iCiv == iCalabim:
							iRnd = CyGame().getSorenRandNum(100, "Empyrean vs Vampire revolt")
							if iRnd < 4:
								pCity.changeOccupationTimer(iRnd)
								pCity.changeHurryAngerTimer(iRnd)
								pCity.setRevolutionIndex(pCity.getRevolutionIndex() + iRnd)[/COLOR]
								CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_EMPYREAN_REVOLT", (pCity.getName(),)),'',1,'Art/Interface/Buttons/Units/Priest Empyrean.dds',ColorTypes(7),iX,iY,True,True)
					if pCity.isHasReligion(iOne):
						iRnd = CyGame().getSorenRandNum(75, "Monothiest Revolt")
						if pCity.getNumRealBuilding(iMartyrs) > 0:
							iRnd *= 2
						if iRnd < 5:
							for iTarget in range(gc.getNumReligionInfos()):
								if iTarget != iOne and pCity.isHasReligion(iTarget):
									if self.removeReligion(iTarget, pCity):
										CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_MONOTHIEST_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Inquisitor Grigori.dds',ColorTypes(7),iX,iY,True,True)
										iRnd += 1
										if iStateReligion == iTarget:
											pCity.changeOccupationTimer(iRnd)
											pCity.changeHurryAngerTimer(iRnd)
							if pCity.getNumBuilding(iPaganTemple):
								pCity.setNumRealBuilding(iPaganTemple, 0)
								iRnd += 1
							if iRnd >= 1:
								pCity.changeHurryAngerTimer(iRnd)

					if pCity.isHasReligion(iHand):
						if bAuricRevolt:
							if CyGame().getSorenRandNum(100, "Auric Revolt") < 15:
								pCity.changeOccupationTimer(3)
								pCity.changeHurryAngerTimer(1)
								CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_AURIC_REVOLT", ()),'',1,'Art/Interface/Buttons/Units/Auric Ascended.dds',ColorTypes(7),iX,iY,True,True)
I just noticed that you could get the message when iRnd equals 0, in which case it would have no actual effect. I'll change this now.

Hi Magister,

I was having a fun time as the Svarts running over the map. I decided that the best course of action would be for some hidden nationality units to visit the Ljosalfar, where they would carry on a philosophical discussion about reuniting the elves.

Sadly, when I cast Veil of Night, nothing happened. None of my units gained HN, or any other promotion.

I have attached a save.

Thanks in advance for your time.

I think this is due to a typo in CvSpellInterface.py where I accidentally wrote iCoe instead of iCoE.
iCoE.

Spoiler :
Code:
def spellVeilOfNight(pCaster):
	iHN = gc.getInfoTypeForString('PROMOTION_HIDDEN_NATIONALITY')
	iStealth = gc.getInfoTypeForString('PROMOTION_STEALTH')
	iMark = gc.getInfoTypeForString('PROMOTION_MARKSMAN')
	iCoE = gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS')
	pPlayer = gc.getPlayer(pCaster.getOwner())
	(pUnit, iter) = pPlayer.firstUnit(False)
	while(pUnit):
		if ( not pUnit.isDead() ): #is the unit alive and valid?
			if pUnit.baseCombatStr() > 0:
				pUnit.setHasPromotion(iHN, True)
				pUnit.setHasPromotion(iStealth, True)
				if pUnit.getReligion() ==-1:
					pUnit.setReligion(iCo[COLOR="Red"]E[/COLOR])
				if pUnit.getReligion() == iCo[COLOR="Red"]E[/COLOR]:
					pUnit.setHasPromotion(iMark, True)

		(pUnit, iter) = pPlayer.nextUnit(iter, False)
 
Thanks for the help. Got the problem again and did as you said. Worked perfectly.

Also, just wanted to congratulate you on the huge-all civs map. Really enjoying it.
 
I am currently uploading another update. This includes Platyping's Worldbuilder version 3.19, plus some worldbuilder changes on my own. It also fixes a few bugs that have already been discussed in this thread. It is a fairly minor release, but I believe that the addition of a few random events will make it incompatible with previous releases.


You may download the Installer here or the Archive here
 
I found a bug, easy to reproduce with the WB.
If a unit with the 'Fear' promotion attacks a stack and kills a mob, the complete stacks flees one tile away. But if there is no place to flee, the stack just disappears....
One of my summoned wraith "destroyed" in one shot a stack of 20+ axemen in a penisula this way.
 
That is not a bug of this modmod. It is a feature which Kael added to FfH2 a long time ago. I'm not sure why.

Edit: Ok, I now notice that in patch o Kael was supposed to have changed this to the units just stay in place. It could be that Tholal did not include this fix in the MNAI DLL. Still, it has nothing to do with me or my modmod in particular.
 
When I click on the links, then click download I get this error message : Sorry, but this is not the correct link to the file you were looking for. Please use the original sharing link from the file owner.
When I click on your name on cx, then on one of your public files like the April 2013 version, I can download it just fine. What am I doing wrong?
 
Let's talk about the angels.

In a recent game, the Grigori built the gate and summoned Basium. As far as I can tell, they never gave Basium any cities. Occasionally, the Basium unit, by itself, would run into my territory and pillage an improvement or something. I'd turn around and kill it with some horse archers. Then a few turns later it would happen again.

At some point, I sent a hawk over Midgar. That city has 268 angels w/ no exp or metal weapons.

That seems a little absurd.

Also, I kill Basium while he is allied w/ the Grigori (with whom I am at war) and the Elohim use their gate to bring him back, does that break the peace treaty I signed a turn ago w/ the Elohim?
 
Also re: the Grigori. I guess there's something going on where archers get summoned if you move onto a Grigori homestead. That's fine and cool, but it doesn't work as well as the FoL treants. In FoL, if you move a unit into a unit into an ancient forest you might get a treant or not, but moving subsequent troops doesn't cause another roll for treants.

In the homestead, it appears that a new role occurs every time a unit movements onto a homestead you get another roll to see if a Grigori unit pops up or not. If the unit does pop up then all the existing units you've already moved onto the homestead move off. It also appears that multiple Grigori units may pop up if you move multiple units onto a homestead.

All this makes moving through Grigori land nearly impossible.
 
It is very difficult to make some undercouncil resolutions adopted. In a recent game, I was unable to have the gambling ring adopted. After a first fail, I (generously) gave mathematics to all civs that were missing it, but it did not change the result. Ditto for the smuggling ring. I can understand that a purely terrestrial civ votes against it, but not a civ that have 2 or 3 cities on the seashore. And I remember another game while playing Balseraphs, where I was unable to have the slave resolution adopted. It is a bit weird as all these resolutions can benefit any civ that have the prerequisites.

Also, it happens frequently that vassals vote against a resolution submitted by their master. It should not happen IMHO.
 
Back
Top Bottom