I Can't Get a Unit Graphic to Show Up!!!

The Capo

godless Heathen
Joined
Jan 29, 2001
Messages
9,302
Location
Washington, DC
I know the basics of changing unit graphics, but for some reason I can't figure this one out. I am ADDING the Iroquois as a civ to a mod I am working on (I am turning the Natives to the Sioux and adding the Iroquois, just so you know), and I basically copied the XML for the Natives and changed everything, I set the UU portion of that XML to "NONE" so they don't have the dog soldier as their UU. I am going to give them the "Mohawk Warrior" as their Unique Unit. But I haven't started working on that part yet. Anyway, I added the graphics and XML for the axeman but it doesn't show up, it just has the vanilla axeman graphics. So I thought maybe I screwed something up with the XML but I looked at it and everything looked fine, so I figured I'd throw in the Ottoman Axeman graphics (I am using VDs graphics BTW) and even that didn't show up. So obviously there is nothing wrong with my graphics XML for the unit, but I can't figure out why I can't get the normal Iroquois Axeman to show up. Is there some file I am forgetting to edit? Also I would like to change their UU to the "Mohawk Warrior," basically I was just going to make it a regular Rifleman, but he has woodsman bonuses or ignores terrain costs or something like that.

Can anyone help me out with this?

Thank you in advance. And sorry if this is the incorrect thread!
 
First of all this is not the place for questions, this is for finished unit graphics only. I start to understand the poor admin who has to correct all these wrong posts. I don't know why there are still people posting questions here. You can be sure that your post will be moved.

However, this doesn't solve your problem. You haven't told us exactly which files you have worked on so far. From what you are writing I guess you are trying to add / change a UU (not only a unique graphic for an existing unit) and that you have changed the unitartdefines and the civilizationinfos. If this is the case, you probably missed to add the unitinfos of your unit (to be exactly: an info like you can find it in CIV4UnitInfos.xml). If there is no such file in your mods files, copy it from your Civ games Assets/XML folder. If you are trying to write a modular civ, remove all the entries in that file except of that units entry you'd like to replace with your UU. If you'd like to write an ordinary (nonmodular) mod, simply copy the entry of the unit you want to replace. If you already have a modular mod with a unitinfo file in, copy the entry of the replaced unit from you Civ4 Assets/XML unitinfo file and add it to yours. Read more about modular and nonmodular mod XML work in one of the tutorials. In that unitinfo entry you should now do your changes to the units properties (strength, movement etc.). There should be a line like this:

<Class>UNITCLASS_AXEMAN</Class>
<Type>UNIT_AXEMAN</Type>

Keep the <Class> line, but change UNIT_AXEMAN to UNIT_YOURCIV_AXEMAN or any other name (keep this name in mind). There should also be a reference on your artdefines of your unit, you should correct this. If you have finished your changes to the units stats, open the CIV4CivilizationInfos.xml of your mod. Search for anything like this:

<Units>
<Unit>
<UnitClassType>UNITCLASS_CAVALRY</UnitClassType>
<UnitType>UNIT_WHATEVER_CAVALRY</UnitType>​
</Unit>​
</Units>

I guess this is familiar to you. It is what you ment when you write
I set the UU portion of that XML to "NONE" so they don't have the dog soldier as their UU.
If I get you right, you changed it to

<Units>
<Unit>
<UnitClassType>NONE</UnitClassType>
<UnitType>NONE</UnitType>​
</Unit>​
</Units>

If you really want no UU for a civ one day, I suggest changing it to

<Units>
<Unit>
<UnitClassType></UnitClassType>
<UnitType></UnitType>​
</Unit>​
</Units>

Well, I don't know if your solution (if I really got you right) does work or not, I never tried it, but I would prefer something like I suggested it above. However, in this case you have to change it to

<Units>
<Unit>
<UnitClassType>UNITCLASS_AXEMAN</UnitClassType>
<UnitType>UNIT_YOURCIV_AXEMAN</UnitType>​
</Unit>​
</Units>

That unittype line depends on what name you have given to your new unit in the unitinfo (that's why I told you keep the name in mind). This should work.

If you only like to add a new graphic to one of your units that depends on the civ you choose, then change the CIV4UnitArtStyleTypeInfos.xml. Copy an entry from the corresponding file of your Civ4/Assets/XML (must be from BtS and this technique will only work for BtS). Search for

<Type>UNIT_ARTSTYLE_WHATEVER</Type>

Change this to

<Type>UNIT_ARTSTYLE_YOURCIV</Type>

Add a

<StyleUnit>
<UnitType>UNIT_AXEMAN</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_YOURAXEMAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_YOURAXEMAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_YOURAXEMAN</MiddleArtDefineTag>​
</UnitMeshGroup>​
</StyleUnit>

This would add a unique graphic for the axeman once we have finished. The 3 artdefine tags refer to your units artdefines. You can have different graphics for different times. You'll sincerly find a tutorial about this if you are interested in doing this. You should remove all other <StyleUnit> entries that are not required. Last step is to change the civilization infos again. Open that file and search for

<ArtStyleType>ARTSTYLE_WHATEVER</ArtStyleType>

Change it to

<ArtStyleType>ARTSTYLE_YOURCIV</ArtStyleType>

Now we are done.


If none of these help you, please report here. Please be more detailed then, for example tell us for which civ4 your mod should be (vanilla, warlords, BtS) and which files you have already changed.
 
Sorry for not being very clear, but I did everything you've told me to do already (except for the "NONE" thing, which I'll try), but the problem is that the Iroquois cant' build Axemen at all. And I added the Axemen to their UnitInfos file as well. And its not a problem with that file because all of the other unit graphics I added work too. They just can't build the Axeman at all, and I clicked on the civlopedia when I tested it and looked at Axemen while playing as the Iroquois and it just shows the vanilla axeman. That's the issue, their axeman doesn't show up at all.
 
And sorry for not posting in the right forum, I just didn't know where to ask because it wasn't very clear so I picked the one I thought was the closest to my issue. I didn't intentionally do it and I realized as I was writing the post that this was probably not the right forum.

EDIT: I'll post the code for everything I've done so far too, I'm just watching this football game right now but when its over I'll put it up.
 
Alright, here's the first one, CivilizationInfos:

Code:
<CivilizationInfo>
			<Type>CIVILIZATION_IROQUOIS</Type>
			<Description>TXT_KEY_CIV_IROQUOIS_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_IROQUOIS_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_IROQUOIS_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_IROQUOIS_PEDIA</Civilopedia>
			<DefaultPlayerColor>PLAYERCOLOR_DARK_INDIGO_AND_WHITE</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_IROQUOIS</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_NATIVE_AMERICA</ArtStyleType>
			<UnitArtStyleType>UNIT_ARTSTYLE_IROQUOIS</UnitArtStyleType>
			<bPlayable>1</bPlayable>
			<bAIPlayable>1</bAIPlayable>
			<Cities>
				<City>TXT_KEY_CITY_NAME_MOHAWK</City>
				<City>TXT_KEY_CITY_NAME_CAYUGA</City>
				<City>TXT_KEY_CITY_NAME_ONONDAGA</City>
				<City>TXT_KEY_CITY_NAME_SENECA</City>
				<City>TXT_KEY_CITY_NAME_ONEIDA</City>
				<City>TXT_KEY_CITY_NAME_TUSCARORA</City>
				<City>TXT_KEY_CITY_NAME_CAUGHNAWAGA</City>
				<City>TXT_KEY_CITY_NAME_SUSQUEHANNOCK</City>
				<City>TXT_KEY_CITY_NAME_TIONONTATI</City>
				<City>TXT_KEY_CITY_NAME_ERIE</City>
				<City>TXT_KEY_CITY_NAME_POWHATEN</City>
				<City>TXT_KEY_CITY_NAME_MINGO</City>
				<City>TXT_KEY_CITY_NAME_NARRAGANSETT</City>
				<City>TXT_KEY_CITY_NAME_NOWADAGA</City>
				<City>TXT_KEY_CITY_NAME_SARATOGA</City>
				<City>TXT_KEY_CITY_NAME_GEWAUGA</City>
				<City>TXT_KEY_CITY_NAME_OWEGO</City>
				<City>TXT_KEY_CITY_NAME_DYOSYOWAN</City>
				<City>TXT_KEY_CITY_NAME_YOROONWAGO</City>
				<City>TXT_KEY_CITY_NAME_AWEGEN</City>
				<City>TXT_KEY_CITY_NAME_COWASSALON</City>
				<City>TXT_KEY_CITY_NAME_TUEADASSO</City>
				<City>TXT_KEY_CITY_NAME_GADOQUAT</City>
				<City>TXT_KEY_CITY_NAME_CANAJOHARIE</City>
				<City>TXT_KEY_CITY_NAME_KANADASEAGEA</City>
				<City>TXT_KEY_CITY_NAME_NEODAKHEAT</City>
				<City>TXT_KEY_CITY_NAME_KAWAUKA</City>
				<City>TXT_KEY_CITY_NAME_SKOIYASE</City>
				<City>TXT_KEY_CITY_NAME_JONEADIH</City>
				<City>TXT_KEY_CITY_NAME_GANADOGA</City>
				<City>TXT_KEY_CITY_NAME_HOSTAYUNTWA</City>
				<City>TXT_KEY_CITY_NAME_AHAOUET</City>
				<City>TXT_KEY_CITY_NAME_TOUENHO</City>
				<City>TXT_KEY_CITY_NAME_SHAWIANGTO</City>
				<City>TXT_KEY_CITY_NAME_GANDASETAIGON</City>
				<City>TXT_KEY_CITY_NAME_KEINTHE</City>
				<City>TXT_KEY_CITY_NAME_OKA</City>
				<City>TXT_KEY_CITY_NAME_TYENDENAGA</City>
				<City>TXT_KEY_CITY_NAME_TEYAGON</City>
				<City>TXT_KEY_CITY_NAME_GANARASKE</City>
				<City>TXT_KEY_CITY_NAME_AKWESASNE</City>
				<City>TXT_KEY_CITY_NAME_CANIENGA</City>
				<City>TXT_KEY_CITY_NAME_OSWEGATCHIE</City>
				<City>TXT_KEY_CITY_NAME_CATTARAUGUS</City>
				<City>TXT_KEY_CITY_NAME_TONAWANDA</City>
				<City>TXT_KEY_CITY_NAME_KANAGARO</City>
				<City>TXT_KEY_CITY_NAME_OPOLOPONG</City>
				<City>TXT_KEY_CITY_NAME_DESEROKEN</City>
				<City>TXT_KEY_CITY_NAME_ALLEGANY</City>
				<City>TXT_KEY_CITY_NAME_SALAMANCA</City>
			</Cities>
			<Buildings>
				<Building>
					<BuildingClassType>BUILDINGCLASS_OBELISK</BuildingClassType>
					<BuildingType>BUILDING_NATIVE_AMERICA_TOTEM</BuildingType>
				</Building>
			</Buildings>
			<Units>
				<Unit>
					<UnitClassType>NONE</UnitClassType>
					<UnitType>NONE</UnitType>
				</Unit>
			</Units>
			<FreeUnitClasses>
				<FreeUnitClass>
					<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
					<iFreeUnits>1</iFreeUnits>
				</FreeUnitClass>
			</FreeUnitClasses>
			<FreeBuildingClasses>
				<FreeBuildingClass>
					<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
					<bFreeBuildingClass>1</bFreeBuildingClass>
				</FreeBuildingClass>
			</FreeBuildingClasses>
			<FreeTechs>
				<FreeTech>
					<TechType>TECH_HUNTING</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
				<FreeTech>
					<TechType>TECH_FISHING</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
			</FreeTechs>
			<DisableTechs/>
			<InitialCivics>
				<CivicType>CIVIC_DESPOTISM</CivicType>
				<CivicType>CIVIC_BARBARISM</CivicType>
				<CivicType>CIVIC_TRIBALISM</CivicType>
				<CivicType>CIVIC_DECENTRALIZATION</CivicType>
				<CivicType>CIVIC_PAGANISM</CivicType>
			</InitialCivics>
			<Leaders>
				<Leader>
					<LeaderName>LEADER_HIAWATHA</LeaderName>
					<bLeaderAvailability>1</bLeaderAvailability>
				</Leader>
				<Leader>
					<LeaderName>LEADER_DEGANAWIDA</LeaderName>
					<bLeaderAvailability>1</bLeaderAvailability>
				</Leader>
			</Leaders>
			<DerivativeCiv>CIVILIZATION_AMERICA</DerivativeCiv>
			<CivilizationSelectionSound>AS3D_NATIVE_AMERICA_SELECT</CivilizationSelectionSound>
			<CivilizationActionSound>AS3D_NATIVE_AMERICA_ORDER</CivilizationActionSound>
		</CivilizationInfo>

Then the part in the ArtDefines_Unit:

Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_AXEMAN_IROQUOIS</Type>
			<Button>,Art/Interface/Buttons/Units/Axeman.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,3,1</Button>
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
			<NIF>Art/Units/Iroquois/Axeman/iroquois_axeman.nif</NIF>
			<KFM>Art/Units/Celtic_Warrior/Celtic_Warrior.kfm</KFM>
			<SHADERNIF>Art/Units/Iroquois/Axeman/iroquois_axeman.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>1.0</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.4</fBattleDistance>
			<fRangedDeathTime>0.31</fRangedDeathTime>
			<bActAsRanged>0</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>

And here is the UnitArtStyleTypeInfos_Iroquois thing.

Code:
<UnitArtStyleTypeInfo>
			<Type>UNIT_ARTSTYLE_IROQUOIS</Type>
			<StyleUnits>.....

....<StyleUnit>
					<UnitType>UNIT_AXEMAN</UnitType>
					<UnitMeshGroup>
						<EarlyArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</EarlyArtDefineTag>
						<LateArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</LateArtDefineTag>
						<MiddleArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</MiddleArtDefineTag>
					</UnitMeshGroup>
					<UnitMeshGroup>
						<EarlyArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</EarlyArtDefineTag>
						<LateArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</LateArtDefineTag>
						<MiddleArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</MiddleArtDefineTag>
					</UnitMeshGroup>
					<UnitMeshGroup>
						<EarlyArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</EarlyArtDefineTag>
						<LateArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</LateArtDefineTag>
						<MiddleArtDefineTag>ART_DEF_UNIT_AXEMAN_IROQUOIS</MiddleArtDefineTag>
					</UnitMeshGroup>
				</StyleUnit>

The "...." parts I added here so I didn't have to post the entire XML. Keep in mind all of the other units work perfectly fine, and I even substituted the Ottoman Axeman, which works for the Ottomans, to make sure the code is right and that didn't show up either. Its also important to note that during the test I gifted myself Bronze Working, gave myself bronze and checked the city screen and the ability to build the Axeman wasn't even there, the button wasnt' even greyscaled/blacked-out. I don't know what exactly I am doing wrong here. But maybe I'm missing something.
 
Ok, from what I can see it's perfect. You never modified the unitinfos.xml, did you? because you don't need to for just adding flavour units.

One thing I would check is the spelling of the word IROQUOIS everywhere, it would be easy to make a type with a ridiculous word like that.


Wait a minute, I just read your first line again. :p You mentioned that you used the Native Americans as a base civ to make the Iroquois... The Native Americans UU is the Dog Soldier, which replaces the Axeman.

Therefore you need to change this part in the CivilizationInfos:

Code:
	<Units>
				<Unit>
					<UnitClassType>UNITCLASS_AXEMAN</UnitClassType>
					<UnitType>UNIT_NATIVE_AMERICA_DOG_SOLDIER</UnitType>
				</Unit>
			</Units>

to this:

Code:
	<Units/>

That's it, hopefully it works. :p
 
Well if you read that part you'll notice I removed that part and replaced all of the code there with the word "NONE" and that in the game the Iroquois can't build either an Axeman nor the Dog Soldier. And when I checked the Civlopedia during the test game the vanilla axeman appeared even when I replaced it with the Ottoman one as a test. So something else is up, but I made the changes you suggested and now I'm giving it another try... we'll see what happens...
 
ARGH!!!

That didn't work either. Why is this happening? The Iroquois can't even build an axeman at all, even with bronze, even with bronze working and everything they can't build them, and their unit doesn't show up in the civlopedia, its just the vanilla one (I even looked at the graphics for it and they are different). Does ANYONE out there know what is going on here?
 
I can't find an error in your xml either... Strange. Well, I have no experience in not giving a civ a UU, but I can't think of a reason whyit should not work. You could try to add a UU, just for test. You can use any unit except the axeman. Don't know if your axeman would show up then, but I bet this won't help you. There is simply no connection between your UU and your axeman... Hmmm... All the other unique unit graphics are working, huh? Hmmm... You know what? I had a problem with some unit graphics some time ago. I call this kind of units "not-freeze-mode-compatible". I had the problem that a unit looked either magenta or it changed back to its ordinary style (in your case the axeman) after deselecting it. I can't remember how this buggy unit looked like in the civilopedia, but possibly as the ordinary counterpart. This could explain why you can't see it. But it doesn't explain why you can't build an axeman... What happens if you start world builder and add an axeman? Try to select, move and deselect it. If it behaves strange (changing shape etc.), you might try to go in the options menu and switch animations on. If this solves the problem, I could help you. Well, you would already found a solution for this, but if you have a slow machine you may want to switch off animation to enhance performance... However, this doesn't solve the problem that you can't build it... So you didn't add a unitinfo entry, right? I am just asking. If you done this, you may have overwritten the axeman. For unique unit graphics you don't need to add a unitinfo. Well, as you can see I can't really suggest anything, these are just thoughts... Never had or heard of a similar problem...
 
Well I'll definitely get back to you on this because I am making this for a specific group of players, so they are nagging me over it constantly. The funny part, as I've described, is that in the Civlopedia when you click on axeman it has the vanilla axeman. So my first thought was that I didn't tag it to the propery art directory; everything there was fine. I'll just try screwing around with a lot of stuff until something happens correctly. Maybe I'll try adding the UU and see if that helps me out, although much like you I don't see how that would have an effect on the Axeman at all.
 
I must have the WORST possible luck in modding. This is my first attempt and I always screw something up! Anyway I realized that I had two different files for the UnitArtStyleTypeInfos_Iroquois, and one of them did not have the axemen in it, so I deleted the one WITH it and added it back to the other one (they were in different folders). I fixed it up, figured everything would work loaded up the mod, then BAM!

No interface.

I didn't even change anything but XML, I don't see how this could have possibly occured! Anyway, so now I can't even check if the damn unit works anymore anyway here is the screen shot from the damn error message if anyone could help me figure this out.

EDIT: I doubt this, but maybe it has to do with the lack of UU that the Iroquois have (so far) so I am just going to add a quick unit and see what happens...
 
I heard of problems like this, but I don't know how to fix it (I didn't have it so far). You may start a second thread at the questions section with a better headline, so people, that can help you, notice you have a problem. You could also check the questions section for an older thread about this. AFAIK this kind of problem (and a thread about it) occurs periodically, so you may not have to search too long.

You could also check your file structure again. I usually have three folders in my civs directory:
- unit(s)
- building(s)
- leaderhead(s)
The "s" means, that I sometimes use the singular and other times the plural form. Their name says all about them. I put all corresponding stuff in them, the rest comes in the main folder of the civilization you are creating (in other words: just outside these 3 folders). This way you may find other files that are there twice.

About your original bug: I think you've solved it now!
 
Well I already have done that and the thread is RIGHT HERE! I don't understand this though, the other tribes work perfectly fine and the Iroquois worked up until I tried to fix the Axeman thing. So I don't get it at all.

The thing that sucks is I still have to change the Natives to the Sioux (in name only, and the city names) and I have to add Israel! So I hope I don't screw this up again. Meanwhile I have no way of knowing if the Axeman works because the damn interface doesn't come up, so even if I playtested it through until I get Bronze, how could I get Bronze when I can't select techs?
 
Alright, I've solved the problems. Thanks to everyone who helped me out, I really appreciate it, I would have pulled all of my hair out if not for you guys! Anyway now I just have to add the UU and the UB for the Iroquois and I can move on to the Sioux and then Israel. So with all of that still left to do I can almost assure you that you will hear from me again soon.

So be prepared. :p

Thanks again guys.
 
Yeah, I am also interested in the reason why your interface disappeared. Your axeman worked after you removed the second unitartstyletypeinfo, right?

However, well done, my young padawan! And may the force be with you! ;)
 
Back
Top Bottom