Unit Model showing as Spearman

Skaz881

History Major
Joined
Dec 15, 2013
Messages
1,375
Location
Crystal Lake, Illinois, USA.
I know this has been answered before, but it was a long time ago and I can't remember. Why would a unit show up as a Spearman instead of the model? I made sure VFS was set to true and everything!

Code:
<UnitClasses>
		<Row>
			<Type>UNITCLASS_CHARIOT</Type>
			<Description>TXT_KEY_UNIT_CHARIOT</Description>
			<DefaultUnit>UNIT_CHARIOT</DefaultUnit>
		</Row>
	</UnitClasses>
	<Units>
		<Row>
			<Class>UNITCLASS_CHARIOT</Class>
			<Type>UNIT_CHARIOT</Type>
			<PrereqTech>TECH_THE_WHEEL</PrereqTech>
			<Combat>8</Combat>
			<Cost>70</Cost>
			<FaithCost>100</FaithCost>
			<RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
			<Moves>4</Moves>
			<CombatClass>UNITCOMBAT_MELEE</CombatClass>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
			<Description>TXT_KEY_UNIT_CHARIOT</Description>
			<Civilopedia>TXT_KEY_CIV5_CHARIOT_TEXT</Civilopedia>
			<Strategy>TXT_KEY_UNIT_CHARIOT_STRATEGY</Strategy>
			<Help>TXT_KEY_UNIT_CHARIOT_HELP</Help>
			<MilitarySupport>true</MilitarySupport>
			<MilitaryProduction>true</MilitaryProduction>
			<Pillage>true</Pillage>
			<ObsoleteTech>TECH_MACHINERY</ObsoleteTech>
			<GoodyHutUpgradeUnitClass>UNITCLASS_HORSEMAN</GoodyHutUpgradeUnitClass>
			<AdvancedStartCost>15</AdvancedStartCost>
			<XPValueAttack>3</XPValueAttack>
			<XPValueDefense>3</XPValueDefense>
			<UnitArtInfo>ART_DEF_UNIT_CHARIOT</UnitArtInfo>
			<UnitFlagAtlas>WONDER_UNIT_FLAG_ATLAS</UnitFlagAtlas>
			<UnitFlagIconOffset>1</UnitFlagIconOffset>
			<IconAtlas>WONDER_UNIT_ATLAS</IconAtlas>
			<PortraitIndex>1</PortraitIndex>
			<MoveRate>WHEELED</MoveRate>
		</Row>
	</Units>

Code:
---CHARIOT----------------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_CHARIOT"), "DamageStates", ("TwoBigGuns")
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_U_HITTITE_WARCHARIOT");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	VALUES	("ART_DEF_UNIT_CHARIOT", "ART_DEF_UNIT_MEMBER_CHARIOT", "2");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_CHARIOT"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_U_HITTITE_WARCHARIOT");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_CHARIOT"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_U_HITTITE_WARCHARIOT");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_CHARIOT"), "Scale", "ZOffset", "Domain", 
			("Chariot_Macedon.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_U_HITTITE_WARCHARIOT");
INSERT INTO "ArtDefine_StrategicView" ('StrategicViewType','TileType','Asset')
	SELECT	("ART_DEF_UNIT_CHARIOT"), "StrategicViewType", "TileType", "Asset")
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_U_HITTITE_WARCHARIOT");
 
I have.
 
Then we would need the mod itself to look at. Logs might be able to pinpoint the problem, but an incorrect modbuddy procedure or filename reference doesn't always show anything in the logs.
 
I can do that. I included the unit in a larger MODMOD I made for the CBO, so things are a bit jumbled. The unit is on the "Civilization changes" file and the defines are on the "Compatability.sql".
 
According to AgentRansack, this
Code:
Chariot_Macedon.fxsxml
appears nowhere in the attached mod within the text of any SQL, XML, or LUA file in the mod. You have this
Code:
INSERT INTO ArtDefine_UnitMemberInfos(Type, Scale, Model, MaterialTypeTag, MaterialTypeSoundOverrideTag)
  VALUES ('ART_DEF_UNIT_MEMBER_CHARIOT', 0.144999995827675, '[COLOR="Red"]Hititte_War_Chariot.fxsxml[/COLOR]', 'CLOTH', 'WOODSM');
The referenced file (Hititte_War_Chariot.fxsxml) that is within the actual SQL-code of the mod does not appear anywhere in the mod as a file.

The quoted code is from the only unit art def found within file Compatability.sql.
 
Oh oops, I forgot I changed the file in an attempt to see if the model itself was the problem. This should have the correct file.
 
  1. This doesn't exist anywhere in your mod
    Code:
    INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset)
      VALUES ('ART_DEF_UNIT_CHARIOT', 'Unit', '[color="red"]SV_Hittite_WarChariot.dds[/color]');
    Nor does it appear anywhere in the version of CBP I have on my computer. Admittedly, though, my version of CBP might be pretty old since I don't actually use CBP, I just have a copy of it for reference when needed.
  2. From within your Chariot_Macedon.fxsxml file I find a reference to this file: FX_Triggers_Chariot_Civ4.ftsxml which does not appear to be part of your mod, nor does it appear to be anywhere in CBP, though it might be 'packed' into the gr2 or the blend file in your mod. I would double-check that you did not miss this file from the unit-model animations source, though.
 
All of the Hittite war chariot stuff is already in the game, from the wonders senario. I took the model from Anno Domini, but it's just a slightly recolored version of the greek chariot model which danrell converted years ago, so I'm not sure if that would make a difference. I can try running it using one of the RED models and see what happens.

Edit: Testing has revealed that the error is something in the art defines themselves. Perhaps I shouldn't have renamed my unit in the defines.
 
All of the Hittite war chariot stuff is already in the game, from the wonders senario. I took the model from Anno Domini, but it's just a slightly recolored version of the greek chariot model which danrell converted years ago, so I'm not sure if that would make a difference. I can try running it using one of the RED models and see what happens.

Edit: Testing has revealed that the error is something in the art defines themselves. Perhaps I shouldn't have renamed my unit in the defines.

When I was using the gondor general model, as long as I kept all the original filenames the same as what came with the model, I was fine to re-texture anything (saving it with the same filename), but if I changed any of the texture file names, my unit showed up as a spearman.

The gr2 defines the texture file names, so changing them makes the unit default to spearman.

Not sure if you happened to change any of the original texture filenames, but just throwing that out there.
 
I changed it back to the original unit defines, the only change being the unit model. Still shows up as a spearman. I don't understand, if I use the original war chariot's defines everything is fine, but if I try to use Anno Domini's defines I get a spearman.
 

Attachments

I think it has to do with the Macedon Chariot is meant to be used with RED+AnnoDomini, but I am not near enough of a unit model and fxsxml expert to figure out exactly what is not working for you.
 
I changed it back to the original unit defines, the only change being the unit model. Still shows up as a spearman. I don't understand, if I use the original war chariot's defines everything is fine, but if I try to use Anno Domini's defines I get a spearman.
You're referencing ART_DEF_UNIT_BATTLECART in the Units table instead of ART_DEF_UNIT_CHARIOT.
 
So apparently the problem was that my mod simply wasn't recognizing that there were a set of art defines and needed me to create a seperate SQL file just for them.
 
So apparently the problem was that my mod simply wasn't recognizing that there were a set of art defines and needed me to create a seperate SQL file just for them.
They don't need to be in a separate file. Which means there was an error in that file. The remainder of a file will be ignored when an error occurs, so something prior to your art defines in that file must have an error.
 
Back
Top Bottom