Format Conversion Question

1diehard1

Chieftain
Joined
Oct 4, 2007
Messages
21
Hi, I am an amateur modder, making a total conversion mod, and I want to know how to change some images I have into the proper format. I have a .dds file, for a few images, and the corresponding .tga files. You may notice I have one post, and there is a good reason for that, I dont know much about this.

I have blender, with .NIF tools, but that doesn't work, at least not the way I'm using it.


diehard

EDIT: I have read a few tutorials on this site, so please don't just send me a link to those, it would be a waste of time for both of us.
 
First off, this belongs in the "Civ4 - Creation & Customization", this little area is for finished units only.

On to the question. What are you trying to do, get textures for a unit? Did you model this unit, or is it just a reskin?
 
i believe its a reskin, i downloaded it from the downloads section, and i want it to be a model i can add as a unit. all i need is to convert it to the proper format.
 
Wow, bumping something after having it online for one hour only, you sure lack patience. The comment that this thread is in the wrong forum still is valid too.
 
well, that wasn't helpful. an hour? thats nothing, if not a display of patience. also, if youre going to post, please actually help me. I can't exactly move the thread.....
 
You could open a second thread there and leave this one alone.

If I actually knew what your problem was and how to solve it I would have said so ;)

.dds is the correct format, no need to convert it. There are two tools which convert to it that I am aware of, DDSConverter and DXTBmp, I doubt that is the answer to your question though, if it is, Google would have had it too (that is how I found them).
 
okay, well, I want to add the model into the mod. if .dds is the correct format, could you tell me how to add it into the mod?
 
You maybe should patiently search the tutorialforum for an answer. Insisting on getting help in the wrong forum really won't get you far. There are plenty of beginnertutorials that will explain step by step everything you need to know to get started.;)
 
Since you said you have read the tutorials you should know the answer :)

Ok, let's start fresh here just to clarify a few things.

.kfm is the animation of the unit
.nif is its 'shape' (i.e. what helmet, whether it uses a shield and spear or a sword etc.)
.dds is the texture (i.e. the coloration for helmet, face, shield, clothes etc.)

I can't help you with changing / creating .kfm and .nif files, never tried that yet (or at least not successfully). NifSkope probably is your best bet for changing .nif files, no idea for .kfm.

If you want to edit .dds files, convert them to .bmp or .png or something a graphics program understands and convert the result back. As long as you only change existing .dds files you should be fine, adding additional ones will require .nif changes.

In order to then add the changed unit to your game you should be able to work it out using the tutorials and maybe some experimenting (worked for me). Here is what I learned from them and wrote down for personal use (never actually tried adding new units yet though, I only replaced the graphics so far, so take that part with a grain of salt).

Spoiler :

XML/Art/CIV4ArtDefines_Unit.xml

Create a new UnitArtInfo block, based on the default type of its unit, unless this is the unique version of the unit, in that case use its version instead (to check which unit is a unique unit, look them up in CIV4CivilizationInfos.xml).
Change the Type, NIF, KFM and SHADERNIF blocks within the copy.

Code:
                <UnitArtInfo>
->                      <Type>ART_DEF_UNIT_SWORDSMAN_GERMAN</Type>
                        <Button>,Art/Interface/Buttons/Units/Swordsman.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,5</Button>
                        <fScale>0.44</fScale>
                        <fInterfaceScale>1.0</fInterfaceScale>
                        <bActAsLand>0</bActAsLand>
                        <bActAsAir>0</bActAsAir>
->                        <NIF>Art/Units/Swordsman_German/LightSwordsman.nif</NIF>
->                        <KFM>Art/Units/Swordsman_German/LightSwordsman.kfm</KFM>
->                        <SHADERNIF>Art/Units/Swordsman_German/LightSwordsman_FX.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_UNIT</TrainSound>
                        <AudioRunSounds>
                                <AudioRunTypeLoop/>
                                <AudioRunTypeEnd/>
                        </AudioRunSounds>
                </UnitArtInfo>

XML/Units/CIV4UnitInfos.xml

If you add a new type of unit and not just a different graphical representation, you need to create a new UnitInfo block, based on the default type of its unit class (or the unique unit type if it is the unique unit of the civilization you add it to).
Change the EarlyArtDefineTag blocks - and the Type block if it is NOT the unique unit.

If you only want to change the graphics of a unit but not its stats, this file does not need to be changed at all.

Code:
                <UnitInfo>
                        <Class>UNITCLASS_SWORDSMAN</Class>
->                        <Type>UNIT_SWORDSMAN_GERMAN</Type>
                        <UniqueNames/>
                        <Special>NONE</Special>
                        <Capture>NONE</Capture>
                        <Combat>UNITCOMBAT_MELEE</Combat>
                        <Domain>DOMAIN_LAND</Domain>
                        <DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
                        <Invisible>NONE</Invisible>
                        <SeeInvisible>NONE</SeeInvisible>
                        <Description>TXT_KEY_UNIT_SWORDSMAN</Description>
                        <Civilopedia>TXT_KEY_UNIT_SWORDSMAN_PEDIA</Civilopedia>
                        <Strategy>TXT_KEY_UNIT_SWORDSMAN_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_MACEMAN</UnitClassUpgradeType>
                                        <bUnitClassUpgrade>1</bUnitClassUpgrade>
                                </UnitClassUpgrade>
                        </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_RESERVE</UnitAIType>
                                        <bUnitAI>1</bUnitAI>
                                </UnitAI>
                                <UnitAI>
                                        <UnitAIType>UNITAI_CITY_DEFENSE</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_IRON_WORKING</PrereqTech>
                        <TechTypes/>
                        <BonusType>BONUS_IRON</BonusType>
                        <PrereqBonuses/>
                        <ProductionTraits/>
                        <Flavors/>
                        <iAIWeight>0</iAIWeight>
                        <iCost>40</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>6</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>10</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>NONE</DomainCargo>
                        <iCargo>0</iCargo>
                        <iConscription>0</iConscription>
                        <iCultureGarrison>5</iCultureGarrison>
                        <iExtraCost>0</iExtraCost>
                        <iAsset>2</iAsset>
                        <iPower>3</iPower>
                        <UnitMeshGroups>
                                <iGroupSize>3</iGroupSize>
                                <fMaxSpeed>1.75</fMaxSpeed>
                                <fPadTime>1</fPadTime>
                                <iMeleeWaveSize>3</iMeleeWaveSize>
                                <iRangedWaveSize>0</iRangedWaveSize>
                                <UnitMeshGroup>
                                        <iRequired>3</iRequired>
->                                        <EarlyArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</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>

XML/Civilizations/CIV4UnitArtStyleTypeInfos.xml

Create a new UnitArtStyleTypeInfo block, based on the block which is used by the civilization you want to add the units to. You can look up the type in CIV4CivilizationInfos.xml (see below, as you will have to change it, after having created your new style type).

For each unit you set up a UnitArtInfo (in CIV4ArtDefines_Unit.xml), you need to either change the existing StyleUnit block (if there is one) or add a new one (always for new units).
Leave all unit styles for which you did not create new art unchanged (i.e. do not remove them).

Make sure the unit you add is not a unique unit for the civ you want to add it to, the info is stored in CIV4CivilizationInfos.xml. If it is, use the name of the unique unit instead of the generic one.

Code:
                                <StyleUnit>
-> ?                                    <UnitType>UNIT_SWORDSMAN</UnitType>
                                        <UnitMeshGroup>
->                                                <EarlyArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</EarlyArtDefineTag>
->                                                <LateArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</LateArtDefineTag>
->                                                <MiddleArtDefineTag>ART_DEF_UNIT_SWORDSMAN_GERMAN</MiddleArtDefineTag>
                                        </UnitMeshGroup>
                                </StyleUnit>

XML/Civilizations/CIV4CivilizationInfos.xml

In the appropriate civilization (CIVILIZATION_*), enter the appropriate new art style.

Code:
                <CivilizationInfo>
                        <Type>CIVILIZATION_GERMANY</Type>
                        <Description>TXT_KEY_CIV_GERMANY_DESC</Description>
                        <ShortDescription>TXT_KEY_CIV_GERMANY_SHORT_DESC</ShortDescription>
                        <Adjective>TXT_KEY_CIV_GERMANY_ADJECTIVE</Adjective>
                        <Civilopedia>TXT_KEY_CIV_GERMANY_PEDIA</Civilopedia>
                        <DefaultPlayerColor>PLAYERCOLOR_GRAY</DefaultPlayerColor>
                        <ArtDefineTag>ART_DEF_CIVILIZATION_GERMANY</ArtDefineTag>
                        <ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
->                        <UnitArtStyleType>UNIT_ARTSTYLE_GERMAN</UnitArtStyleType>
                        <bPlayable>1</bPlayable>
                        <bAIPlayable>1</bAIPlayable>
                        <Cities>
                        .
                        .
                        .

XML/GlobalTypes.xml

Finally, the new art style should be added to GlobalTypes.xml Append your type in this block :

Code:
	<ArtStyleTypes>
		<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
		<ArtStyleType>ARTSTYLE_ASIAN</ArtStyleType>
		<ArtStyleType>ARTSTYLE_SOUTH_AMERICA</ArtStyleType>
		<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
		<ArtStyleType>ARTSTYLE_GRECO_ROMAN</ArtStyleType>
		<ArtStyleType>ARTSTYLE_BARBARIAN</ArtStyleType>
	</ArtStyleTypes>

I never actually did this part and it works nicely without doing so, maybe this is no longer needed thanks to modular loading, no idea.

If you actually want to use modular xml, some of the info here is outdated, all the changes are still valid, but you create new xml files for each civilization / art style / etc. instead of editing (a copy of) the standard xml file which includes all of them.
 
Back
Top Bottom