Here is my code for the Venicefootman

nokmirt

Emperor
Joined
Feb 14, 2009
Messages
5,088
Location
Iowa USA
I cannot get this unique unit to work my game crashes says civ4 has to close. I have add 4 other units to this mod and they all of course have their own unitclass, so I think I am doing something wrong because this is a unique unit just for my Venetian civ. Also I took Sakhr's H_maceman in his medieval unit pack, and added regular bts mace man files to the unit folder so I would have a kfm file for my art defines unit xml. When I look at the crash error log it says the app is 3.1.3 and this mod is for 3.1.7 and my dll is 3.1.7. I have a copy of the mod without venice footman installed and it works great. Not sure what the trouble is. Thanks for any help

From CIV4UnitInfos.xml

<UnitInfo>
<Class>UNITCLASS_MACEMAN</Class>
<Type>UNIT_ROME_VENICEFOOTMAN</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_MELEE</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_MACEMAN</Description>
<Civilopedia>TXT_KEY_UNIT_MACEMAN_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_MACEMAN_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>0</bFirstStrikeImmune>
<bNoDefensiveBonus>0</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_RIFLEMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_GRENADIER</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>
<FlankingStrikes/>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_RESERVE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_COUNTER</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_CITY_COUNTER</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_CIVIL_SERVICE</PrereqTech>
<TechTypes>
<PrereqTech>TECH_MACHINERY</PrereqTech>
<PrereqTech>NONE</PrereqTech>
<PrereqTech>NONE</PrereqTech>
</TechTypes>
<BonusType>NONE</BonusType>
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>NONE</BonusType>
<BonusType>NONE</BonusType>
</PrereqBonuses>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>70</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>1</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>10</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>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0</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>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
<iUnitCombatMod>50</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>3</iConscription>
<iCultureGarrison>6</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>3</iAsset>
<iPower>5</iPower>
<UnitMeshGroups>
<iGroupSize>5</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>5</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>5</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_ROME_VENICEFOOTMAN</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<FormationType>FORMATION_TYPE_MACE</FormationType>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
</UnitInfo>

From CIV4ArtDefines_Unit.xml

<UnitArtInfo>
<Type>UNIT_ROME_VENICEFOOTMAN</Type>
<Button>,Art/Interface/Buttons/Units/HeavySwordsman_128.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,5,6</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/Unique/Rome/Venicefootman/HeavySwordsman.nif</NIF>
<KFM>Art/Units/Unique/Rome/Venicefootman/maceman.kfm</KFM>
<SHADERNIF>Art/Units/Unique/Rome/Venicefootman/HeavySwordsman.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>

From CIV4CivilizationInfos.xml

<CivilizationInfo>
<Type>CIVILIZATION_ROME</Type>

Units>
<Unit>
<UnitClassType>UNITCLASS_SWORDSMAN</UnitClassType>
<UnitType>UNIT_ROME_PRAETORIAN</UnitType>
</Unit>

<Unit>
<UnitClassType>UNITCLASS_MACEMAN</UnitClassType>
<UnitType>UNIT_ROME_VENICEFOOTMAN</UnitType>
</Unit>
</Units>

I have not changed the civilopedia or strategy all that goes to Maceman. First I wanted to get the unit working in game first. Are there any other files I have to change? Thanks for the help
 
Are you sure that his 'maceman' uses MAceman animations as opposed to Charlemagne HEavy Swordsman? The heavy swordsman is from Charlemagne, and when I dled his units, I don't remember any using maceman animation.
 
Are you sure that his 'maceman' uses MAceman animations as opposed to Charlemagne HEavy Swordsman? The heavy swordsman is from Charlemagne, and when I dled his units, I don't remember any using maceman animation.

good question never seen the unit work but the files he had mention heavy swordsman. The Pic he showed showed a guy holding a huge mace.
 
Are you sure that his 'maceman' uses MAceman animations as opposed to Charlemagne HEavy Swordsman? The heavy swordsman is from Charlemagne, and when I dled his units, I don't remember any using maceman animation.

I added them to it from BTS maceman because the unit folder was missing the kfm file. maybe thats the problem but not all the required files were in the H_maceman folder, Its a whole unit pack maybe the files I should use are in another of the unit folders he provided.
 
From Unit Infos:
<EarlyArtDefineTag>ART_DEF_UNIT_VENICEFOOTMAN</EarlyArtDefineTag>

From Art Defines:
<Type>UNIT_ROME_VENICEFOOTMAN</Type>

:culture:One of these things, is not like the other
One of these things, is not the same:culture:
 
For the crashing, its in all likelihood what Phungus showed. To link to the Charlemagne heavy swordsman, open the unitart infos in the charlemagne mod and copy the KFM line from it.
 
From Unit Infos:
<EarlyArtDefineTag>ART_DEF_UNIT_VENICEFOOTMAN</EarlyArtDefineTag>

From Art Defines:
<Type>UNIT_ROME_VENICEFOOTMAN</Type>

:culture:One of these things, is not like the other
One of these things, is not the same:culture:

Yes I fixed that and it still crashes
 
How did you fix it? Both tags absolutely need to be the same exact thing, and to stick to standard convention, that should be ART_DEF_UNIT_ROME_VENICEFOOTMAN
No matter what, even if there was another problem, that will always cause a crash, and that particular art problem doesn't even send anything to the dump, which can be quite annoying if there is a typo in the ethnic unit file, as it's a pain to track down...

Edit: Also when you post code here, nest it inside code tags: [code]Place Code here[/code]
 
maybe a silly question, but in BTS did they move the button tag to artdefines? in warlords and vanilla it was in the unitinfo file just after the earlyartdefines at the bottom of the entries.
 
maybe a silly question, but in BTS did they move the button tag to artdefines? in warlords and vanilla it was in the unitinfo file just after the earlyartdefines at the bottom of the entries.

The button has been moved to artdefines, yes.

Economic Left/Right: 7.38
Social Libertarian/Authoritarian: 4.72
Does The Empire in star wars ruled by Dearth Vader's iron fist, or the Taliban's ruthless missuse of Religion represent your ideal state of government?
 
ohhh thread jacking, yeah i've notices almost everyone with politicalCompass numbers in their names on this site are way negative on both counts.
I'm fro freedom of the economy, low taxes, flat taxes, deregulation and so forth. on the Authoritarian/libertarian scale i'm for rigid state control of societal values, nationalism, and the only reason my score got pushed towards the middle was because of my answers to the questions on religion, seeing as i'm not a fundamentalist.

So basically darth Vader, with a free market economy.
 
4.62 isn't anywhere near the middle

But to stay on topic: the ArtDefines has to be exactly the same. Even a small error can cause crashes, and they can be a [female dog] to correct.
 
yes, as the above poster said make sure you've got your art tags exactly the same as the file names, you should make sure the folder path is correct too: Art/Units/Unique, etc

regarding the PoliCompass, it would have been more like 6 or 7 without those questions is what i meant.
 
How did you fix it? Both tags absolutely need to be the same exact thing, and to stick to standard convention, that should be ART_DEF_UNIT_ROME_VENICEFOOTMAN
No matter what, even if there was another problem, that will always cause a crash, and that particular art problem doesn't even send anything to the dump, which can be quite annoying if there is a typo in the ethnic unit file, as it's a pain to track down...

Edit: Also when you post code here, nest it inside code tags: [code]Place Code here[/code]

I was giving the admin the code to check over and he could not get the unit to work so I think it is more complicated than you think
 
How did you fix it? Both tags absolutely need to be the same exact thing, and to stick to standard convention, that should be ART_DEF_UNIT_ROME_VENICEFOOTMAN
No matter what, even if there was another problem, that will always cause a crash, and that particular art problem doesn't even send anything to the dump, which can be quite annoying if there is a typo in the ethnic unit file, as it's a pain to track down...

Edit: Also when you post code here, nest it inside code tags: [code]Place Code here[/code]

the admin could not get the mod not too crash so I think it os more complicated than you think
 
Well, post your corrected code then. Like I said though, that typo would always cause a crash, no matter what, so it was a problem at the time I posted it.
 
the mods are not necissarily good at modifying game files (aka modding). they are moderators of the forum.
Adding a unit and the correct art defines is modding 101... basically one of the most simple things to do.

I'd suggest do 1 thing at a time and settle down and read some tutorials
 
Back
Top Bottom