1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Importing a leader from another modmod

Discussion in 'Civ4 - Fall from Heaven' started by morchuflex, Oct 2, 2015.

  1. morchuflex

    morchuflex Chieftain

    Joined:
    Feb 19, 2004
    Messages:
    1,384
    Location:
    Paris
    Hello fellow fans!

    I have been playing FFH2 (more specifically, FFH2 + More Naval AI) with a lot of fun for a couple years. However, I wish there were more leaders for each faction.

    I see that some modmods have more leaders. For instance, in Wild Mana, there are up to 5 leaders for each civilization.

    Is there a (relatively easy) way to "import" a leader from a FFH2 modmod to FFH2 ?

    Thanks in advance!
     
  2. Terkhen

    Terkhen Chieftain

    Joined:
    Aug 1, 2011
    Messages:
    908
    Gender:
    Male
    Location:
    United Kingdom
    Leaders are defined in the [MOD_FOLDER]\Assets\XML\Civilizations\CIV4LeaderHeadInfos.xml file. Inside of it, each leader is defined between <LeaderHeadInfo> tags. For example, in ExtraModMod Alexis appears as:

    Code:
    		[b]<LeaderHeadInfo>[/b]
    			<Type>LEADER_ALEXIS</Type>
    			<Description>TXT_KEY_LEADER_ALEXIS</Description>
    			<Civilopedia>TXT_KEY_LEADER_ALEXIS_PEDIA</Civilopedia>
    			<ArtDefineTag>ART_DEF_LEADER_ALEXIS</ArtDefineTag>
    			<iWonderConstructRand>25</iWonderConstructRand>
    ...
    			<ReligionWeightModifiers>
    				 <ReligionWeightModifier>
    					<ReligionType>RELIGION_COUNCIL_OF_ESUS</ReligionType>
    					<iWeightModifier>25</iWeightModifier>
    				 </ReligionWeightModifier>
    				 <ReligionWeightModifier>
    					<ReligionType>RELIGION_THE_ASHEN_VEIL</ReligionType>
    					<iWeightModifier>25</iWeightModifier>
    				 </ReligionWeightModifier>
    			</ReligionWeightModifiers>
    			[i]<LeaderCategory>LEADERCATEGORY_STANDARD</LeaderCategory>[/i]
    		[b]</LeaderHeadInfo>[/b]
    
    The main reason about why you can't just copy leaders from a mod and paste them in another is that leaders can have a different format in each mod. For example, that XML code comes from ExtraModMod, which includes a system for leader categories. If a leader of ExtraModMod were pasted into More Naval AI, you would get an error on start up and it wouldn't load correctly.

    There is nothing preventing you from just adding another leader to the mod and changing the value of each field to the value of the leader you want to import. When it is not possible, you can always assign something that makes sense for the new leader. The most complicated part is the <ArtDefineTag>. This points to yet another XML section that needs to be defined, in this case in the [MOD_FOLDER]\Assets\XML\Art\CIV4ArtDefines_Leaderhead.xml file.

    Code:
    		<LeaderheadArtInfo>
    			<Type>ART_DEF_LEADER_ALEXIS</Type>
    			[b]<Button>,Art/interface/LeaderHeads/Alexis button.dds</Button>
    			<NIF>art/interface/LeaderHeads/Alexis.dds</NIF>[/b]
    			<KFM/>
    			<NoShaderNIF/>
    			<BackgroundKFM/>
    		</LeaderheadArtInfo>
    For this, you will need to find the art for the leader button and portrait in the original mod. This is a kind of long process for which there are quite a few tutorials in the pertinent section of the CivFanatics forums. I recommend ommitting this process (and just using the ArtDefineTag of another leader) until everything else already works.

    After adding the leader to CIV4LeaderHeadInfos.xml you will need to add it to its civilization. In [MOD_FOLDER]\Assets\XML\Civilizations\CIV4CivilizationInfos.xml, you can find the following code in the middle of the Calabim:
    Code:
    			<Leaders>
    				[b]<Leader>
    					<LeaderName>LEADER_ALEXIS</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>[/b]
    				<Leader>
    					<LeaderName>LEADER_FLAUROS</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    				<Leader>
    					<LeaderName>LEADER_DECIUS_EXTRA</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    				<Leader>
    					<LeaderName>LEADER_MAHON_EXTRA</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    			</Leaders>
    
    Adding another similar section pointing to the LeaderName you chose for your leader will add that leader to that civilization. If everything went fine, you will be able to play with your new leader.
     
  3. morchuflex

    morchuflex Chieftain

    Joined:
    Feb 19, 2004
    Messages:
    1,384
    Location:
    Paris
    Terkhen, thanks a lot for the detailed information. Much appreciated!
    I'll give it a try on my next holiday... :)
     

Share This Page