Modders Guide to FfH2

The default is a minimum limit of 1 and maximum limit of 1. The schema say minimum 0 but nothing about max, so it's max one.

That is also true in the SDK. It's a single int for the civilization so it can only store one.
 
Attached is a commented copy of CvMainInterface.py. I have only commented those elements which I added for the new HUD, all of the things Kael added for the new Worldspells and whatnot are left as-is.


The section I talked about being redone considerably and thus being really tricky to comment properly was actually reverted from my file to be the normal clunky version, so even that bit is commented (I mildly re-arranged the elements while doing this bit). Also I went ahead and moved the Help Text over 20 pixels to get it out from under the unit image, but that is easily reverted.

EDIT: Attachment is a few posts down, this one had indentation errors
 
Where is the code for ancient forest spawning done in the SDK? I've been looking for a way for a feature to spawn under a religion and then have that feature modify the base terrain. Is there also a per turn function as well?
 
CvPlot::doTurn()
Spoiler :

Code:
        if (GC.getImprovementInfo(getImprovementType()).getFeatureUpgrade() != NO_FEATURE)
        {
            if (GC.getGameINLINE().getSorenRandNum(100, "Feature Upgrade") < GC.getDefineINT("FEATURE_UPGRADE_CHANCE"))
            {
                setFeatureType((FeatureTypes)GC.getImprovementInfo(getImprovementType()).getFeatureUpgrade());
                setImprovementType(NO_IMPROVEMENT);
            }
        }
 
I hate to bother you again Xienwolf, but I encountered a problem with the block comments. They have to be indented correctly to work without python errors.

Not working example:

Code:
		global MAX_CITIZEN_BUTTONS
[COLOR="Red"]'''	Enhanced HUD	10/18/08	Xienwolf	'''[/COLOR]
		global HUD_City_Bottom_Right_Width
Working example:

Code:
		global MAX_CITIZEN_BUTTONS
[COLOR="Green"]		'''	Enhanced HUD	10/18/08	Xienwolf	'''[/COLOR]
		global HUD_City_Bottom_Right_Width
 
CvPlot::doTurn()
Spoiler :

Code:
        if (GC.getImprovementInfo(getImprovementType()).getFeatureUpgrade() != NO_FEATURE)
        {
            if (GC.getGameINLINE().getSorenRandNum(100, "Feature Upgrade") < GC.getDefineINT("FEATURE_UPGRADE_CHANCE"))
            {
                setFeatureType((FeatureTypes)GC.getImprovementInfo(getImprovementType()).getFeatureUpgrade());
                setImprovementType(NO_IMPROVEMENT);
            }
        }

Ah, I was looking there, but I couldn't seem to find it. Thanks snarko! :)
 
AFAIK xienwolf found out that some AI decisions were being done based on current era, which is obviously wrong due to Eras having nothing to do with FFH. this was before 0.34, I don't know if those pieces of code got reworked. Kael and xienwolf will now better I guess ;)
 
Is there still a concept of Eras somewhere in FfH or are Eras gone for good?

Edit: Stupid question. Of course there are Eras. They seem to stop at Medieval, though.

Eras in Civ4 mostly control the city art and the soundtrack that plays (there were some code things that we've removed that dealt with them too, such as a research bonus for researching techs form an earlier era).

We created an era for each religion so that we could have the soundtrack modified based on your religion. Their is a function in CvEventManager.py that does that. Civ4 assumes that eras always go one way (from ancient to classicla, etc). But since we use them for religions its possible for eras to go from the 8th era (order or whatever) to the 5th era (runes or whatever).

Before 0.34 we also have the era change the city art so that your religion set your city art, but that was changed to civ specific city art in 0.34. If I could get the soundtrack to be based on religion instead of the era I'd completly break the bonds with eras and have them return to their old function.
 
Could the code that let you get a research bonus from earlier eras be altered to give bonuses in specific tech branches. For instance, RoK civs could research to Engineering and Machinery faster, FoL civs could rush to Animal Mastery, OO could to Astronomy, Order to Fanaticism and Righteousness, etc.
 
Could the code that let you get a research bonus from earlier eras be altered to give bonuses in specific tech branches. For instance, RoK civs could research to Engineering and Machinery faster, FoL civs could rush to Animal Mastery, OO could to Astronomy, Order to Fanaticism and Righteousness, etc.

I dont know that altering the existing code buys us anything. But yes, you could add research modifiers based on your religion.
 
We created an era for each religion so that we could have the soundtrack modified based on your religion. Their is a function in CvEventManager.py that does that. Civ4 assumes that eras always go one way (from ancient to classicla, etc). But since we use them for religions its possible for eras to go from the 8th era (order or whatever) to the 5th era (runes or whatever).

Thanks for the explanation Kael. That clears things up. I had a strange problem with a mod I'm adapting for FfH, when it tried to calculate the previous era by subtracting -1 from the current era. Obviously the mod didn't expect an implementation of eras like you've done it in FfH.
 
I've been modding my FfH with the FfH Editor, tweaking the game has never been easier. But I have a problem now, when I update or change some differences in the Units section and try to export the information, VB comes up and tells me that there is a "compile error: can't find project or library".

Does anyone know how to solve this? I can't bear spending hours going through the XML and editing it. It just takes too much time!
 
I've been modding my FfH with the FfH Editor, tweaking the game has never been easier. But I have a problem now, when I update or change some differences in the Units section and try to export the information, VB comes up and tells me that there is a "compile error: can't find project or library".

Does anyone know how to solve this? I can't bear spending hours going through the XML and editing it. It just takes too much time!

Ive never seen that before. What specifically did you change in the units section?
 
I actually tried to make new units for ljosalfar. Basically using other unitclasses as blue prints then modding and changing what is allowed in the FfH Editor, edited Text in FfH and also the UnitClass XML file. I did think that it was probably I did something drastic and caused the error. So I used a FfH Editor backup (thankfully I saved one) to change everything back but even the original/back up came up with the same error. I also tried it for the previous version of FfH 2033 to see if it was something reoccurring, and I got the same error as well.

VB would pop up and the area that is highlighted is the 'z = 0', the top part of the script. So I forsake FfH Editor and edited the XML file the old school way based on the sections in the FfH Editor to the exact copy of what I edited and changed in the Editor, and there was no problems (it ran pretty smoothly)

All other sections of the FfH export works except the units. Any ideas?

Would you like me to pass you my FfH editor so that you can view it?
 
I actually tried to make new units for ljosalfar. Basically using other unitclasses as blue prints then modding and changing what is allowed in the FfH Editor, edited Text in FfH and also the UnitClass XML file. I did think that it was probably I did something drastic and caused the error. So I used a FfH Editor backup (thankfully I saved one) to change everything back but even the original/back up came up with the same error. I also tried it for the previous version of FfH 2033 to see if it was something reoccurring, and I got the same error as well.

VB would pop up and the area that is highlighted is the 'z = 0', the top part of the script. So I forsake FfH Editor and edited the XML file the old school way based on the sections in the FfH Editor to the exact copy of what I edited and changed in the Editor, and there was no problems (it ran pretty smoothly)

All other sections of the FfH export works except the units. Any ideas?

Would you like me to pass you my FfH editor so that you can view it?

You probably dont have anything in the B1 cell. Thats the cell that has to have the total number of units that it has to go through. If you inserted a unit in the B column but didnt keep that cell the same thats probably whats causing your problem. The contents of the B1 cell should be:

Code:
=SUM(B436:ACJ436)


Yeah link a copy and I'll check it out.
 
If you ever get a spare moment, could you bundle the "High to Low" option with your Assimilation mod? It's an awesome game option and I think it would be a ton of fun for BtS players.
 
You probably dont have anything in the B1 cell. Thats the cell that has to have the total number of units that it has to go through. If you inserted a unit in the B column but didnt keep that cell the same thats probably whats causing your problem. The contents of the B1 cell should be:

Code:
=SUM(B436:ACJ436)


Yeah link a copy and I'll check it out.

I'll try that out and see how it works out. Thanks for the header. Since I'm in the office and I don't have the file I'll post it up later for you to have a look and I'll let you know if it works!

Thanks Kael.
 
Back
Top Bottom