Mod-Modders Guide to Fall Further

Thanks, however there doesn't seem to be one. I guess that the pillaging stuff is done in the dll.
 
Hi,

The "Dagda's Tears" are on the way to publishing (at the beginning of the way actually, but going fast, partly thank to you!).
However, I would like to do something, which I tried doing, but cannot seem to find how to do:
+ I would like at the beginning of each turn to be able to change the number of generated beakers a building produces, in python.
But I cannot seem to find a way to change the produced value (set in XML) in the python dynamically.

Any suggestion ?
 
void CyCity::setBuildingCommerceChange(int /*BuildingClassTypes*/ eBuildingClass, int /*CommerceTypes*/ eCommerce, int iChange)
 
Where do most of the equipment icons come from? They seem all related and I like their style. I'm looking forward to add some equipment thing in my civilization mod (for Orbis :p) and I'd like to use some of them :)
 
void CyCity::setBuildingCommerceChange(int /*BuildingClassTypes*/ eBuildingClass, int /*CommerceTypes*/ eCommerce, int iChange)

Thanks, that's perfect, and works as expected. :)
How come I cannot find it myself...hum.
 
If you just want to get a random plot, you can attempt to use:

.def("syncRandPlot", &CyMap::syncRandPlot, python::return_value_policy<python::manage_new_object>(), "CyPlot* (iFlags,iArea,iMinUnitDistance,iTimeout) - random plot based on conditions")


But I am not entirely certain how you'll get the right flags easily. Might be used somewhere in python already to provide a ready example though.
 
Is there a reason why all (or most of) the {mana}1 promotions have Channeling1 as a <PromotionPrereqAnd> rather than as <PromotionPrereq>? It seems to have no particular function and it adds an "and" before the icon in the pedia, which really ugly. Plus, I would like to have another promotion enabling access to some {mana}1 but not to all, so it's in my way.
 
Yes, that's a good idea. I'll do that.

Anyway, how can I add a little red text à la Arcane Lacuna or Stasis, stating how many turns are left before the effect of a spell (actually, Ngomele's worldspell) ends? I've a hunch that it's done in the DLL. If it is and is still complicated to do, I could use the interface messages to periodically say how many turns are left. Like "15 turns before the wave of extinction stops.", "10 turns...", "5 turns...", "Last turn...", "The wave stopped".

If you're interested xienwolf, the effect seem to be working great so far. I haven't done deep testing, just a few fights and it's really strong. Either it goes your way or the enemy's. Either you steamroll them or they steamroll you... if they all have a race, of course. BTW, I was thinking of checking for the possibility of the unit being human and, thus, having no race... I would like them to still be affected but I think many units without race aren't humans. I'll check but if you have any advice, I'll take it :)
 
Hmm. It looks like my adding two lines to the DLL reverted the hawk-ctd fix..... Used the files you had posted earlier, were those from the latest patch or the latest internal build? That's really the only thing I can think that would break it again :lol:.

Got the dll attached if you want to look at it... It'll load an FF game just fine.
 
You do that text in python, Assets/Python/Screen/CvMainInterface.py

You should be fairly safe saying "getRace() == None && isAlive()" as a "Human" catch-all. The isAlive lets you prevent considering ships and seige to be human. But this will include all animals still (so could add an isAnimal() check I suppose)

The files I posted here were MY files for the source, so didn't include the revision to prevent the Hawk CTD issue.
 
Hmmm, the effect is there but I can't get the message to show up. I did a bit of debugging but I have to go to bed (ah, life) so I can't do more for now. It seems that the ScenarioCounter isn't working and stay at 0 even after I changed it in the SpellInterface. Here are the functions:

CvSpellInterface.py
Code:
def spellEdgeOfExtinction(caster):
	gc.getGame().changeScenarioCounter(CyGame().getGameTurn())
	message = "Debug Counter: %d" %(gc.getGame().getScenarioCounter())
	CyInterface().addImmediateMessage(message,"")

CvEventManager.py
Code:
		for iPlayer in range(gc.getMAX_PLAYERS()):
			pPlayer2 = gc.getPlayer(iPlayer)
			if pPlayer2.isAlive():
				if pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_NGOMELE'):
					if pPlayer2.isFeatAccomplished(FeatTypes.FEAT_GLOBAL_SPELL) == True:
						iCurrentTurn = CyGame().getGameTurn()
						iElapsed = iCurrentTurn - gc.getGame().getScenarioCounter()
						iDuration = 20
						if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_QUICK'):
							iDuration = iDuration / 3 * 2
						if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_EPIC'):
							iDuration = iDuration * 3 / 2
						if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_MARATHON'):
							iDuration = iDuration * 3
						if iElapsed < iDuration:
							for iProm in range(gc.getNumPromotionInfos()):
								if pLoser.isHasPromotion(iProm):
									if gc.getPromotionInfo(iProm).isRace():
										iX = pLoser.getX()
										iY = pLoser.getY()
										for iiX in range(iX-3,iX+4,1):
											for iiY in range(iY-3,iY+4,1):
												pPlot = CyMap().plot(iiX, iiY)
												for iUnitLoop in range(pPlot.getNumUnits()):
													pUnit = pPlot.getUnit(iUnitLoop)
													if pUnit.isHasPromotion(iProm):
														pUnit.doDamage(40, 95, pWinner, gc.getInfoTypeForString('DAMAGE_PHYSICAL'), false)
														iRnd = CyGame().getSorenRandNum(1000, "Domino")
														if iRnd == 1:
															pUnit.kill(True, 0)

Screens/CvMainInterface.py
Code:
				if gc.getGame().getScenarioCounter() != 0:
					iTurnCasted = gc.getGame().getScenarioCounter()
					iCurrentTurn = CyGame().getGameTurn()
					iElapsed = iCurrentTurn - iTurnCasted
					iDuration = 20
					if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_QUICK'):
						iDuration = iDuration / 3 * 2
					if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_EPIC'):
						iDuration = iDuration * 3 / 2
					if CyGame().getGameSpeedType() == gc.getInfoTypeForString('GAMESPEED_MARATHON'):
						iDuration = iDuration * 3
					if iElapsed < iDuration:
						iCountSpecial += 1
						iRemaining = iDuration - iElapsed
						szBuffer = u"<font=2>"
						szName = "EdgeOfExtinctionTag"
						szBuffer = szBuffer + localText.getColorText("TXT_KEY_MESSAGE_EDGE_OF_EXTINCTION", (iRemaining, ()), gc.getInfoTypeForString("COLOR_RED"))
						szBuffer = szBuffer + "</font>"
						screen.setText( szName, "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, xResolution - 12, yCoord - ((iCount + iCountSpecial) * iBtnHeight), -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
						screen.show( szName )

Same file, somewhere above the above:
Code:
		if CyGame().getWBMapScript():
			szName = "GoalTag"
			screen.hide( szName )
		szName = "CutLosersTag"
		screen.hide( szName )
		szName = "DifficultyTag"
		screen.hide( szName )
		szName = "HighToLowTag"
		screen.hide( szName )
		szName = "DisableProductionTag"
		screen.hide( szName )
		szName = "DisableResearchTag"
		screen.hide( szName )
		szName = "DisableSpellcastingTag"
		screen.hide( szName )
# Ngomele start
		szName = "EdgeOfExtinctionTag"
		screen.hide( szName )
# Ngomele end

I suppose that CyGame().getGameTurn() is causing problem inside changeScenarioCounter() or that changeScenarioCounter() is causing problem itself.

(BTW, I hope my python doesn't look too bad :blush:)
 
I think the problem was that, when you getGameTurn(), it doesn't match the number displayed in the right corner. For turn 1, getGameTurn() is 0, and because I had a check to see if the ScenarioCounter was different from 0, it couldn't work. Also, the red sentence only appears the turn following the spell, is it normal? I can't remember if it is the same for Statis and Arcane Lacuna.
 
Text will appear for as long as you tell it to appear, so ideally you should have it show for the entire duration. Supposed to do so for Stasis/Lacuna. How you have it written I would expect it to show for 20 turns on Normal.
 
Back
Top Bottom