Change unit model?

I have been trying to change the textures of the Shogun’s model.

I have tried to create mods by changing the material and animfile files but it doesn’t work
I wanted to change the normal model for the campaign model, but it has been impossible for me and I have tried many methods
i would be grateful if someone could help me :slightly_smiling_face:

Look into the MosterSPC tutorials in youtube, maybe they can help. Which model do you want to change for which one?

This one: “units\asians\japanese\shogun\shogun_horse.xml”

For this one:“units\asians\spc\tokugawa\spc_tokugawa_horse.xml”

If you’ve extracted both their anim files with Resource Manager, you’re going to want to look in the spc_tokugawa_rider and shogun_rider files for the ModelComp section. In the image below, the one on the left is the Shogun file, the right is the SPC Shogun, copy the model file info from the SPC entry and replace the Shogun’s entry.

Before

<component>ModelComp
		<logic type="LowPoly">
			<normal>
				<assetreference type="GrannyModel">
					<file>units\asians\japanese\shogun\shogun_0</file>
				</assetreference>
			</normal>
			<lowpoly>
				<assetreference type="GrannyModel">
					<file>units\asians\japanese\shogun\shogun_lp_0</file>
				</assetreference>
			</lowpoly>
		</logic>
	</component>

After

<component>ModelComp
		<logic type="LowPoly">
			<normal>
				<assetreference type="GrannyModel">
					<file>units\asians\spc\tokugawa\spc_tokugawa</file>
				</assetreference>
			</normal>
			<lowpoly>
				<assetreference type="GrannyModel">
					<file>units\asians\spc\tokugawa\lp_spc_tokugawa</file>
				</assetreference>
			</lowpoly>
		</logic>
	</component>

If you didn’t make any copy errors and the formatting is OK then save it as the same file name the game is using and move it into your local mod’s folder precisely where the game has it: Art\units\asians\japanese\shogun

As above, the left is the CAV Shogun Tokugawa and it now matches the SPC YP Shogun Tokugawa.
image

If you want the decals/aura to match you’ll have to additionally edit the shogun_horse file and do the same there.

1 Like

I tried your tutorial but it doesnt work.

I copy the files “units\asians\spc\tokugawa\spc_tokugawa” and the “units\asians\spc\tokugawa\lp_spc_tokugawa” and replace the ones of the shogun_rider animfile.

i save it into the C:\Users\USERNAME\Games\Age of Empires 3
DE\NUMBERS\mods\local\Art\units\asians\japanese\shogun (save it like a XML file)

My files always look like this and i dont know why

instead of the one you send

Perhaps this is why it doesnt work :thinking:

Notepad ++ has XML Tools plugins to pretty print the extracted files and make them bearable to work with. It looks like your issue is that you didn’t make a folder in your local mods for the mod and it thinks you have a mod named Art and then the folders are all in the wrong place, so in mods\local make a new folder and call it Tokugawa Model or whatever you want your mod to be called, then have the art\units\asians\etc. folders in that folder, and it should work. You also might need to go into the in-game mods and toggle your new mod on if it isn’t by default.

C:\Users\USERNAME\Games\Age of Empires 3 DE\NUMBERS\mods\local\Tokugawa\Art\units\asians\japanese\shogun

1 Like

It worked! i really appreciate it :grinning: :ok_hand:

Also if i wanted to change an unit portrait/icon how it could be?

There’s a few ways to do it. Let’s presume we’re wanting to change ypShogunTokugawa icons to ypSPCTokugawa, if you don’t know the pathing the first step is to extract the protoy file out Data BAR, look up the units, then the Icon and Portrait lines will tell you where their files are:

resources\art\units\asians\spc\tokugawa\tokugawa_icon.png
resources\art\units\asians\spc\tokugawa\tokugawa_icon_portrait.png

resources\art\units\asians\japanese\shogun\shogun_icon_64.png
resources\art\units\asians\japanese\shogun\shogun_icon_portrait.png

Since ypShogunTokugawa is the only unit using that portait, the easiest way would be to use Resource Manager to open UIResources1 BAR and search for tokugawa_icon and tokugawa_icon_portrait, extract those (make sure to toggle off extracting them as BMP or make them PNGs yourself), rename them to shogun_icon_64 and shogun_icon_portrait, then in your local\mods\Tokugawa mod folder you’ll need to make folders matching the icon/portrait paths, so Data\wpfg\resources\art\units\asians\japanese\shogun

Put your renamed Tokugawa pngs in there and it should be good to go.

3 Likes

Hello,

I am updating this post because I would also like to interchange skin and animation : the outpost visual models of the Maltese and Italian civilizations. If possible, I would like to substitute the classic European outpost for the very pretty tower found on Mediterranean maps.

For doing it, i’m trying to familiarize myself with resource manager, and it’s not easy at all.
However I believe I have found the code entries for the two models that I would like to interchange:
Art\buildings\outpost\outpost_generic.dmg.XMB
for
Art\buildings\spc\tower\tower.xml.XMB
It is possible that I am obviously wrong, knowing nothing about it.

The problem is twofold: how to be sure that the models are the ones I want to change, and how to replace them only for those civilizations?

First thing would be to track down the actual factual Outpost that civs can build and its animfile. If you’re hunting for something the easiest way is usually going to be to get the protoy.xml out of Data.bar as well as the stringtabley.xml as you can then search for the unit or building and see what its exact animfile location is, using the stringtabley to cross-reference the in-game name or descriptions to get a string number to search for it in the proroy if needed.

Some protoy names will differ like Salteador is “deEmboscador” which is why cross-referencing can be vital, but this one is going to be pretty easy to find as its protoy name is just “Outpost.” Once you find the animfile for it (buildings\outpost\outpost.xml) extract it out of ArtBuildings.bar and remember to convert it to XML. I think you did find the other one at buildings\spc\tower\tower.xml so extract that into XML as well.

Some animation files are more complex than others and feature Submodel sections with the model and animations for that model contained within the Submodel tags, with a final Component section where you dictate which submodel goes where and with what. Below is the Outpost component section. You can see it uses Tech Logic for “none” meaning how it looks with no techs, and then the two Outpost upgrade techs. The “none” section uses additional Logic for Culture (the building set defined in civs.xml) which says if you have none or no special culture defined then it uses those submodels, but if you have africaeast culture it uses those submodels instead. These kind of logic tags are how you can set things up to look different for specific cultures, civs, or techs.

<component>outpost
	<logic type="Tech">
		<none>
			<logic type="Culture">
				<none>
					<logic type="BuildingCompletion">
						<p0>
							<submodelref ref="sub_construction_stage_01"/>
						</p0>
						<p33>
							<submodelref ref="sub_construction_stage_02"/>
						</p33>
						<p66>
							<submodelref ref="Outpost lvl1_con2"/>
						</p66>
						<p100>
							<submodelref ref="Outpost lvl1"/>
						</p100>
					</logic>
				</none>
				<africaeast>
					<logic type="BuildingCompletion">
						<p0>
							<submodelref ref="sub_construction_stage_01"/>
						</p0>
						<p33>
							<submodelref ref="sub_construction_stage_02"/>
						</p33>
						<p66>
							<submodelref ref="eth_tower_con"/>
						</p66>
						<p100>
							<submodelref ref="eth_towerA"/>
						</p100>
					</logic>
				</africaeast>
			</logic>
		</none>
			<frontieroutpost>
				<logic type="BuildingCompletion">
				<p0>
					<submodelref ref="sub_construction_stage_01"/>
				</p0>
				<p33>
					<submodelref ref="sub_construction_stage_02"/>
				</p33>
				<p66>
					<submodelref ref="Outpost lvl2_con2"/>
				</p66>
				<p100>
					<submodelref ref="Outpost lvl2"/>
				</p100>
			</logic>
		</frontieroutpost>
		<fortifiedoutpost>
			<logic type="BuildingCompletion">
				<p0>
					<submodelref ref="sub_construction_stage_01"/>
				</p0>
				<p33>
					<submodelref ref="sub_construction_stage_02"/>
				</p33>
				<p66>
					<submodelref ref="Outpost lvl3_con2"/>
				</p66>
				<p100>
					<submodelref ref="Outpost lvl3"/>
				</p100>
			</logic>
		</fortifiedoutpost>
	</logic>
</component>

In this case, the Tower.xml already is using submodels, so it’s a relatively simple task of carefully copy+pasting the submodels into the Outpost.xml as their own submodel sections. You’ll need to rename the Tower’s two Sub_construction submodels as those exist already in Outpost.xml, and remember what you change it to because you’ll need to add it at the bottom.

Those were the easy steps, now comes the harder part. Let’s say you only want the Tower to show up for the final upgrade aka fortifiedoutpost tech, you could add another logic type=“Tech” tag inside there, copy the existing look under a none tag so it looks like that for everyone else, then add deage0italians and deage0maltese sections using the Tower submodels names you moved over. If you want it to always look like that then you do the same thing for the two other main tech logics sections (frontieroutpost and none), remember that none is already coded using the Culture logic so you’d add a mediterranean culture tag then add a tech logic within that with none for the default look and then sections for the age0s for Italy and Malta.

<fortifiedoutpost>
	<logic type="Tech">
			<none>
				<logic type="BuildingCompletion">
					<p0>
						<submodelref ref="sub_construction_stage_01"/>
					</p0>
					<p33>
						<submodelref ref="sub_construction_stage_02"/>
					</p33>
					<p66>
						<submodelref ref="Outpost lvl3_con2"/>
					</p66>
					<p100>
						<submodelref ref="Outpost lvl3"/>
					</p100>
				</logic>
			</none>
			<deage0italians>
				<logic type="BuildingCompletion">
					<p0>
						<submodelref ref="spctower_construction_stage_01"/>
					</p0>
					<p33>
						<submodelref ref="spctower_construction_stage_02"/>
					</p33>
					<p66>
						<submodelref ref="tower_con"/>
					</p66>
					<p100>
						<submodelref ref="tower"/>
					</p100>
				</logic>
			</deage0italians>
			<deage0maltese>
				<logic type="BuildingCompletion">
					<p0>
						<submodelref ref="spctower_construction_stage_01"/>
					</p0>
					<p33>
						<submodelref ref="spctower_construction_stage_02"/>
					</p33>
					<p66>
						<submodelref ref="tower_con"/>
					</p66>
					<p100>
						<submodelref ref="tower"/>
					</p100>
				</logic>
			</deage0maltese>
		</logic>
</fortifiedoutpost>

Doesn’t work.

Am i doing well?
I did copy+pasting for the four lines “submodels” from the tower folder here represented in gray. Then, if I got it correctly, all I had to do was copy and paste the last more difficult part you edited, maybe not in the correct place?

I fixed it thanks to my friend and your help. Thanks you so much

2 Likes