Modders Guide to FfH2

You could use the same process, but in base FfH that is a hardcoded Python setup. FF/RiFE use a DLL tag for the popups to make it easier to add new ones. It is about the same amount of work to initially implement either process, but using the pure python approach makes it harder to remember which ones need new art, and which art needs removed, whenever you add/remove events (Or just locate the one you want to change when updating something)
 
How does caster.changeImmortal() work?


Could caster.changeImmortal(-1) in a postCombat call prevent an immortal from being reborn if killed by a certain unit (e.g., an Angel of Death or the wielder of the Netherblade), or would it not take effect until after the unit was already reborn after that battle?


Could caster.changeImmortal(1) give immortality to a unit that is not normally immortal? Could it allow an immortal unit multiple rebirths per turn?
 
How does caster.changeImmortal() work?

Could caster.changeImmortal(-1) in a postCombat call prevent an immortal from being reborn if killed by a certain unit (e.g., an Angel of Death or the wielder of the Netherblade), or would it not take effect until after the unit was already reborn after that battle?

Could caster.changeImmortal(1) give immortality to a unit that is not normally immortal? Could it allow an immortal unit multiple rebirths per turn?

CombatWon occurs before immortal checks are considered. So reducing or adding to the immortal count in a postcombat call would take effect. You could both give the unit an immortal point to cause it to be reborn, or remove an immortal point to cause a normally immortal unit to die.

Yes the immortal counter can be used to give a unit multiple rebirths a turn.
 
Great, that's just what I was hoping for. Thanks.

(Now the Angels of Death in my version will be skilled as serving both purposes the Dullahan were designed for. They'll have Life II for Destroy Undead and immortals they kill won't be coming back. Too bad base FfH doesn't have postCombat calls for promotions like FF. Getting the Netherblade to bind souls to the Netherworld will be a bit trickier. I can easily prevent actual Immortals from being reborn, but all those units who get immortality from blood of the Phoenix will be trickier. It still won't be as hard as trying to rewrite Resurrection to give an option of what unit to bring back and making the Netherblade prevent that ressurection though I suppose.)


Oh, I just noticed there were a couple of less important related questions I left off. (Actually I wrote them but tried posting between unplugging the Ethernet cable and logging on to the wireless network, so the post was lost and I had to try again.)

Does the immortal promotion really just count towards the immortal count, or it is handled differently? Would reducing the immortal count prevent a unit with the immortal promotion from being reborn just as easily as those intrinsically immortal? Does removing the immortal promotion from a unit without killing it reduce it immortal count?

Are the immortal points reset each turn, or can they carry over? (If I were to make my version of Consume soul use caster.changeImmortal(1) instead of adding the immortal promotion, would that mean only immortality for the one turn or would it let them store up multiple immoralities for use later?)




Oh, also may I assume that if rebirth is handled after Combat won that onUnitKilled is too, so I could give the dying unit a promotion like Golem to prevent it from returning as an Angel or Mane?
 
Regarding adventurer, is it possible to spam adventurer named Volanna with a Promotion_DarkElf for her race (and thus apply any DarkElf unique graphics for her)? How can this be done in XML and/or Phyton?

Thanks.
 
Regarding adventurer, is it possible to spam adventurer named Volanna with a Promotion_DarkElf for her race (and thus apply any DarkElf unique graphics for her)? How can this be done in XML and/or Phyton?

Thanks.

In CvEventManager.py, under onUnitCreated (called whenever a unit is created, not just when one is built), you would add this:

Code:
		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ADVENTURER'):
			if unit.getNameNoDesc() == "Volanna":
				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DARK_ELF'), true)
 
In CvEventManager.py, under onUnitCreated (called whenever a unit is created, not just when one is built), you would add this:

Code:
		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ADVENTURER'):
			if unit.getNameNoDesc() == "Volanna":
				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DARK_ELF'), true)

And if I write
Code:
		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ADVENTURER'):
			if unit.getNameNoDesc() == "Gimli":
				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF'), true)
[/QUOTE]
then everytime Gimli is created, he will have Promotion_Dwarf? Cool! Thanks a lot!
 
Ah, nice. I was wondering a while back if I could allow units with specific names to have special spells, and I think that code means I can.


What would you think if in Magister Modmod the Great Sage by the name of Magister Cultuum had a spell that gave you a free Great Library (well, I of course call it The Library of Oghma), even without needing to have built libraries first? Or maybe if he could just give you Arcane Lore for free?
 
How is the name for adventurers generated? Randomly or in neat order, from name #1 (so first adventurer always Branding)?

@Magister :
If the roll for name is random, it is okay. So it would be a pure luck to get your in-game Avatar ;p but if the roll for name is not random, I think it would be better if you design a ritual. Upon completing it, the player get a Great Sage called as 'MagisterCultuum' with the special spell.

But able to build Great Library is a little bit OP, IMHO. How about the 'MagisterCultuum' gives Alternation freely? :D
 
I am trying to use the chipotle cheat code to debug some events. I cannot get even the ~ command to show the console.
I have tried
cheat = chipotle
cheatcode = chipotle
cheat=chipotle
cheatcode=chipotle

and nothing works. Is there something specific to FfH about using this function?
 
You shouldn't be typing the part on the left of the equal sign at all. Where are you trying to type this? You don't activate ingame, you activate in the .ini

The good news - I have gotten events with images to appear in game :), but without using the console to call up specific events I can't test most of them.

I am using cheat = chipotle, etc: in the ini. I'm not typing anything in game, just trying to use the ~ to bring up the console in game, which it doesn't. So FfH doesn't do anything to the cheat codes, it's just my ignorance screwing it up? :lol:
 
Aye, it should work exactly the same as in BtS.

Try holding CTRL and/or SHIFT while you move your mouse over tiles, cities and units. If you see extra information, then you have it activated and it is just ~ which isn't working for you. Also note that chipotle will not work in any form of multiplayer game, so if you are in a hotseat game to test out from multiple player views, you cannot use the cheatcode.
 
In CvEventManager.py, under onUnitCreated (called whenever a unit is created, not just when one is built), you would add this:

Code:
		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ADVENTURER'):
			if unit.getNameNoDesc() == "Volanna":
				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DARK_ELF'), true)

Just want to say 'thank you' again. I tried this and it works! :goodjob: I modified further to include race promotions. For human, I made promotions PROMOTION_HUMAN with no effect but setting the artstyle to match the adventurer's parent culture. Thus, Volanna upgraded will maintain Svart's artstyle. Very nice.

Here is the screenshot. I upgraded each adventurer into adept. And look, they get different artstyle! :excited:
 

Attachments

  • Civ4ScreenShot0011_crop.JPG
    Civ4ScreenShot0011_crop.JPG
    63.3 KB · Views: 63
I'm thinking of adding some affects to crime, for instance 1 unhappiness for each 10 crime rate in a city, and maybe chance of revolt based on crime rate. Would this require SDK work?

Hmm, I could probably do the unhappiness with custom buildings and events, but it would be fairly ugly...
 
It isn't something which would REQUIRE SDK work. But as with all things, it would be cleaner with it.

The revolt chance would just be a check each turn against a random number, so fairly clean even in just python. Not much overhead.

The angry faces you could probably do with Whip anger, but I think you can only affect the duration of that, not the quantity, and you wouldn't easily be able to track what the crime rate had been the turn before, so figuring out when it needs updated may be difficult.
 
Back
Top Bottom