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

Help with a modmod needed

Discussion in 'Civ4 - Star Trek Mod' started by Roll, Sep 4, 2008.

  1. Roll

    Roll Chieftain

    Joined:
    Jan 25, 2008
    Messages:
    18
    Hi,

    I've been cooking up a slight modmod for awhile now but have run into a problem with some new promotions.

    To bypass the issue with Bird of Prey units not defending I decided to create a separate set of promotions to give them invisibility. The first of the new promotions just allows the second which grants invisibility but without the gold cost.

    The problem I'm running into is that the second promotion is not requiring the first in order to be enabled, even though I've set the first as its prerequisite.

    If anyone can tell me what I did wrong with the following code to cause this I'd greatly appreciate it.

    First Promotion:
    Spoiler :
    <PromotionInfo>
    <Type>PROMOTION_KLINGON_CLOAK1</Type>
    <Description>TXT_KEY_PROMOTION_KLINGON_CLOAK1</Description>
    <Sound>AS2D_CLOAK_ON</Sound>
    <LayerAnimationPath>NONE</LayerAnimationPath>
    <PromotionPrereq>NONE</PromotionPrereq>
    <PromotionPrereqOr1>NONE</PromotionPrereqOr1>
    <PromotionPrereqOr2>NONE</PromotionPrereqOr2>
    <TechPrereq>NONE</TechPrereq>
    <StateReligionPrereq>NONE</StateReligionPrereq>
    <Invisible>NONE</Invisible>
    <bLeader>0</bLeader>
    <bBlitz>0</bBlitz>
    <bAmphib>0</bAmphib>
    <bRiver>0</bRiver>
    <bEnemyRoute>0</bEnemyRoute>
    <bAlwaysHeal>0</bAlwaysHeal>
    <bHillsDoubleMove>0</bHillsDoubleMove>
    <bImmuneToFirstStrikes>1</bImmuneToFirstStrikes>
    <iVisibilityChange>0</iVisibilityChange>
    <iMovesChange>0</iMovesChange>
    <iMoveDiscountChange>0</iMoveDiscountChange>
    <iAirRangeChange>0</iAirRangeChange>
    <iInterceptChange>0</iInterceptChange>
    <iEvasionChange>0</iEvasionChange>
    <iWithdrawalChange>0</iWithdrawalChange>
    <iCargoChange>0</iCargoChange>
    <iCollateralDamageChange>0</iCollateralDamageChange>
    <iBombardRateChange>0</iBombardRateChange>
    <iFirstStrikesChange>0</iFirstStrikesChange>
    <iChanceFirstStrikesChange>1</iChanceFirstStrikesChange>
    <iEnemyHealChange>0</iEnemyHealChange>
    <iNeutralHealChange>0</iNeutralHealChange>
    <iFriendlyHealChange>0</iFriendlyHealChange>
    <iSameTileHealChange>0</iSameTileHealChange>
    <iAdjacentTileHealChange>0</iAdjacentTileHealChange>
    <iGoldCost>0</iGoldCost>
    <iCombatPercent>0</iCombatPercent>
    <iCityAttack>0</iCityAttack>
    <iCityDefense>0</iCityDefense>
    <iHillsAttack>0</iHillsAttack>
    <iHillsDefense>0</iHillsDefense>
    <iKamikazePercent>0</iKamikazePercent>
    <iRevoltProtection>0</iRevoltProtection>
    <iCollateralDamageProtection>0</iCollateralDamageProtection>
    <iPillageChange>0</iPillageChange>
    <iUpgradeDiscount>0</iUpgradeDiscount>
    <iExperiencePercent>0</iExperiencePercent>
    <TerrainAttacks/>
    <TerrainDefenses/>
    <FeatureAttacks/>
    <FeatureDefenses/>
    <UnitCombatMods/>
    <DomainMods/>
    <TerrainDoubleMoves/>
    <FeatureDoubleMoves/>
    <UnitCombats>
    </UnitCombats>
    <HotKey/>
    <bAltDown>0</bAltDown>
    <bShiftDown>0</bShiftDown>
    <bCtrlDown>0</bCtrlDown>
    <iHotKeyPriority>0</iHotKeyPriority>
    <Button>,Art/Interface/Buttons/Tech/CloakingDevice.dds</Button>
    </PromotionInfo>


    Second Promotion:
    Spoiler :
    <PromotionInfo>
    <Type>PROMOTION_KLINGON_CLOAK2</Type>
    <Description>TXT_KEY_PROMOTION_KLINGON_CLOAK2</Description>
    <Sound>AS2D_CLOAK_ON</Sound>
    <LayerAnimationPath>NONE</LayerAnimationPath>
    <PromotionPrereq>NONE</PromotionPrereq>
    <PromotionPrereqOr1>PROMOTION_KLINGON_CLOAK1</PromotionPrereqOr1>
    <PromotionPrereqOr2>NONE</PromotionPrereqOr2>
    <TechPrereq>TECH_CLOAKING_DEVICE</TechPrereq>
    <StateReligionPrereq>NONE</StateReligionPrereq>
    <Invisible>INVISIBLE_CLOAKED</Invisible>
    <bLeader>0</bLeader>
    <bBlitz>0</bBlitz>
    <bAmphib>0</bAmphib>
    <bRiver>0</bRiver>
    <bEnemyRoute>0</bEnemyRoute>
    <bAlwaysHeal>0</bAlwaysHeal>
    <bHillsDoubleMove>0</bHillsDoubleMove>
    <bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
    <iVisibilityChange>0</iVisibilityChange>
    <iMovesChange>0</iMovesChange>
    <iMoveDiscountChange>0</iMoveDiscountChange>
    <iAirRangeChange>0</iAirRangeChange>
    <iInterceptChange>0</iInterceptChange>
    <iEvasionChange>0</iEvasionChange>
    <iWithdrawalChange>0</iWithdrawalChange>
    <iCargoChange>0</iCargoChange>
    <iCollateralDamageChange>0</iCollateralDamageChange>
    <iBombardRateChange>0</iBombardRateChange>
    <iFirstStrikesChange>0</iFirstStrikesChange>
    <iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
    <iEnemyHealChange>0</iEnemyHealChange>
    <iNeutralHealChange>0</iNeutralHealChange>
    <iFriendlyHealChange>0</iFriendlyHealChange>
    <iSameTileHealChange>0</iSameTileHealChange>
    <iAdjacentTileHealChange>0</iAdjacentTileHealChange>
    <iGoldCost>0</iGoldCost>
    <iCombatPercent>0</iCombatPercent>
    <iCityAttack>0</iCityAttack>
    <iCityDefense>0</iCityDefense>
    <iHillsAttack>0</iHillsAttack>
    <iHillsDefense>0</iHillsDefense>
    <iKamikazePercent>0</iKamikazePercent>
    <iRevoltProtection>0</iRevoltProtection>
    <iCollateralDamageProtection>0</iCollateralDamageProtection>
    <iPillageChange>0</iPillageChange>
    <iUpgradeDiscount>0</iUpgradeDiscount>
    <iExperiencePercent>0</iExperiencePercent>
    <TerrainAttacks/>
    <TerrainDefenses/>
    <FeatureAttacks/>
    <FeatureDefenses/>
    <UnitCombatMods/>
    <DomainMods/>
    <TerrainDoubleMoves/>
    <FeatureDoubleMoves/>
    <UnitCombats>
    <UnitCombat>
    <UnitCombatType>UNITCOMBAT_LIGHT</UnitCombatType>
    <bUnitCombat>1</bUnitCombat>
    </UnitCombat>
    </UnitCombats>
    <HotKey/>
    <bAltDown>0</bAltDown>
    <bShiftDown>0</bShiftDown>
    <bCtrlDown>0</bCtrlDown>
    <iHotKeyPriority>0</iHotKeyPriority>
    <Button>,Art/Interface/Buttons/Tech/CloakingDevice.dds</Button>
    </PromotionInfo>
     
  2. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    It looks like you set the first to be a prereq in the "Or" area. Unfortunately the or in this case is none. So if you have the tech it actually allows the second promotion based on the none. I think...
    Try putting the first promo here in the second listing and not in the or spot.

    <PromotionPrereq>PROMOTION_KLINGON_CLOAK1</PromotionPrereq>
     
  3. Roll

    Roll Chieftain

    Joined:
    Jan 25, 2008
    Messages:
    18
    Hi,

    Thanks for the help woodelf but it seems the code wasn't the problem. Civ4 just doesn't like the XML editor (Architag XRAY) I've been using, at least when it comes to altering the promotions file.

    I unzipped a clean copy and made the changes with a different editor and it worked. I find this really strange since I haven't had problems with any of the other Star Trek XML files though I have run into similar issues with other mods' XML files.
     

Share This Page