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

Custom Unit Randomly Crashes Game

Discussion in 'Civ4 - Creation & Customization' started by Telecide, Nov 21, 2008.

  1. Telecide

    Telecide Chieftain

    Joined:
    Oct 28, 2005
    Messages:
    29
    Ughhh! I've been trying to figure this out for months. If someone could help I'd be very grateful! I've put a custom futuristic tank late in the game (it gets enabled with fusion). Sometimes the game will run for 50 more turns after they enter the game. Sometimes, the next turn after one is built there's a crash.

    At first I thought it was something with the art files (I'm using Rabbit's tank), but I changed it back to look just like modern armor and it still crashes. It can go on impassible terrain and water and is in it's own custom combat group called "future units." Also made available to only one civilization. Any ideas?
     
  2. cIV_khanh93

    cIV_khanh93 Prince

    Joined:
    Nov 8, 2008
    Messages:
    528
    Upload the work so someone can have a look.
     
  3. Telecide

    Telecide Chieftain

    Joined:
    Oct 28, 2005
    Messages:
    29
    Thanks for the reply!

    Ok, here's my Cyborgtank_Civ4UnitInfos.xml (it's modular)

    Code:
    
    <?xml version="1.0"?>
    <Civ4UnitInfos xmlns="x-schema:CYBORGTANK_CIV4UnitSchema.xml">
    	<UnitInfos>
    		<UnitInfo>
    			<Class>UNITCLASS_CYBORGTANK</Class>
    			<Type>UNIT_CYBORGTANK</Type>
    			<UniqueNames/>
    			<Special>NONE</Special>
    			<Capture>NONE</Capture>
    			<Combat>UNITCOMBAT_FUTURE</Combat>
    			<Domain>DOMAIN_LAND</Domain>
    			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
    			<Invisible>NONE</Invisible>
    			<SeeInvisible>NONE</SeeInvisible>
    			<Description>Cyborg Tank</Description>
    			<Civilopedia>The ultimate in cybernetics.</Civilopedia>
    			<Strategy>The cyborg tank strikes fear into the hearts of the enemy.</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>0</bFirstStrikeImmune>
    			<bNoDefensiveBonus>1</bNoDefensiveBonus>
    			<bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>
    			<bCanMoveImpassable>1</bCanMoveImpassable>
    			<bCanMoveAllTerrain>1</bCanMoveAllTerrain>
    			<bFlatMovementCost>0</bFlatMovementCost>
    			<bIgnoreTerrainCost>1</bIgnoreTerrainCost>
    			<bNukeImmune>1</bNukeImmune>
    			<bPrereqBonuses>0</bPrereqBonuses>
    			<bPrereqReligion>0</bPrereqReligion>
    			<bMechanized>1</bMechanized>
    			<bSuicide>0</bSuicide>
    			<bHiddenNationality>0</bHiddenNationality>
    			<bAlwaysHostile>0</bAlwaysHostile>
    			<UnitClassUpgrades/>
    			<UnitClassTargets/>
    			<UnitCombatTargets/>
    			<UnitClassDefenders/>
    			<UnitCombatDefenders/>
    			<FlankingStrikes/>
    			<UnitAIs>
    				<UnitAI>
    					<UnitAIType>UNITAI_ATTACK</UnitAIType>
    					<bUnitAI>1</bUnitAI>
    				</UnitAI>
    				<UnitAI>
    					<UnitAIType>UNITAI_ATTACK_CITY</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_FUSION</PrereqTech>
    			<TechTypes/>
    			<BonusType>NONE</BonusType>
    			<PrereqBonuses/>
    			<ProductionTraits/>
    			<Flavors/>
    			<iAIWeight>0</iAIWeight>
    			<iCost>240</iCost>
    			<iHurryCostModifier>0</iHurryCostModifier>
    			<iAdvancedStartCost>100</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMinAreaSize>-1</iMinAreaSize>
    			<iMoves>12</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>100</iCombat>
    			<iCombatLimit>100</iCombatLimit>
    			<iAirCombat>0</iAirCombat>
    			<iAirCombatLimit>0</iAirCombatLimit>
    			<iXPValueAttack>4</iXPValueAttack>
    			<iXPValueDefense>2</iXPValueDefense>
    			<iFirstStrikes>1</iFirstStrikes>
    			<iChanceFirstStrikes>0</iChanceFirstStrikes>
    			<iInterceptionProbability>100</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/>
    			<FeatureDefenses/>
    			<UnitClassAttackMods/>
    			<UnitClassDefenseMods/>
    			<UnitCombatMods/>
    			<UnitCombatCollateralImmunes/>
    			<DomainMods/>
    			<BonusProductionModifiers/>
    			<iBombRate>0</iBombRate>
    			<iBombardRate>0</iBombardRate>
    			<SpecialCargo>NONE</SpecialCargo>
    			<DomainCargo>DOMAIN_LAND</DomainCargo>
    			<iCargo>1</iCargo>
    			<iConscription>0</iConscription>
    			<iCultureGarrison>16</iCultureGarrison>
    			<iExtraCost>0</iExtraCost>
    			<iAsset>6</iAsset>
    			<iPower>40</iPower>
    			<UnitMeshGroups>
    				<iGroupSize>1</iGroupSize>
    				<fMaxSpeed>1.75</fMaxSpeed>
    				<fPadTime>1</fPadTime>
    				<iMeleeWaveSize>1</iMeleeWaveSize>
    				<iRangedWaveSize>1</iRangedWaveSize>
    				<UnitMeshGroup>
    					<iRequired>1</iRequired>
    					<EarlyArtDefineTag>ART_DEF_UNIT_MODERN_ARMOR</EarlyArtDefineTag>
    				</UnitMeshGroup>
    			</UnitMeshGroups>
    			<FormationType>FORMATION_TYPE_MACHINE</FormationType>
    			<HotKey/>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>0</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    			<FreePromotions>
    				<FreePromotion>
    					<PromotionType>PROMOTION_BLITZ</PromotionType>
    					<bFreePromotion>1</bFreePromotion>
    				</FreePromotion>
    			</FreePromotions>
    			<LeaderPromotion>NONE</LeaderPromotion>
    			<iLeaderExperience>0</iLeaderExperience>
    		</UnitInfo>
    	</UnitInfos>
    </Civ4UnitInfos>
    
    
    And Cyborgtank_Civ4UnitClassInfos.xml

    Code:
    
    <?xml version="1.0"?>
    <!-- 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 -->
    <!-- -->
    <!-- UnitClass Schema -->
    <Civ4UnitClassInfos xmlns="x-schema:CYBORGTANK_CIV4UnitSchema.xml">
    	<UnitClassInfos>
    		<UnitClassInfo>
    			<Type>UNITCLASS_CYBORGTANK</Type>
    			<Description>TXT_KEY_UNIT_CYBORGTANK</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
    			<iInstanceCostModifier>0</iInstanceCostModifier>
    			<DefaultUnit>NONE</DefaultUnit>
    		</UnitClassInfo>
    	</UnitClassInfos>
    </Civ4UnitClassInfos>
    
    
    And Cyborgtank_Civ4UnitCombatInfos.xml

    Code:
    
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Basic Infos -->
    <Civ4UnitCombatInfos xmlns="x-schema:CYBORGTANK_CIV4BasicInfoSchema.xml">
    	<UnitCombatInfos>
    		<UnitCombatInfo>
    			<Type>UNITCOMBAT_FUTURE</Type>
    			<Description>Future Unit</Description>
    			<Button>,Art/Interface/Buttons/Promotions/Ambush.dds,Art/Interface/Buttons/Promotions_Atlas.dds,2,1</Button>
    		</UnitCombatInfo>
    	</UnitCombatInfos>
    </Civ4UnitCombatInfos>
    
    
    For now I just have the Cyborgtank_Civ4ArtDefines_Unit.xml copied from the default modern armor file.

    I'm totally baffled :(
    Thanks :)
     
  4. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    20,306
    I think new unitcombats have to be defined somewhere. Why dont you just keep it as armour?
     

Share This Page