Modders Guide to FfH2

If you place lairs or unique improvements but turn on randomization, will it reposition them or just place new ones?

Place new ones along with the old ones.
 
Midgame, or just in general?


Midgame, look at the code for how Adaptive works in Assets/Python/CvEventManager.py. In general, look in Assets/XML/Civilizations/CIV4LeaderHeadInfos.xml and just add another trait to the leader you want.
 
Am I reading the code wrong again (theme for the weekend) or is this backwards?

Code:
                            if (getPlayerRank((PlayerTypes)iI) <= (countCivPlayersAlive() / 3) && getHandicapType() < (GC.getNumHandicapInfos() - 1))
                            {
                                setHandicapType((HandicapTypes)(getHandicapType() + 1));
                                changeFlexibleDifficultyCounter(getFlexibleDifficultyCounter() * -1);
                            }
                            if (getPlayerRank((PlayerTypes)iI) > (countCivPlayersAlive() * 2 / 3) && getHandicapType() > 0)
                            {
                                setHandicapType((HandicapTypes)(getHandicapType() - 1));
                                changeFlexibleDifficultyCounter(getFlexibleDifficultyCounter() * -1);
                            }

Looks to me that it says "If you are in the bottom 1/3 of the score ranking, RAISE the difficulty. But if you are in the top 1/3 of the score ranking LOWER it instead"

EDIT:

Also, this doesn't account for the Game Option "Require Complete Kills"

Code:
    if (GET_PLAYER(pOldCity->getOwner()).getNumCities() == 1)
    {
        changePlayersKilled(1);
    }
 
Am I reading the code wrong again (theme for the weekend) or is this backwards?

Code:
                            if (getPlayerRank((PlayerTypes)iI) <= (countCivPlayersAlive() / 3) && getHandicapType() < (GC.getNumHandicapInfos() - 1))
                            {
                                setHandicapType((HandicapTypes)(getHandicapType() + 1));
                                changeFlexibleDifficultyCounter(getFlexibleDifficultyCounter() * -1);
                            }
                            if (getPlayerRank((PlayerTypes)iI) > (countCivPlayersAlive() * 2 / 3) && getHandicapType() > 0)
                            {
                                setHandicapType((HandicapTypes)(getHandicapType() - 1));
                                changeFlexibleDifficultyCounter(getFlexibleDifficultyCounter() * -1);
                            }

Looks to me that it says "If you are in the bottom 1/3 of the score ranking, RAISE the difficulty. But if you are in the top 1/3 of the score ranking LOWER it instead"

Looks good to me.

EDIT:

Also, this doesn't account for the Game Option "Require Complete Kills"

Code:
    if (GET_PLAYER(pOldCity->getOwner()).getNumCities() == 1)
    {
        changePlayersKilled(1);
    }

True enough, dont play with require complete kills, its not fun. ;)
 
I used to play with require complete kills on. in my last 0.33 game though the Clan lived for the whole game despite being killed by the hippus very early on, thanx to a lone workboat wondering around. that made me see the error of my ways :lol:
 
The source code for patch b is still missing. Are you going to upload it soon or is c already on the horizon?

"b" is up, but "c" will probably be uploaded before the end of the day too.
 
It has been brought to my attention FfH has a Flexible and a Raising Difficulty Level Option. Would it be possible to add these options in, say, MOO2Civ mod and how would I go about doing this?:confused:
 
It has been brought to my attention FfH has a Flexible and a Raising Difficulty Level Option. Would it be possible to add these options in, say, MOO2Civ mod and how would I go about doing this?:confused:

Yeap, let me see if I can put something together for you.
 
It would be fairly simple, as long as you already modify the DLL comfortably. All of the important code is in CvGame.cpp under CvGame::doTurn. Just check CvEnums.h for the specific name of the Gameoption (fairly easy to figure out which one it is) and then find where that gameoption is mentioned again in the code.

EDIT: nm, Kael ninja-posted me during the morning Bagel ;)
 
Yeap, let me see if I can put something together for you.

That would be great.:)

@xienwolf: I don't have any experience modifying dll files. All I've done so far personally is release xml-related patches and make the MOO2Civ mod a Full Install by including necessary Final Frontier files. (Luckily I've gotten the occasional help offer, for instance with the 3.17 patch.) I'm still learning, though.
 
That would be great.:)

@xienwolf: I don't have any experience modifying dll files. All I've done so far personally is release xml-related patches and make the MOO2Civ mod a Full Install by including necessary Final Frontier files. (Luckily I've gotten the occasional help offer, for instance with the 3.17 patch.) I'm still learning, though.

I pulled the source code out for these options and added it to the Assimilation mod. You can get it here: http://forums.civfanatics.com/showthread.php?t=281289

The source code is provided, though if your mod doesn't use a DLL you can just use the one from Assimilation to get the functionality (it doesnt change anything about the game except to add the game options).
 
Cool! Thx very much!:) (I had heard of the Assimilation mod, but didn't know if and how I should 'assimilate' it.)

BTW, I like FfH very much - I think it has wonderful artwork and an original style -, and although I can't find the time to play it very often, I'm keeping an eye on it's development. Keep it up!:goodjob:
 
Is there some function I could use to simulate combat or get the combat odds of a fight between 2 units on the same tile owned by the same civ? I recently added a "Challenge" spell to let Doviello melee units fight and potentially kill each other for xp, but I'd like it to take the units actual strength into account. Letting a warrior have the same odds of taking down a battlemaster as another battlemaster does seems wrong, as does giving out the same amount of xp to the victor. I'd also like to know how to make units choose the toughest unit in their stacks to fight instead of just picking the first one with higher base strength or xp or having to guess as to how to take strength and various promotions into account when looping though them all to decide who is toughest.
 
Is there some function I could use to simulate combat or get the combat odds of a fight between 2 units on the same tile owned by the same civ? I recently added a "Challenge" spell to let Doviello melee units fight and potentially kill each other for xp, but I'd like it to take the units actual strength into account. Letting a warrior have the same odds of taking down a battlemaster as another battlemaster does seems wrong, as does giving out the same amount of xp to the victor. I'd also like to know how to make units choose the toughest unit in their stacks to fight instead of just picking the first one with higher base strength or xp or having to guess as to how to take strength and various promotions into account when looping though them all to decide who is toughest.

CvGameCoreUtils
int getCombatOdds(CvUnit* pAttacker, CvUnit* pDefender)

Its even exposed to python.
 
Back
Top Bottom