Modders Guide to FfH2

Ok, I still can't get it to work. I did your changes Jean but then got this:

Code:
File "CvEventManager", line 23, in onEvent

File "CvEventManager", line 213, in handle Event

File "CvEventManager", line 1911, in onCorporationSpread

Argunent Error: python argument types in Cyplayer.initTriggeredData(CyPlayer,tuple)
did not match C++ signature:
initTriggereddata(classCyplayer{lvalue}, int, bool, int, int, int, int, int, int, int, int, int)

Here is my new code. Did I do anything wrong?
Code:
	def onCorporationSpread(self, argsList):
		'Corporation Has Spread to a City'
		iCorporation, iOwner, pSpreadCity = argsList
		player = PyPlayer(iOwner)

		iDragon = gc.getInfoTypeForString('CORPORATION_CULT_OF_THE_DRAGON')
		if iCorporation == iDragon:
			pPlayer = gc.getPlayer(iOwner)
			iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_CULT_SPREAD_1')
			triggerData = pSpreadCity.initTriggeredData((iEvent, true, -1, -1, -1, iOwner, -1, -1, -1, -1, -1))
			CyInterface().addMessage(pSpreadCity.getOwner(),True,25,CyTranslator().getText("TXT_KEY_MESSAGE_CULT_SPREAD_1", ()),'',1,'Art/Interface/Buttons/Corporations/CultoftheDragon.dds',ColorTypes(8),pPlot.getX(),pPlot.getY(),True,True)
			pPlayer.setHasTech(gc.getInfoTypeForString('TECH_DRAGON_CALL'))

		if (not self.__LOG_RELIGIONSPREAD):
			return
		CvUtil.pyPrint('%s has spread to Player %d Civilization %s city of %s'
			%(gc.getCorporationInfo(iCorporation).getDescription(), iOwner, player.getCivilizationName(), pSpreadCity.getName()))
 
You have two () for initTriggeredData.
 
Thanks for the help but now I have something that I have never seen before. The code appears to work fine now but it doesn't trigger the event.

Edit: Came to me, it was an XML error. All I had to do was unselect a few tags in the event files.
 
Is it save to use getActivePlayer or getActiveCivilizationType for the mere displaying of stuff in the pedia? I'm always a bit scared of these two functions, because it's very easy to run into OSS errors, if you use them at the wrong place, but sometimes it would be nice to have them available, if there is no other way to get the player or the civ.
 
You have to be careful with using them in the Pedia since you can open the Pedia without the ActivePlayer being assigned any serious values (no game started yet). But basically anything which is JUST display is completely free game for doing as you want.
 
What parts of the code are responsible for unit capturing? It's the first of many such features I would like to extract to use in other mods.
 
You mean slaves, equipment, spawning (Werewolves/Lightning Elementals), or Command? Each is handled differently.

Command is what I'm looking for.
 
It is handled in the DLL, I can point you at specifically where if you want to venture into DLL land. But basically you just search for the tag which sets it up in the XML and everything points itself out pretty nicely.
 
It is handled in the DLL, I can point you at specifically where if you want to venture into DLL land. But basically you just search for the tag which sets it up in the XML and everything points itself out pretty nicely.

Yes, I have done that but I wanted to make sure it's as simple as that. Also if there are other FfH2 specific things I'd need to watch for. Like this:
Code:
if (iUnit == NO_UNIT && pLoser->isAlive())
Am I right that this refers to living vs. demon/undead/machine unit races and thus I would not use that part?
 
Correct, that refers to the undead stuff. Could still be useful if you want to block capture of Seige units, but typically that is exactly what people DO want to capture.

Still want to do the iUnit != NO_UNIT check obviously :)
 
Correct, that refers to the undead stuff. Could still be useful if you want to block capture of Seige units, but typically that is exactly what people DO want to capture.

Still want to do the iUnit != NO_UNIT check obviously :)

Yes, machines are what I'd be looking to capture. Space ships actually.
So if I follow "CombatCapturePercent" and anything associated with that I should find all the capture code?
 
If I was planning to make a new civ complete with leader and uu ub's and have no prior experience modding,
where should I start?
 
oh yeah,
I have the basic idea for the civ and what i want to do, just don't know where to start (civ,leader,other stuff)
 
Back
Top Bottom