Modders Guide to FfH2

Thanks.

Would that be something.getCombatOdds(caster, pUnit) or just getCombatOdds(caster, pUnit) by itself? If the first one, what would that something be?


I feel like I should really remember this, but how do I make sure the unit doesn't challenge and kill itself? Can I just say "if caster != pUnit:," or do I need to use some function to make sure they aren't the same unit.


Hmm...is the function that determines how much xp a unit would get from combat exposed for this spell to use too, or should I just stick with a random amount based on the odds? How about a function to determine how injured the winner should be?
 
Is there a way to make units buildable with a ritual in the XML?

I'm pretty sure that it is not. You could however do it without too much difficulty if you use a little python.
 
I was thinking of doing it for a modular mod but I suppose a little python editing isn't too bad.
 
Actually it would be very simple, that is how ICBMs work in base Civ.

Completing Manhattan project enables all civilizations to train the unit "ICBM." So just do like Hero units and block the unit which is unlocked from any civilization you don't want to have access to it (that means if you want to allow any player to perform a ritual to unlock a general unit you would have to create a copy of the ritual and the unit for each civilization, and it wouldn't quite work if there are 2 players using the same religion though).


Summary: To unlock a generic unit for just the first person to complete the ritual wouldn't be possible with pure XML. But to unlock a special unit for a certain Civilization (or everyone) is.
 
I believe that that the way nukes work is that any unit with a nuke range is unavailable until someone builds a project with <bAllowsNukes>1. If you tried to handle it like nukes, your units would have nuke like abilities, i.e., a ranged attack that works more like normal combat plus making the unit drop straight down on the targeted tile and whole map shake. I was actually thinking this would be very good for Dragons, but it probably isn't what you want.



I just noticed that there is also a <EveryoneSpecialUnit> (as well as a <EveryoneSpecialBuilding>) tag, but this is not how ICBMs are handled in BtS. It is used in vanilla Civ, but not BtS. Also, note that it is allowing SPECIALUNIT types, not particular units or unit classes. It would be quite simple to create new specialunit types and give them to specific UUs. These units just wouldn't be able to have other specialunit types like bird or spell, so they won't be able to be carried by hunters or to be blocked from getting added duration from the summoner trait.


edit: I just noticed that the bAllowNukes tag didn't exist in vanilla, only BtS (not sure about Warlords). I guess Xienwolf may have first became familiar with projects in vanilla, while I hadn't looked in the files until BtS. Hopefully the <EveryoneSpecialUnit> functionality is still there, even though it is never used. I wonder why they changed the mechanism anyway.
 
Thank you Kael!

I still don't have time to do the full merge to update FF, but I have a bit to spare so I wanted to start trimming the larger XML files so I can use winmerge. Opened up PromotionInfos and found that you now use the trimmed XML method in there :) Unfortunately it isn't the same story in UnitInfos as yet, but I am hoping to find surprise clipped files elsewhere during the merge process. It would be nifty.
 
I think that Kael really needs to have at least one untrimmed entry per file though (like FF has), as I've found modding promotions is a little harder now.
 
Thank you Kael!

I still don't have time to do the full merge to update FF, but I have a bit to spare so I wanted to start trimming the larger XML files so I can use winmerge. Opened up PromotionInfos and found that you now use the trimmed XML method in there :) Unfortunately it isn't the same story in UnitInfos as yet, but I am hoping to find surprise clipped files elsewhere during the merge process. It would be nifty.

Honestly it was an attempt to see if it sped up load or gameplay, it doesnt.

Neither way matters to me since I dont touch the xml files that the editor controls. But I was hoping load time would be improved.
 
Yeah, I know that most people just use the editor, but I was already comfortable with direct XML by the time I understood the editor, and I still haven't bothered to get Office '07, so it is not totally an option for me. But I must say that updating the manual on trimmed XML is a LOT easier than on the full field XML (well, not updating, but posting in new information). Also if you configure the XML editor to create all of the XML files this way you will (very mildly) reduce the download time of the mod and patches, even if it makes no serious change in the loading speed of the mod.


Anyway, just me dreaming of the Techs, Terrains and Events all being trimmed when I finally add them to the manual ;)
 
It seems there are quite some unmarked changes in CvMainInterface.py. Would be nice, if someone from the FfH team could find the time to take care of this. It's so much easier to merge two files if the changes are marked with comments.

Yeah, those didnt come from the FfH team. *cough* *cough* *Xienwolf* *cough*
 
Sorry, I don't like python much :) It is a bit cumbersome to comment python files, so normally if I am changing more than 1 line and I expect to make numerous revisions I omit the original completely, then put it back in when I am finally finished. But in this case it is a MASSIVE rewrite and I cannot really think of how to comment out the old stuff without making it confusing to look at all of the new.


Anyone know a python equivalent of /** **/ from C++? That would make it really easy to comment out all of the old format and allow a merging program like WinMerge to highlight all of the new aspects a bit easier. Though there are still a few areas where you have to understand the file and what it is doing, mostly where it selects which items to show and which to hide. Those got split up into seperate functions to save a LOT of space.
 
Anyone know a python equivalent of /** **/ from C++?

I suppose you are looking for block comments? You may use triple-double-quotes for this.

Code:
"""
this is 
a block comment
with three lines
"""

Triple-single-quotes work as well:

Code:
'''
this is 
a block comment
with three lines
'''
 
How do the Illians get their extra yields from Snow? I can't find any files that seem to affect civ specific yields boosts. My plan to limit Hyborem and Balors to hell terrain requires there be a hell terrain version of every terrain, and I don't want the Illians to loose their bonuses on hell's snow.
 
CIV4TerrainInfos.xml
Code:
			<CivilizationYieldType>CIVILIZATION_ILLIANS</CivilizationYieldType>
			<CivilizationYieldChange>
				<iYield>2</iYield>
				<iYield>0</iYield>
				<iYield>0</iYield>
			</CivilizationYieldChange>
 
I could have sworn I'd looked though that file pretty thoroughly, but I somehow missed that.

Does that schema mean that only 1 civ can have extra yields from a specific terrain, or can you list them one after another?
 
Back
Top Bottom