Tutorial - How to make a modular Modmod.

NBAfan

boss
Joined
Aug 30, 2007
Messages
3,351
Afforess made a post about how to make a modmod, so I put that here so everyone can know how to make one.

For example, say you wanted change a unit or a building.

Just copy the section for that unit from the CIV4UnitInfos.xml or CIV4BuildingInfos.xml into a new XML files, add the header XML tags and footer XML tags, and make the changes you want. After your done, cut out the unchanged code.

Here is an example for changing Knights to be only defensive.

The Knight XML section:

Spoiler :
Code:
<UnitInfo>
            <Class>UNITCLASS_KNIGHT</Class>
            <Type>UNIT_KNIGHT</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_MOUNTED</Combat>
            <Domain>DOMAIN_LAND</Domain>
            <DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
            <Invisible>NONE</Invisible>
            <SeeInvisible>NONE</SeeInvisible>
            <Description>TXT_KEY_UNIT_KNIGHT</Description>
            <Civilopedia>TXT_KEY_UNIT_KNIGHT_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_KNIGHT_STRATEGY</Strategy>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bAnimal>0</bAnimal>
            <bFood>0</bFood>
            <bNoBadGoodies>0</bNoBadGoodies>
            <bOnlyDefensive>0</bOnlyDefensive>
            <bNoCapture>0</bNoCapture>
            <bQuickCombat>0</bQuickCombat>
            <bRivalTerritory>0</bRivalTerritory>
            <bMilitaryHappiness>1</bMilitaryHappiness>
            <bMilitarySupport>1</bMilitarySupport>
            <bMilitaryProduction>1</bMilitaryProduction>
            <bPillage>1</bPillage>
            <bSpy>0</bSpy>
            <bSabotage>0</bSabotage>
            <bDestroy>0</bDestroy>
            <bStealPlans>0</bStealPlans>
            <bInvestigate>0</bInvestigate>
            <bCounterSpy>0</bCounterSpy>
            <bFound>0</bFound>
            <bGoldenAge>0</bGoldenAge>
            <bInvisible>0</bInvisible>
            <bFirstStrikeImmune>1</bFirstStrikeImmune>
            <bNoDefensiveBonus>1</bNoDefensiveBonus>
            <bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
            <bCanMoveImpassable>0</bCanMoveImpassable>
            <bCanMoveAllTerrain>0</bCanMoveAllTerrain>
            <bFlatMovementCost>0</bFlatMovementCost>
            <bIgnoreTerrainCost>0</bIgnoreTerrainCost>
            <bNukeImmune>0</bNukeImmune>
            <bPrereqBonuses>0</bPrereqBonuses>
            <bPrereqReligion>0</bPrereqReligion>
            <bMechanized>0</bMechanized>
            <bSuicide>0</bSuicide>
            <bHiddenNationality>0</bHiddenNationality>
            <bAlwaysHostile>0</bAlwaysHostile>
            <UnitClassUpgrades>
                <UnitClassUpgrade>
                    <UnitClassUpgradeType>UNITCLASS_CUIRASSIER</UnitClassUpgradeType>
                    <bUnitClassUpgrade>1</bUnitClassUpgrade>
                </UnitClassUpgrade>
            </UnitClassUpgrades>
            <UnitClassTargets/>
            <UnitCombatTargets/>
            <UnitClassDefenders/>
            <UnitCombatDefenders/>
            <FlankingStrikes>
                <FlankingStrike>
                    <FlankingStrikeUnitClass>UNITCLASS_CATAPULT</FlankingStrikeUnitClass>
                    <iFlankingStrength>100</iFlankingStrength>
                </FlankingStrike>
                <FlankingStrike>
                    <FlankingStrikeUnitClass>UNITCLASS_TREBUCHET</FlankingStrikeUnitClass>
                    <iFlankingStrength>100</iFlankingStrength>
                </FlankingStrike>
            </FlankingStrikes>
            <UnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_ATTACK</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_PILLAGE</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </UnitAIs>
            <NotUnitAIs/>
            <Builds/>
            <ReligionSpreads/>
            <CorporationSpreads/>
            <GreatPeoples/>
            <Buildings/>
            <ForceBuildings/>
            <HolyCity>NONE</HolyCity>
            <ReligionType>NONE</ReligionType>
            <StateReligion>NONE</StateReligion>
            <PrereqReligion>NONE</PrereqReligion>
            <PrereqCorporation>NONE</PrereqCorporation>
            <PrereqBuilding>NONE</PrereqBuilding>
            <PrereqTech>TECH_ARMORED_CAVALRY</PrereqTech>
            <TechTypes>
                <PrereqTech>NONE</PrereqTech>
            </TechTypes>
            <BonusType>BONUS_HORSE</BonusType>
            <PrereqBonuses>
                <BonusType>BONUS_IRON</BonusType>
            </PrereqBonuses>
            <ProductionTraits/>
            <Flavors/>
            <iAIWeight>0</iAIWeight>
            <iCost>90</iCost>
            <iHurryCostModifier>0</iHurryCostModifier>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iMinAreaSize>-1</iMinAreaSize>
            <iMoves>2</iMoves>
            <bNoRevealMap>0</bNoRevealMap>
            <iAirRange>0</iAirRange>
            <iAirUnitCap>0</iAirUnitCap>
            <iDropRange>0</iDropRange>
            <iNukeRange>-1</iNukeRange>
            <iWorkRate>0</iWorkRate>
            <iBaseDiscover>0</iBaseDiscover>
            <iDiscoverMultiplier>0</iDiscoverMultiplier>
            <iBaseHurry>0</iBaseHurry>
            <iHurryMultiplier>0</iHurryMultiplier>
            <iBaseTrade>0</iBaseTrade>
            <iTradeMultiplier>0</iTradeMultiplier>
            <iGreatWorkCulture>0</iGreatWorkCulture>
            <iEspionagePoints>0</iEspionagePoints>
            <TerrainImpassables/>
            <FeatureImpassables/>
            <TerrainPassableTechs/>
            <FeaturePassableTechs/>
            <iCombat>11</iCombat>
            <iCombatLimit>100</iCombatLimit>
            <iAirCombat>0</iAirCombat>
            <iAirCombatLimit>0</iAirCombatLimit>
            <iXPValueAttack>4</iXPValueAttack>
            <iXPValueDefense>2</iXPValueDefense>
            <iFirstStrikes>0</iFirstStrikes>
            <iChanceFirstStrikes>0</iChanceFirstStrikes>
            <iInterceptionProbability>0</iInterceptionProbability>
            <iEvasionProbability>0</iEvasionProbability>
            <iWithdrawalProb>0</iWithdrawalProb>
            <iCollateralDamage>0</iCollateralDamage>
            <iCollateralDamageLimit>100</iCollateralDamageLimit>
            <iCollateralDamageMaxUnits>6</iCollateralDamageMaxUnits>
            <iCityAttack>0</iCityAttack>
            <iCityDefense>0</iCityDefense>
            <iAnimalCombat>0</iAnimalCombat>
            <iHillsAttack>0</iHillsAttack>
            <iHillsDefense>0</iHillsDefense>
            <TerrainNatives/>
            <FeatureNatives/>
            <TerrainAttacks/>
            <TerrainDefenses/>
            <FeatureAttacks>
                <FeatureAttack>
                    <FeatureType>FEATURE_FOREST</FeatureType>
                    <iFeatureAttack>-25</iFeatureAttack>
                </FeatureAttack>
                <FeatureAttack>
                    <FeatureType>FEATURE_JUNGLE</FeatureType>
                    <iFeatureAttack>-50</iFeatureAttack>
                </FeatureAttack>
            </FeatureAttacks>
            <FeatureDefenses/>
            <UnitClassAttackMods/>
            <UnitClassDefenseMods/>
            <UnitCombatMods/>
            <UnitCombatCollateralImmunes/>
            <DomainMods/>
            <BonusProductionModifiers/>
            <iBombRate>0</iBombRate>
            <iBombardRate>0</iBombardRate>
            <SpecialCargo>NONE</SpecialCargo>
            <DomainCargo>NONE</DomainCargo>
            <iCargo>0</iCargo>
            <iConscription>0</iConscription>
            <iCultureGarrison>6</iCultureGarrison>
            <iExtraCost>0</iExtraCost>
            <iAsset>3</iAsset>
            <iPower>22</iPower>
            <UnitMeshGroups>
                <iGroupSize>3</iGroupSize>
                <fMaxSpeed>1.75</fMaxSpeed>
                <fPadTime>1</fPadTime>
                <iMeleeWaveSize>3</iMeleeWaveSize>
                <iRangedWaveSize>3</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>3</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_KNIGHT</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_DEFAULT</FormationType>
            <HotKey/>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <iHotKeyPriority>0</iHotKeyPriority>
            <FreePromotions/>
            <LeaderPromotion>NONE</LeaderPromotion>
            <iLeaderExperience>0</iLeaderExperience>
        </UnitInfo>

Now, create a new XML file called SOMETHING_CIV4UnitInfo.xml and put this section in. Now add the header and footer sections, so it looks like this:
Spoiler :
Code:
 <?xml version="1.0" encoding="UTF-8"?>
[COLOR="Red"]<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Unit Infos -->
<Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">[/COLOR]
    <UnitInfo>
            <Class>UNITCLASS_KNIGHT</Class>
            <Type>UNIT_KNIGHT</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_MOUNTED</Combat>
            <Domain>DOMAIN_LAND</Domain>
            <DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
            <Invisible>NONE</Invisible>
            <SeeInvisible>NONE</SeeInvisible>
            <Description>TXT_KEY_UNIT_KNIGHT</Description>
            <Civilopedia>TXT_KEY_UNIT_KNIGHT_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_KNIGHT_STRATEGY</Strategy>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bAnimal>0</bAnimal>
            <bFood>0</bFood>
            <bNoBadGoodies>0</bNoBadGoodies>
            <bOnlyDefensive>0</bOnlyDefensive>
            <bNoCapture>0</bNoCapture>
            <bQuickCombat>0</bQuickCombat>
            <bRivalTerritory>0</bRivalTerritory>
            <bMilitaryHappiness>1</bMilitaryHappiness>
            <bMilitarySupport>1</bMilitarySupport>
            <bMilitaryProduction>1</bMilitaryProduction>
            <bPillage>1</bPillage>
            <bSpy>0</bSpy>
            <bSabotage>0</bSabotage>
            <bDestroy>0</bDestroy>
            <bStealPlans>0</bStealPlans>
            <bInvestigate>0</bInvestigate>
            <bCounterSpy>0</bCounterSpy>
            <bFound>0</bFound>
            <bGoldenAge>0</bGoldenAge>
            <bInvisible>0</bInvisible>
            <bFirstStrikeImmune>1</bFirstStrikeImmune>
            <bNoDefensiveBonus>1</bNoDefensiveBonus>
            <bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
            <bCanMoveImpassable>0</bCanMoveImpassable>
            <bCanMoveAllTerrain>0</bCanMoveAllTerrain>
            <bFlatMovementCost>0</bFlatMovementCost>
            <bIgnoreTerrainCost>0</bIgnoreTerrainCost>
            <bNukeImmune>0</bNukeImmune>
            <bPrereqBonuses>0</bPrereqBonuses>
            <bPrereqReligion>0</bPrereqReligion>
            <bMechanized>0</bMechanized>
            <bSuicide>0</bSuicide>
            <bHiddenNationality>0</bHiddenNationality>
            <bAlwaysHostile>0</bAlwaysHostile>
            <UnitClassUpgrades>
                <UnitClassUpgrade>
                    <UnitClassUpgradeType>UNITCLASS_CUIRASSIER</UnitClassUpgradeType>
                    <bUnitClassUpgrade>1</bUnitClassUpgrade>
                </UnitClassUpgrade>
            </UnitClassUpgrades>
            <UnitClassTargets/>
            <UnitCombatTargets/>
            <UnitClassDefenders/>
            <UnitCombatDefenders/>
            <FlankingStrikes>
                <FlankingStrike>
                    <FlankingStrikeUnitClass>UNITCLASS_CATAPULT</FlankingStrikeUnitClass>
                    <iFlankingStrength>100</iFlankingStrength>
                </FlankingStrike>
                <FlankingStrike>
                    <FlankingStrikeUnitClass>UNITCLASS_TREBUCHET</FlankingStrikeUnitClass>
                    <iFlankingStrength>100</iFlankingStrength>
                </FlankingStrike>
            </FlankingStrikes>
            <UnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_ATTACK</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_PILLAGE</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </UnitAIs>
            <NotUnitAIs/>
            <Builds/>
            <ReligionSpreads/>
            <CorporationSpreads/>
            <GreatPeoples/>
            <Buildings/>
            <ForceBuildings/>
            <HolyCity>NONE</HolyCity>
            <ReligionType>NONE</ReligionType>
            <StateReligion>NONE</StateReligion>
            <PrereqReligion>NONE</PrereqReligion>
            <PrereqCorporation>NONE</PrereqCorporation>
            <PrereqBuilding>NONE</PrereqBuilding>
            <PrereqTech>TECH_ARMORED_CAVALRY</PrereqTech>
            <TechTypes>
                <PrereqTech>NONE</PrereqTech>
            </TechTypes>
            <BonusType>BONUS_HORSE</BonusType>
            <PrereqBonuses>
                <BonusType>BONUS_IRON</BonusType>
            </PrereqBonuses>
            <ProductionTraits/>
            <Flavors/>
            <iAIWeight>0</iAIWeight>
            <iCost>90</iCost>
            <iHurryCostModifier>0</iHurryCostModifier>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iMinAreaSize>-1</iMinAreaSize>
            <iMoves>2</iMoves>
            <bNoRevealMap>0</bNoRevealMap>
            <iAirRange>0</iAirRange>
            <iAirUnitCap>0</iAirUnitCap>
            <iDropRange>0</iDropRange>
            <iNukeRange>-1</iNukeRange>
            <iWorkRate>0</iWorkRate>
            <iBaseDiscover>0</iBaseDiscover>
            <iDiscoverMultiplier>0</iDiscoverMultiplier>
            <iBaseHurry>0</iBaseHurry>
            <iHurryMultiplier>0</iHurryMultiplier>
            <iBaseTrade>0</iBaseTrade>
            <iTradeMultiplier>0</iTradeMultiplier>
            <iGreatWorkCulture>0</iGreatWorkCulture>
            <iEspionagePoints>0</iEspionagePoints>
            <TerrainImpassables/>
            <FeatureImpassables/>
            <TerrainPassableTechs/>
            <FeaturePassableTechs/>
            <iCombat>11</iCombat>
            <iCombatLimit>100</iCombatLimit>
            <iAirCombat>0</iAirCombat>
            <iAirCombatLimit>0</iAirCombatLimit>
            <iXPValueAttack>4</iXPValueAttack>
            <iXPValueDefense>2</iXPValueDefense>
            <iFirstStrikes>0</iFirstStrikes>
            <iChanceFirstStrikes>0</iChanceFirstStrikes>
            <iInterceptionProbability>0</iInterceptionProbability>
            <iEvasionProbability>0</iEvasionProbability>
            <iWithdrawalProb>0</iWithdrawalProb>
            <iCollateralDamage>0</iCollateralDamage>
            <iCollateralDamageLimit>100</iCollateralDamageLimit>
            <iCollateralDamageMaxUnits>6</iCollateralDamageMaxUnits>
            <iCityAttack>0</iCityAttack>
            <iCityDefense>0</iCityDefense>
            <iAnimalCombat>0</iAnimalCombat>
            <iHillsAttack>0</iHillsAttack>
            <iHillsDefense>0</iHillsDefense>
            <TerrainNatives/>
            <FeatureNatives/>
            <TerrainAttacks/>
            <TerrainDefenses/>
            <FeatureAttacks>
                <FeatureAttack>
                    <FeatureType>FEATURE_FOREST</FeatureType>
                    <iFeatureAttack>-25</iFeatureAttack>
                </FeatureAttack>
                <FeatureAttack>
                    <FeatureType>FEATURE_JUNGLE</FeatureType>
                    <iFeatureAttack>-50</iFeatureAttack>
                </FeatureAttack>
            </FeatureAttacks>
            <FeatureDefenses/>
            <UnitClassAttackMods/>
            <UnitClassDefenseMods/>
            <UnitCombatMods/>
            <UnitCombatCollateralImmunes/>
            <DomainMods/>
            <BonusProductionModifiers/>
            <iBombRate>0</iBombRate>
            <iBombardRate>0</iBombardRate>
            <SpecialCargo>NONE</SpecialCargo>
            <DomainCargo>NONE</DomainCargo>
            <iCargo>0</iCargo>
            <iConscription>0</iConscription>
            <iCultureGarrison>6</iCultureGarrison>
            <iExtraCost>0</iExtraCost>
            <iAsset>3</iAsset>
            <iPower>22</iPower>
            <UnitMeshGroups>
                <iGroupSize>3</iGroupSize>
                <fMaxSpeed>1.75</fMaxSpeed>
                <fPadTime>1</fPadTime>
                <iMeleeWaveSize>3</iMeleeWaveSize>
                <iRangedWaveSize>3</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>3</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_KNIGHT</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_DEFAULT</FormationType>
            <HotKey/>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <iHotKeyPriority>0</iHotKeyPriority>
            <FreePromotions/>
            <LeaderPromotion>NONE</LeaderPromotion>
            <iLeaderExperience>0</iLeaderExperience>
        </UnitInfo>
    [COLOR="red"]</UnitInfos>
</Civ4UnitInfos>[/[/COLOR]CODE][/SPOILER]

Now, the line we want to change is this:
[CODE]<bOnlyDefensive>0</bOnlyDefensive>

Change it to this:
Code:
<bOnlyDefensive>1</bOnlyDefensive>

Great, now, for the sake of readibility, and for compatibility, we cut out the rest of the unneeded code, so our final module looks like this:
Spoiler :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Unit Infos -->
<Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">
    <UnitInfos>
        <UnitInfo>
            <Class>UNITCLASS_KNIGHT</Class>
            <Type>UNIT_KNIGHT</Type>
            <bOnlyDefensive>1</bOnlyDefensive>
        </UnitInfo>
    </UnitInfos>
</Civ4UnitInfos>

That's all we need, because the game loads the main XML first, and then loads the modules, and only changes the changed XML lines. Just make sure you include the CIV4UnitSchema.xml in the folder with your module. Then, add the entry for the folder in the ModularLoadingControls file as seen in this tutorial.

Since Rom is Woc based, there is no need to edit the ini file.

There, you now know how to make a simple Modmod.:goodjob:
 
And guys!!! Remember to turn of mipmaps when creating dds buttons.
RoM is heavy on the RAM and a lot of us turns down to low res texture graphics which makes a lot of the new stuff "unplayable".

Example :

High Res Textures
attachment.php


Low Res Textures
attachment.php


Low Res Originals
attachment.php
 
And guys!!! Remember to turn of mipmaps when creating dds buttons.
RoM is heavy on the RAM and a lot of us turns down to low res texture graphics which makes a lot of the new stuff "unplayable".

Example :

High Res Textures
attachment.php


Low Res Textures
attachment.php


Low Res Originals
attachment.php

I'm no graphics expert. Could you clarify how to fix the low res versions. I see the mipmap settings, but I have no idea what they should be.
 
Alright, now to stick my neck out and broaden my horizens. I may try to tweek/putz around and try my hand at trying to moddify a few things - but need lots of TLC.

My first effort is to change the retreat values for combat units. I want to have most units have a higher retreat chance % (especially w/ scouts, cav, lighter units). What is the file path(s) and what line(s) do I need to alter?

If this works, I may try to increase the cost of these units as well.

Thanks in advance for any and all advice!
 
Alright, now to stick my neck out and broaden my horizens. I may try to tweek/putz around and try my hand at trying to moddify a few things - but need lots of TLC.

My first effort is to change the retreat values for combat units. I want to have most units have a higher retreat chance % (especially w/ scouts, cav, lighter units). What is the file path(s) and what line(s) do I need to alter?

If this works, I may try to increase the cost of these units as well.

Thanks in advance for any and all advice!
XML is very self explanatory.

The unit info is in the UnitInfos.xml file

Find this line on the unit you want to change
Code:
<iWithdrawalProb>x</iWithdrawalProb>
change it to whatever you like.

For cost change this line on the unit you want to change <iCost>x</iCost>.

Good luck!:goodjob:
 
Alright, now to stick my neck out and broaden my horizens. I may try to tweek/putz around and try my hand at trying to moddify a few things - but need lots of TLC.

My first effort is to change the retreat values for combat units. I want to have most units have a higher retreat chance % (especially w/ scouts, cav, lighter units). What is the file path(s) and what line(s) do I need to alter?

If this works, I may try to increase the cost of these units as well.

Thanks in advance for any and all advice!

working on the same thing. vincentz already made a small provisoric modmod that gives the tactics promotion to all units build in a city with a barracks (saves a lot of work since you do not need to modify millions of units for this; despite promotions use the same scheme like units do). but if you want the retreat chances better fine tuned for different unit types you'll have to make new promotions only available for those...

But my question about modmod is this: can they modify anything more than simple xml files? or is it possible to add phyton stuff or even modifications to core c++ code?

i've the intention to change the xp gain from rereats to -1 so i guess this cannot be done by simple changing some xml entries. i hope this is handled somewhere in the phyton scripts but i didn't find it yet. any1 knows where to search for that? or is this coded in the core dll soemewhere?
 
working on the same thing. vincentz already made a small provisoric modmod that gives the tactics promotion to all units build in a city with a barracks (saves a lot of work since you do not need to modify millions of units for this; despite promotions use the same scheme like units do). but if you want the retreat chances better fine tuned for different unit types you'll have to make new promotions only available for those...

But my question about modmod is this: can they modify anything more than simple xml files? or is it possible to add phyton stuff or even modifications to core c++ code?

i've the intention to change the xp gain from rereats to -1 so i guess this cannot be done by simple changing some xml entries. i hope this is handled somewhere in the phyton scripts but i didn't find it yet. any1 knows where to search for that? or is this coded in the core dll soemewhere?

Modmods can be XML, Python or C++. Installation and compatibility problems arise with Python and C++ because they are not "Civ modular".

In Civ XML "-1" often represents "no limit". have you looked in the Modiki? See the CivFanatics tool bar.
 
i pulled out heavy guns to make that xp change and looked into the c++ files ready to modify... only to read that the value i seek to change is taken from global defines xml. hmpf. ok putting it to -1 would work as intended (so negative changes to xp are allowed in principle) but only in case the actual xp is higher than 0 because otherwise an assertion is called that checks for negative xp; although there is something like MAX_XP value to bound xp from above there's no lower bound in the code...

on a secound thought giving just no xp for retreats seems fair enough. but anyway, how would i include a modified dll to a modmod? just put it into the directory?

EDIT: and another question that just came into my mind: how is override order defined if 2 modmod modify the very same values? is the order specified by the "MLF_CIV4ModularLoadingControls.xml" file maybe?
 
i pulled out heavy guns to make that xp change and looked into the c++ files ready to modify... only to read that the value i seek to change is taken from global defines xml. hmpf. ok putting it to -1 would work as intended (so negative changes to xp are allowed in principle) but only in case the actual xp is higher than 0 because otherwise an assertion is called that checks for negative xp; although there is something like MAX_XP value to bound xp from above there's no lower bound in the code...

Heavy Guns indeed. ;)

on a secound thought giving just no xp for retreats seems fair enough. but anyway, how would i include a modified dll to a modmod? just put it into the directory?

Rise of Mankind uses RevDCM's SDK, so make sure you are using their source code first.

Overwriting the DLL in the Rise of Mankind assets folder is what you need to do.

However, a word of warning, custom dll's make your changes incompatible with other dll-based modmod's; specifically, mine.

EDIT: and another question that just came into my mind: how is override order defined if 2 modmod modify the very same values? is the order specified by the "MLF_CIV4ModularLoadingControls.xml" file maybe?

The MLF file does determine the order, you are correct. If I edit a file, and it is edited again, the only changes that will be noticed are in the file that is loaded last.
 
Rise of Mankind uses RevDCM's SDK, so make sure you are using their source code first.

Overwriting the DLL in the Rise of Mankind assets folder is what you need to do.

ah, thx for the fast answere. so modmods cannot override the dll, ok. and oups, you're right i've taken the wrong code... just forgot that RoM doesn't use the default BtS dll.

However, a word of warning, custom dll's make your changes incompatible with other dll-based modmod's; specifically, mine.

yeah i just realized that there's just one single dll, so mods based on changing it are forced to be merged on code level to work together :(. but fortunatly it seems i've currently no need to edit the dll right now.
 
I was trying to make a simple xml mod, but I get schema errors when getting to the step to cut out the duplicate lines from the original. It works fine when I include the whole building definition, unchanged lines and all. I made sure to leave type and buildingclass entries so it could find it.

Proper schema really helps. I borrowed the one from afforesses education modmod, and that works better than wherever I got the one from I was using.
Spoiler :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with Notepad -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Nathan Muise 2009 -->
<!-- -->
<!-- Building Infos -->
<Civ4BuildingInfos xmlns="x-schema:Winthrowe_CIV4BuildingsSchema.xml">
	<BuildingInfos>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_SCHOOL_OF_SCRIBES</BuildingClass>
			<Type>BUILDING_SCHOOL_OF_SCRIBES</Type>
			<CommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>20</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
			</CommerceChanges>
			<ObsoleteSafeCommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>1</iCommerce>
			</ObsoleteSafeCommerceChanges>
			<CommerceChangeDoubleTimes>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>1000</iCommerce>
			</CommerceChangeDoubleTimes>
			<CommerceModifiers>
				<iCommerce>0</iCommerce>
				<iCommerce>15</iCommerce>
			</CommerceModifiers>
		</BuildingInfo>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_PALACE</BuildingClass>
			<Type>BUILDING_PALACE</Type>
			<YieldChanges>
				<iYield>0</iYield>
				<iYield>0</iYield>
				<iYield>8</iYield>
			</YieldChanges>
			<CommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>20</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>10</iCommerce>
			</CommerceChanges>
			<ObsoleteSafeCommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>2</iCommerce>
			</ObsoleteSafeCommerceChanges>
		</BuildingInfo>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_SCOTLAND_YARD</BuildingClass>
			<Type>BUILDING_SCOTLAND_YARD</Type>
			<UnitCombatFreeExperiences>
				<UnitCombatFreeExperience>
					<UnitCombatType>UNITCOMBAT_SPY</UnitCombatType>
					<iExperience>3</iExperience>
				</UnitCombatFreeExperience>
			</UnitCombatFreeExperiences>
		</BuildingInfo>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_MEETING_HALL</BuildingClass>
			<Type>BUILDING_MEETING_HALL</Type>
			<UnitCombatFreeExperiences>
				<UnitCombatFreeExperience>
					<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
					<iExperience>1</iExperience>
				</UnitCombatFreeExperience>
				<UnitCombatFreeExperience>
					<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
					<iExperience>1</iExperience>
				</UnitCombatFreeExperience>
				<UnitCombatFreeExperience>
					<UnitCombatType>UNITCOMBAT_SPY</UnitCombatType>
					<iExperience>2</iExperience>
				</UnitCombatFreeExperience>
			</UnitCombatFreeExperiences>
		</BuildingInfo>
	</BuildingInfos>
</Civ4BuildingInfos>
 
Back
Top Bottom