Modders Guide to FfH2

I believe hasTrait() does account for Civ Traits.

Code:
gc.getActivePlayer().hasTrait(gc.getInfoTypeForString("TRAIT_AGNOSTIC"))

That seems to work for me both for only leaders that are Agnostic (e.g. the Risen Emperor) and Civs that are agnostic (e.g. the Grigori.) At least, it does in Wildmana.
 
OK. I see now. During player init it's assigning traits to players based on their civ traits.

Code:
if (GC.getCivilizationInfo(getCivilizationType()).getCivTrait() != NO_TRAIT)
{
     setHasTrait((TraitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivTrait(), true);
}
 
I was playing my modmod last night and at turn ~150, I opened the Tech Advisor screen to find it blank! Only the background was displayed, the assorted tech were not.

I never messed up with TechChooser.py. What is the possible cause of this?
 
I'm guessing you don't have python popups turned on. You should. They will likely tell you what's wrong. Even if you haven't changed that specific file changes elsewhere can break it. (see first post in the bug thread for how to turn on python popups).
 
I see a section in the DLL code where Kael commented out a line calling getCurrentEra(). The comment says that he does this because FFH doesn't use eras. Does this mean that the getCurrentEra() call will always return 1? And how does this affect Advanced Starts? What sort of values will getStartEra() return?
 
I'm really stuck on this one. I can't figure out why the Stooges do absolutely nothing in AI hands. Other beast units that are created for the civs via python (such as the Doviello wolf packs), behave properly. And oddly enough, I played a game recently where I created the Pact and played with the Giants for a bit. I then turned my civ over to AI control, and the AI took the Giants and went on a rampage, using them to bombard and assault enemy cities!

I really don't get what is going wrong. Any suggestions here?

Edit: Forgot to mention that I changed it so that they don't get Hidden Nationality, hoping that would fix the issue, but it doesn't...

Edit2: Seems to be some sort of problem with the Pact creating units? I tried replacing the Hill Giant with a simple Axeman and the same thing happens. The units never group with anyone and never leave their starting city. This makes no sense at all as other projects that create units don't have this issue.

Solution, but not an Explanation: OK, I figured out that if I manually give them a GROUPFLAG when they're created in python, they'll behave properly and join up with other units. But I still don't understand why I have to do this when other units created via python don't need this extra step.

And speaking of GROUPFLAG, I find this one of the more confusing parts of the code. Can anyone give me a rough overview of how it works?
 
And speaking of GROUPFLAG, I find this one of the more confusing parts of the code. Can anyone give me a rough overview of how it works?

Think of GROUPFLAG as a better UNITAI mechanic. It's a bit confusing since not every unit has a groupflag and those without will simply use their unitai instead. The idea behind the groupflags is that the AI logic isn't based on individual units, but on groups. This not only makes AI much faster but also helps AI to cooperate their units more.

A Unit picks a Groupflag in CvUnitAI::chooseGroupflag.
 
Some music/era questions:

(The goal of all this is to create Grigori and Illian specific eras, so the agnostic civilizations also get some more interesting soundtracks.)

I've noticed that code/information effecting eras shows up in the Eventinfos python file, and the erainfos XML file. Are there any other files effected by eras? (I've just used eventinfos for adjusting when the eras occur, but also may have missed something else in the file.)


On music files, Does the music have to be a particular type of MP3 file, or will any type do? also, what exactly is the format for writing the names of music files into the erainfos?


(When creating the new eras for Illians and Grigori, I have gotten the eras themselves to work mostly correctly, but my new songs weren't actually playing, and diplomacy music for other players was also not playing, instead making a wierd double whoosh-clang sound, which sounds familiar but I cannot place it.

These questions, as you might guess, are an attempt ot fix these issues.)
 
Some music/era questions:

(The goal of all this is to create Grigori and Illian specific eras, so the agnostic civilizations also get some more interesting soundtracks.)

I've noticed that code/information effecting eras shows up in the Eventinfos python file, and the erainfos XML file. Are there any other files effected by eras? (I've just used eventinfos for adjusting when the eras occur, but also may have missed something else in the file.)


On music files, Does the music have to be a particular type of MP3 file, or will any type do? also, what exactly is the format for writing the names of music files into the erainfos?


(When creating the new eras for Illians and Grigori, I have gotten the eras themselves to work mostly correctly, but my new songs weren't actually playing, and diplomacy music for other players was also not playing, instead making a wierd double whoosh-clang sound, which sounds familiar but I cannot place it.

These questions, as you might guess, are an attempt ot fix these issues.)

Well, you need to set the songs for the era (assuming you did that), but you also need to set era music for every single leader, or you won't get any diplo music. If you open the LeaderInfos file and search ERA_ESUS (or some other era), you'll see all the places you need to add your new era to. :p
 
Thanks, got it sorted out. (managed to solve the other issues through some searching the forums. I am surprised at the amount of XML file changes needed ot add this, but I guess that's how this goes.)
 
In my latest build, I am unable to load any saved games aside from the Initial Save. The game just crashes to desktop, even when using a debug build. Any ideas on where to look to find the source of this problem?
 
Back
Top Bottom