Modders Guide to FfH2

if this has been asked and answered, then I apologize, I scaned through the 16 pages and didn't see it, but admittedly I mighta missed it...

but what does

UnitArtStyleType-

do in promotions?...I had been thinking it was for diseased units but it didn't list anything for diseased so I got curious.

It allows us to change the unit art by applying a promotion. For example the Orc promotion is what makes a warrior look like a Orc, not the civ it belongs to (which is why if you capture a Clan of Embers warrior it still looks like an Orc or if the Clan of Embers captures a human warrior it still looks human).
 
thank you gentlemen, I am slowly getting an understanding how all the little bits fit together, then my brain explodes and I have to go play with my dog to get my mind to stop screaming *grin*....I'm a comedy writer by profession not a computer guy and the one computer guy I had access to has stopped returning my calls..(I wonder why? :) as I hafve said elsewhere you and the team did such an incredible job creating a new engine for us to play in your sandbox

you guys really did take the old civ3 "only change the numbers" screen and created civ4's xml control out of the Civ4 game with FfH...if you follow my logic, you gave us so much more to diddle with
 
Ok. I played around triing to create a shape-shifter.

So i managed to create 5 forms (sea-serpent, bear, tiger, wolf and hawk) by a permanent summon & kill caster mechanism. And I think it could be realy fun. If you shape to a bear in ocean, the bear will automaticly be transported to closest land target. If you shape to an hawk you automaticly get transported to the nearest legal point a hawk can be, which is in one of your cities. It in many ways mimic an 'escape' spell.

If you wildshape AFTER a battle, you get completely healed!
I think that is a fun effect and I would keep it.

But the hard part: experience:
I created a promotion fiendish (blitz, +25%, 50% fire protection, 100% holy wounderability) which gave the fiendish promotion to its summon.
And it worked, but only the first time I wildshaped. So when I was 'fiendish bear' I transformed into a 'fiendish wolf' but then if I dont remember incorrectly I transformed into a regular tiger. I'll check this later also.

Also as somebody notified me, when wildshaping my XP drops to zero which means it could theoreticaly get a promotion every 2xp. So what I could do
is make a three, where I need
Shapeshifter
Combat I
Combat II
Fiendish (requiers shapeshifter & combat II)

Where you will loose combat I and combat II if you wildhspae, but if you get fiendish you get to keep that promotion. In that way you will need to stay same shape untill level III before getting permanent promotions.

Question: Promotion requierments: I see an OR implemented, but does there exist AND requierments? Ie, requiers shapeshifter & combat II?

Maybe I'll make fiendish promotion given as spell which requieres the fiendish/celestial promotion, cuz then I could give evil civilizations fiendish and the good celestial promotion.
 
I've heard of an event in which a unit becomes a hero. How would I go about making this happen at least once in a game, if possible?
 
To make the Becoming a Hero thing happen every game, you need the EventTriggers.xml, find the proper event and set it to 100% chance for being in the game.

For Promotions AND requirements, just place a requirement in the normal Promotion Pre-req slot, and also place one in the first OR slot. The OR are only considered as OR among each other (so PromotionPreReqOr1 or PromotionPreReqOr2 or PromotionPreReqOr3, but ALSO must have PromotionPreReq to go with one of those other 3)
 
To make the Becoming a Hero thing happen every game, you need the EventTriggers.xml, find the proper event and set it to 100% chance for being in the game.

What's the text that I'm looking for? This is my first time at actually modding my game myself, without using downloaded assest merging, so I don't want to completely ruin my version of FfH. Any assistance would be appreciated.
 
Assets/XML/Events/CIV4EventTriggerInfos.xml

Change:
Code:
		<EventTriggerInfo>
			<Type>EVENTTRIGGER_CHAMPION</Type>
			<WorldNewsTexts>
				<Text>TXT_KEY_EVENTTRIGGER_CHAMPION</Text>
			</WorldNewsTexts>
			<TriggerTexts>
				<TriggerText>
					<Text>TXT_KEY_EVENT_TRIGGER_CHAMPION_1</Text>
					<Era>NONE</Era>
				</TriggerText>
			</TriggerTexts>
			<bSinglePlayer>0</bSinglePlayer>
			<iPercentGamesActive>30</iPercentGamesActive>
			<iWeight>800</iWeight>

to
Code:
		<EventTriggerInfo>
			<Type>EVENTTRIGGER_CHAMPION</Type>
			<WorldNewsTexts>
				<Text>TXT_KEY_EVENTTRIGGER_CHAMPION</Text>
			</WorldNewsTexts>
			<TriggerTexts>
				<TriggerText>
					<Text>TXT_KEY_EVENT_TRIGGER_CHAMPION_1</Text>
					<Era>NONE</Era>
				</TriggerText>
			</TriggerTexts>
			<bSinglePlayer>0</bSinglePlayer>
			<iPercentGamesActive>[COLOR="Red"]100[/COLOR]</iPercentGamesActive>
			<iWeight>[COLOR="Lime"]800[/COLOR]</iWeight>


Changing the part in Red makes it always be an option to happen in each game you play, instead of only in 30% of the games. Changing the part in Green will make it more likely to happen. If you make it bigger it is a better chance to happen, but if you make it -1 it will happen immediately upon being available.

The requirements for it to trigger are that your unit has at least 3 XP, and is completely healed. It also seems that the XML requires that the unit is a Champion UNITCLASS, but the Python doesn't require that at all. And I know I have had it trigger on my scouts in the very early game. So it is possible that the Python is overriding that value, or that I have the wrong event.
 
Thank you Xienwolf! :)

Just a thought: Does that event happen just once in the game, or can it potentially happen more than once?
 
Thank you Xienwolf! :)

Just a thought: Does that event happen just once in the game, or can it potentially happen more than once?

By default it only happens 1 time per game regardless of the number of civilizations in the game. These are controlled near the bottom of the trigger entry in the same file:

Code:
            <bRecurring>0</bRecurring>
            <bTeam>0</bTeam>
            <bGlobal>1</bGlobal>
bRecurring is a boolean for whether or not the event can recur. Since it's set to 0, it'll only happen once.
With bGlobal set to 1, when it is triggered, it is triggered "globally" rather than per civ, i.e. it will only happen once per game regardless of which civ gets the event. If it were set to 0 (with bRecurring still set to 0), it could happen only once per civilization - every civ could get a free hero.

If you want it to just recur over and over, set bRecurring to 1, and bGlobal to 0.

In this case, I'd recommend lowering the iWeight that xienwolf pointed out to 200 or maybe even lower. As he mentioned, this number is used to determine which legal event occurs when the game decides that an event is going to occur to you. If you don't lower this number, you, and everyone else, will be fairly quickly racking up heroes all over the place! =)
 
What does the <bSinglePlayer>0</bSinglePlayer> line do?
 
In CvInfos.cpp:

What purpose does: bool CvTechInfo::readPass3() serve?

I am merging another DLL mod into FfH's DLL, and they ALSO added this function. So can I slip their m_iFirstUnlockUnit = GC.getInfoTypeForString(m_aszExtraXMLforPass3[0]); into the same readpass, or do I have to add a Pass 4?
 
I was wondering if anyone would be so kind as to show me what the codeblock would look like for a building that adds food to a desert tile? Production to a peak tile?

I was also wondering if it is possible for someone to give me a rundown of how to increase or decrease the occurence of specific bonuses in my games.

Also wondering how to give a civ a bonus to production, food, comerce from an improvement.

Which tag in the unitinfos decides how far a unit can see?
 
I was just wondering, would getting rid of a lot of unitclasses (and buildingclasses) by combining all the units you never actually build (equipment, summons, temporary spell-buildings, ect) into one unitclasses (and buildingclass) help with performance? It seems like you could make files smaller that way, and having less to read might make things run (slightly) faster. Even if it doesn't, would combining unitclasses like that hurt anything?
 
Main thing I can think of that prevents combining a lot of the Unit classes is the World/National/Team limits. Since those are tracked by class if you combine the wrong ones it will mess things up (since each Civ would only have 1 each that is primarily an issue for World Limited cases).

I do not think there is a tag in UnitInfos for sight. The only case I know of that changes sight range is in Sentry promotions. No Unit has more than the standard sight as default.

Bonus to :hammers:, :food:, :commerce: as in +3, or as in +10%? The first is rather straightforward, so I suspect you mean the second, and I do not know that it is possible without changing the DLL.

Increasing the occurance of specific Bonuses depends on assigning them to a Bonus Class, and then adjusting how close those items in that Bonus Class may be to each other. As well as adjusting the order in which it is placed if in a rather full Bonus Class.

Codeblock for Food from a Desert Tile: As in Codeblocks (the Program used to change the DLL), or as in "Chunk of Code?" And do you mean a Building (built in the city with :hammers:) or an Improvement (buily on the map by Workers)?
 
Lets see if I can explain this better

What code would I have to add to the buildinginfo file for a building that adds food to a desert tile? Production to a peak tile?
Bonus to :food::hammers::commerce: as in +3

and for the second question

Lets say I want the civilisation to get an additional bonus to production, food, comerce from a mine, farm or other imrovement.

and I don't quite understand this.

"Increasing the occurance of specific Bonuses depends on assigning them to a Bonus Class, and then adjusting how close those items in that Bonus Class may be to each other. As well as adjusting the order in which it is placed if in a rather full Bonus Class."

for example I want copper to me more frequently deposited on my maps, I know the info is in the bonusinfos file but I dont know which tags stand for what.

__________________
 
Copper belongs to:
<BonusClassType>BONUSCLASS_RUSH</BonusClassType>
It is placed first:
<iPlacementOrder>1</iPlacementOrder>
And there must be at least 3 Tiles of Land for it to appear (So no small island copper mines)
<iMinAreaSize>3</iMinAreaSize>


Most of the rest of it I am not that familiar with. Except for the fairly obvious tags saying where it is allowed to appear. If you authorize it to appear in more locations then you will get more as a result, though in wierd places (like the middle of a desert or Tundra, if you enabled those).


Since it is placed first of all the RUSH resources, that means anything you do to cause more of them to appear causes less of all other RUSH resources to appear.

Bonus Class Rush is set to not allow any others of the same class appear within 3 tiles of each other (in the Bonus Class file instead now)
<iUnique>3</iUnique>

You could lower this number to allow more possible spaces for Copper and the rest of the RUSH resources to appear in the game.


EDIT: Well I still don't know precisely what Pass 3 is used for. I know that it is delaying the reading and display of the information for some reason though. By slipping the new information into the Pass 3 FfH uses I got errors, so I invented a Pass 4 and so far it is willing to Compile, but since I don't know what these are for I just hope that either order doesn't matter, or I just happen to have it correct.
 
EDIT: Well I still don't know precisely what Pass 3 is used for. I know that it is delaying the reading and display of the information for some reason though. By slipping the new information into the Pass 3 FfH uses I got errors, so I invented a Pass 4 and so far it is willing to Compile, but since I don't know what these are for I just hope that either order doesn't matter, or I just happen to have it correct.

The game loads the xml one file at a time. Which is a problem if an entry on one xml file refers to one in another that isnt loaded yet. A lot of objects refer to themselves (promotions refer to other promotions), pass2 is a 2nd xml load that runs right after a file loads to pull in all the references that refer to objects in its own file.

Pass3 runs after all the files have loaded. So a file that refers to a file that comes after it will be able to load those references. For example religions refer to techs (since they have a founding tech) and techs refer to religions (since they can prereq a religion). So it isnt possible to resolve this just through load order. They have to use a pass3 to pull in the data for whichever file loads first.

Hopefully that makes some sense. We jump through a lot of hoops to work through load order issues, a lot of base level implmentation issues are to ease load order. For example a spell isnt referenced in any xml file (spells is the last xml file loaded).

It also explains why sometimes you can add a reference in an xml file and it doesnt ever take effect (because at the time that xml file loads that reference isnt valid). Ideally tags should have been loaded form all the xml files (just to get the pointers), then a second pass to actually read the data so we wouldn't have to deal with this, but what can you do.
 
Top Bottom