[BNW] Civ 5 retexturing a unit

MinhazMurks

Chieftain
Joined
Mar 8, 2018
Messages
30
Hello I am working on a mod for Civilization in which I am creating a civilization. It's going well so far and is in a working state, but for one of the unique units is a worker replacement called Laborer which has a higher work rate. But I want to be able to have a different texture for this unit but i'm not sure how to do it. All i know is that i need to create a reference to the new DDS texture from the art_defines but i don't know how to do it. I've attached the mod. Any help is much appreciated!
 

Attachments

  • Kaixa Mod (v 1).zip
    76.2 KB · Views: 111
The .dds files aren't referenced in the art defines; the .fxsxml is. The .fxsxml file is a text (XML) file that references the .dds textures (but those references aren't even necessary), and (importantly) the .gr2 3D model. The CiV implementation of .gr2 model references the .dds files, so you need to edit the model to change the references to the textures.

The community has made tools to make it easy. I prefer the old version of Nexus Buddy for this purpose (don't get confused between Nexus, a tool that comes with the SDK, and Nexus Buddy).

So I don't have to repeat myself, see this post.
 
Hey thanks a lot for the reply! I wanted to ask you about something else tho, for now i'm just trying to give my unique worker units the late game worker texture that regular workers have but i'm not sure how to do this. I added an entry for the define but idk what else I need to do. After I get this to work i'm gonna use nexus buddy and see if I can change the actual textures so they look different

Civitar's thread may be useful for you if you are doing a simple unit re-skin:

Guide to 3D Modding in Civilization V : Part II - Reskinning
 
Thanks for the reply!
I also decided to look at part 1 and am going through it incase I also wanted to do some modeling, is this completely outdated or can it still be used?

It's a bit dated but not much has changed that would greatly impact typical re-rigging or re-skinning. Per Nutty above, even an older version of NexusBuddy can be used for simple re-skins and such. If you start doing custom animations or animation conversions from other sources then you may want to see more in-depth tutorials like the following from Deliverator:

Getting Civ 4 Units into Civ 5 - Full Conversion
Extract GR2 to Blender with mesh AND skeleton and re-export to GR2
Extract GR2 Animations into Blender and Re-Import to Civ V/Civ BE

However, if all you plan to do is re-texture a single unit, then I would recommend skipping them as they might just be confusing if you don't already have a solid baseline working with units.
 
It's a bit dated but not much has changed that would greatly impact typical re-rigging or re-skinning. Per Nutty above, even an older version of NexusBuddy can be used for simple re-skins and such. If you start doing custom animations or animation conversions from other sources then you may want to see more in-depth tutorials like the following from Deliverator:

Getting Civ 4 Units into Civ 5 - Full Conversion
Extract GR2 to Blender with mesh AND skeleton and re-export to GR2
Extract GR2 Animations into Blender and Re-Import to Civ V/Civ BE

However, if all you plan to do is re-texture a single unit, then I would recommend skipping them as they might just be confusing if you don't already have a solid baseline working with units.

I've done similar unit modeling in the past in Medieval 2: Total War, I probably will just reskin for my worker unit but I want to be able to do more than just that if I wanted to. But I followed Deliverator's steps but my 3d viewer just stays blue/black it does say it's displaying the model of whater fxml I loaded in, but the screen just stays blue. Do you know what might be wrong?
 
I've done similar unit modeling in the past in Medieval 2: Total War, I probably will just reskin for my worker unit but I want to be able to do more than just that if I wanted to. But I followed Deliverator's steps but my 3d viewer just stays blue/black it does say it's displaying the model of whater fxml I loaded in, but the screen just stays blue. Do you know what might be wrong?

The Nexus Viewer was broken by Firaxis at some point and never fixed. You can download the older version with the working 3D viewer from here.
 
The Nexus Viewer was broken by Firaxis at some point and never fixed. You can download the older version with the working 3D viewer from here.

Ok I am finally able to view the files in Nexus viewer. I also wanted to look at the worker gr2 models through your program, the NexusBuddy and gr2viewer. But for some reason (on the latest version, with .NET 2.4 downloaded) whenever i try to load a file into gr2viewer it crashes. the crash dump indicates the following exception was thrown:
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
I have also tried running as administrator, with no luck.
 
Ok I am finally able to view the files in Nexus viewer. I also wanted to look at the worker gr2 models through your program, the NexusBuddy and gr2viewer. But for some reason (on the latest version, with .NET 2.4 downloaded) whenever i try to load a file into gr2viewer it crashes. the crash dump indicates the following exception was thrown:
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
I have also tried running as administrator, with no luck.

I haven't seen this error before, but if I were to troubleshoot the issue I would download a mod, extract the files, open the .gr2 with NexusBuddy and try to view it. If that fails then you have a problem with either .NET, the paths where you installed Nexus and/or NexusBuddy, or a corrupt file. If it succeeds then I would recommend downloading a worker.gr2 model that does not originate from your source Civ files (assuming that is where you got the worker.gr2 file) and using that as your base model instead.

EDIT: Additionally, I actually recommend .NET 4 or greater, and make sure that your NexusBuddy .config file looks like this:

Code:
<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

  <runtime>
    <loadFromRemoteSources
   enabled="true"/>  
  </runtime>
</configuration>

To avoid any future pitfalls, make sure your registry entries point to the correct location per the tutorials:

Code:
[HKEY_CURRENT_USER\SOFTWARE\Firaxis\Nexus\Viewer]
"Executable"="<the location where you put the OLD (working) Nexus Viewer>\\Viewer.exe"
"AssetPath"="C:\\Program Files (x86)\\Steam\\steamapps\\common\\Sid Meier's Civilization V\\Assets" (Usually, if you use Steam; otherwise, the path to your Civ V Assets folder)
 
Last edited:
I haven't seen this error before, but if I were to troubleshoot the issue I would download a mod, extract the files, open the .gr2 with NexusBuddy and try to view it. If that fails then you have a problem with either .NET, the paths where you installed Nexus and/or NexusBuddy, or a corrupt file. If it succeeds then I would recommend downloading a worker.gr2 model that does not originate from your source Civ files (assuming that is where you got the worker.gr2 file) and using that as your base model instead.

EDIT: Additionally, I actually recommend .NET 4 or greater, and make sure that your NexusBuddy .config file looks like this:

Code:
<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

  <runtime>
    <loadFromRemoteSources
   enabled="true"/> 
  </runtime>
</configuration>

To avoid any future pitfalls, make sure your registry entries point to the correct location per the tutorials:

Code:
[HKEY_CURRENT_USER\SOFTWARE\Firaxis\Nexus\Viewer]
"Executable"="<the location where you put the OLD (working) Nexus Viewer>\\Viewer.exe"
"AssetPath"="C:\\Program Files (x86)\\Steam\\steamapps\\common\\Sid Meier's Civilization V\\Assets" (Usually, if you use Steam; otherwise, the path to your Civ V Assets folder)

Damn, what a shame. I imported a gr2 file from Danrell's Civ5's Units Thread and it worked. Somehow my source files (from the fbk) using the dragon unpacker might be corrupting it in the eyes of the gr2 viewer somehow? I don't get it because unpacking the fxsxml files using the dragon unpacker and upon import into the nexus viewer works fine. Is there any online resource where I could download these gr2 files from the base game or am I out of luck?
 
In fact, you always have to resave the vanilla Civ 5 .gr2s with Nexus Buddy before you can view them in Granny Viewer. This is one reason I created the batch “Resave all GR2 flies in directory” function.
 
In fact, you always have to resave the vanilla Civ 5 .gr2s with Nexus Buddy before you can view them in Granny Viewer. This is one reason I created the batch “Resave all GR2 flies in directory” function.

I actually considered this but didn't think it was related to the issue since (with my version of NexusBuddy at least) it kindly informs me that I must save it before viewing it in Granny instead of crashing it. Perhaps the earlier versions weren't so kind. My advice to you, MinhazMurks, is that if you do intend to get into advanced unit modding that you use the latest NexusBuddy as it has been greatly perfected since its earlier iterations and is far more powerful at simplifying some of the more advanced modding processes.
 
I actually considered this but didn't think it was related to the issue since (with my version of NexusBuddy at least) it kindly informs me that I must save it before viewing it in Granny instead of crashing it. Perhaps the earlier versions weren't so kind. My advice to you, MinhazMurks, is that if you do intend to get into advanced unit modding that you use the latest NexusBuddy as it has been greatly perfected since its earlier iterations and is far more powerful at simplifying some of the more advanced modding processes.

Thanks a lot for all of both of your help. I've gotten passed that part and have "remodeled" (very slightly, added a visor and changed the arms) the unit I wanted to, which was my Laborer unit (replaces worker). I wanted to do things one at a time, so I remodeled the modern one first. Here's what it looks like



But for some reason the regular worker model/texture loads. I'm not sure what I did wrong. I've attached the mod if any of you want to look at it.
Spoiler Pictures :





IT WASN'T WORKING AT FIRST BUT NOW IT IS! :D



Albeit there are a few graphical glitches to iron out... Do you think this has to do with the export format?
 

Attachments

  • Kaixa Mod (v 1).zip
    1.4 MB · Views: 105
Last edited:
In fact, you always have to resave the vanilla Civ 5 .gr2s with Nexus Buddy before you can view them in Granny Viewer. This is one reason I created the batch “Resave all GR2 flies in directory” function.

I still haven't fixed the small graphical glitches in my unit. do you think it has to do with the way the model is exported?
 
I still haven't fixed the small graphical glitches in my unit. do you think it has to do with the way the model is exported?

Are you referring to the screenshot above? It looks like the legs are twisted so it may be an issue with the model, rigging or export. You can test animations in Granny Viewer by dragging and dropping the animation .gr2s onto the Viewer. Check that no part of the model looks unnaturally twisted there first.
 
Are you referring to the screenshot above? It looks like the legs are twisted so it may be an issue with the model, rigging or export. You can test animations in Granny Viewer by dragging and dropping the animation .gr2s onto the Viewer. Check that no part of the model looks unnaturally twisted there first.

OK I looked at it in the granny viewer and I think it's what I originally thought it was.
If you look at the image below, you will see in the ambient lighting the dark parts of the model are what are missing (for the most part) in the graphical glitches in game:
Spoiler Screenshot :


And looking at this further, here is the normal map view of the model:
Spoiler Screenshot :


But the problem is, I don't know how to solve this. In Blender I recalculated normals multiple times but this didn't help.

EDIT: I may have just fixed it!
 
Last edited:
Top Bottom