Modders Guide to FfH2

I need a bit of help. I have been working on my Hinterlands project for about a week now and nearly have it working but I have one small problem.

I created a new attribute in the Terrain infos called RequireEntryTech which will requires a proper tech to enter a terrain type.


When I load up my mod I get errors from the XML that say the Techs "TECH_EXPLORATION, TECH_ANCIENT_CHANTS" are incorrect. Why is this?
 
I would be willing to bet without looking that you need to use readpass3 because Terrains are loaded before Technologies. Welcome to one of the more PITA aspects of adding new fields :)

Check out m_aszExtraXMLforReadPass3, that leads you to anything that uses readpass 3 right now, and if you are not using a single entry field, but instead an array to allow multiple tech listings, I'll help you out with that one (or you can peak at the FF code)

EDIT: Oh, and you'll be needing to look in CvXMLLoadUtilitySet.cpp, that is where the readpasses are controlled from.
 
Is there a .psd template anywhere that contains the "I" "II" "III" and "IV" numerals, used on the Command and spellsphere promotions?

I'm making a multi levelled promotion icon, and I'd like to try to keep the style consistent
 
Is there a way to make spells cost gold to cast? Looking at the guide I think it might be <iCost> but I'm not sure. (iCost is used for everything under the sun)
 
Thanks Xienwolf, I got it working now. Here are some screenshots:

Spoiler Lucian can enter the Tundra because the Doviello have researched Ancient Chants :
Civ4ScreenShot0068.jpg


Spoiler Lucian can't go into the Ice because the Doviello haven't researched Warfare :
Civ4ScreenShot0067.jpg


Spoiler I haven't enabled entries for pormotions yet so the Beastman can't enter the wildlands north of the city :
Civ4ScreenShot0069.jpg




Is there a .psd template anywhere that contains the "I" "II" "III" and "IV" numerals, used on the Command and spellsphere promotions?

I'm making a multi levelled promotion icon, and I'd like to try to keep the style consistent

I haven't seen anything but when I need to copy the numerals I just use a "Magicwand" select to copy them into the button.
 
Is there a comprehensive list somewhere of everything that is exposed to Python? Bonus points if it comes with a short description for each function.

In particular I am looking for something that counts all the surplus unhealth a city has, similar to the angryPopulation function. I found the unhealthyPopulation function, but I'm not sure whether it counts surplus unhealth or just the total unhealth from population.
 
You can use something like this
pCity.badHealth(False)-pCity.goodHealth()

That doesn't work for me. I get some kind of operation not allowed error. I still haven't found a way to check the healthlevel of a city.

One more question:

Is it possible to block (AI)workers from building specific improvements (workshops/forts) in Python? I tried to put some checks into the CanBuild function in Cvgameutils.py, but the checks don't appear to do anything.
 
That doesn't work for me. I get some kind of operation not allowed error. I still haven't found a way to check the healthlevel of a city.
that's a weird error. it works perfect for me

One more question:

Is it possible to block (AI)workers from building specific improvements (workshops/forts) in Python? I tried to put some checks into the CanBuild function in Cvgameutils.py, but the checks don't appear to do anything.
Did you change USE_CAN_BUILD_CALLBACK to 1 in the Pythoncallbackdefines.xml?
 
that's a weird error. it works perfect for me

Now it works for me too. Must have done something wrong. Thanks!

Of course now my AI_chooseTech function isn't working like it should. I tried to debug it with the logging tool, but all it gives are the numbers of the techs chosen.
Is there a quick reference chart, which shows which numbers correspond to which techs?

I.e. I want to see the actual number that "gc.getInfoTypeForString('TECH_WAY_OF_THE_FORESTS')" fetches. Where do I have to look?
 
If you use Notepad++ you can find out easily by opening the XML, collapsing the third level (CTRL+3), and then recording a macro of you pressing the DOWN button (and nothing else). Then place your cursor on the first actual item in the collapsed list and tell the macro to run X number of times, where X was the number the logger reported to you. Since you start on element 0, it will place you on the right item for the number reported.
 
Thanks again! Now everything is working like it should (note to self: it's spelled SHEAIM not SHEIAM).

I have one more question: Is there a way in Python to count unimproved bonus resources and their kind around your starting city that does not completely kill the performance?
 
It woldn't be bad if you just called the it once or twice but what do you want? Something that will search around your starting settler or the city that your capital is in?

Anyways neither would be too bad on the processer because you are only looking at a certain number of tiles. Normal FfH looks at every tile in the game to do the spread and wane of Hell so yours shouldn't count for any real countable amount of time while playing.

________________________________

Small questions of my own. Is there a way to force a unit to settle a square using python? (such as the result of a spell)
 
Yeah I want to check if there is seafood around the Capital when choosing initial research. Right now I only check if the Capital is coastal, but without Seafood Fishing is not a desirable tech early on.

So it would result in checking tiles around the capital every time research gets chosen until fishing is researched, if that doesn't result in a notiveable slowdown, I should be fine.
 
Back
Top Bottom