Page 1 of 3 123 LastLast
Results 1 to 20 of 53

Thread: [tutorial] How to add textures to custom units without affecting the others.

  1. #1
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default [tutorial] How to add textures to custom units without affecting the others.

    I’m writing this because a lot of people must have tried the tutorial about how to create custom units by The Phenom (link) or in the thread compiling the information of various post created by Wiz (including the one from the phenom) link.

    This tutorial is basically the next step and I will explain what we mod in the intention that people can understand what they do.
    That way if something goes wrong, they can track the mistakes they’ve done by their own, so please read everything before posting for problems.


    At the end of the precedent tutorial you should have an elite Cemaat janissaries unit fully functional but using the same texture that the existing one on the battlefield.
    This is where this tutorial starts: how to add your own personal texture to your newly created unit.
    (I will not go into texture editing in this thread, so I will assume that you already have some of them waiting to be used).
    All the file structures I’ll provide there are based on the official CA statements about mod making; you can find a tutorial and some information there and there
    So I’ll assume you’ve edited your work on a proper way to make it a functional mod.
    I will not support other files structures based conflict or bugs because like it has been stated they could create conflict with other mods and game structures like coming patch, but the methods of editing should stay the same, just do it knowing this.


    I’ve created a new Azzars unit that I’ve called Azzar_retextured for the meaning of the tutorial (assume it’s your new unit).

    Spoiler Alert, click show to read: 




    As you can see, I’ve changed the entry in the model part of the editor with a new custom one.
    That’s because I want my new unit to use a different model than the vanilla (read: default) without overwriting the one of the default Azzars so my new unit can be unique.
    (Note: I’ve let the default Azzars entry for comparison purposes only, that’s not something I want to keep in this mod)
    By model in the db files in general, you should read: name that’s used as a reference for associating 3D mesh and textures.
    Now, I need to tell the game what are the corresponding 3D meshes associated with my new model (that I’ve called east_azzars_retextured).
    This information is located in the warscape_animated_lod_tables.
    This file looks like this:

    Spoiler Alert, click show to read: 





    So, even if that seems a little hard to understand, that’s not.

    -The first column is the line ID.
    It’s basically used so if you want to overwrite a line you could do it calling this ID.
    They seem totally random and in fact most of them are, that’s because there is no limit in the number of custom units/buildings/ … we can add to the game.
    You don’t have to put the next ID to add a line (let’s say the last model was 109847, I don’t need to add the 109848), but just a random number too.
    Why does it works like that is because that way, mods adding models to the game should never conflict with each others because of the very low probability they use the same ID (by very low I mean more or less 0,000000000000000001 % for each entry to be the same than an existing one).

    -The second Column is the path to the 3D mesh (it use the same folder structure path than all the other packed files).
    Each 3D model comes with four meshes (perhaps not all of them, should be confirmed) that, in my understanding, are relatives to details and graphical options (the weight differences).
    This is where we’ll be able to add custom 3D meshes when we’ll be able to work with them.

    -The third Column must be affecting graphical settings, but I’m not quite sure. It’s associated with the different meshes. (for now just copying the actual settings of similar models is the safest way to go).

    -the last Column is the model name found in the other db files (in this example the unit_stat_land_table).

    So, knowing this, adding my entries is not hard at all (use the filters function to looks through default files to copy what you need):

    Spoiler Alert, click show to read: 






    Note: I’ve just copied the path to the meshes from the default file.

    Now, I need to link the texture I want to use with my model, this information is located in the warscape_animated_tables.
    That’s actually speaking for itself.

    Spoiler Alert, click show to read: 




    east_azzarsretextured is the name of my texture here (east_azzarsretextured_diffuse.dds, east_azzarsretextured _gloss_map.dds and east_azzarsretextured _normal.dds)

    Just leave the category stuff alone.

    Now you just have to add your textures to the pack:

    Spoiler Alert, click show to read: 




    And that’s done, just save your work and enjoys it!!!

    Spoiler Alert, click show to read: 







    All the credits for this come from all the people of this thread: http://www.twcenter.net/forums/showthread.php?t=240587
    Last edited by MrThib; March 23, 2009 at 05:14 AM.

  2. #2

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Great tuto and thanks, MrThibs. Will try this tonight.
    +rep
    +added to mod index

    Just a small suggestion: use the [spoiler] tag to hide the big images that span the screen too much.

  3. #3

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Wow! Great job! Perhaps I will try it... I still don't get how you people change the model of the hats in the unit.

    Guys, keep repping MrThib, and don't stop!
    Last edited by The Phenom; March 23, 2009 at 02:55 AM.

  4. #4
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    @wiz:
    fixed, tell me if the others need it too, I can't really preview that with my resolution .

    @The Phenom:
    I don't have changed the hats models, in fact they may be part on the main model. (but I think I've seen one tricorn model once....not sure through).
    This is just texture editing.

  5. #5
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Edit: ok, all images fixed thanks for feedback.
    edit2: Arghh, that was supposed to be some editing, sorry about that...
    Last edited by MrThib; March 23, 2009 at 05:26 AM.

  6. #6

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    I think I'm doing something wrong with the Model Name in units, I'm creating a texture based on the green jackets, I copied the texture files (gloss, diffuse and normal) and renamed them "euro_late_riflemen_venice", default was just euro_late_riflemen. Is that the name I'm supposed to put in "Model Name" and all of the other files? The game starts alright, but when I'm loading a battle with the unit, it crashes.

  7. #7
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    I don't think you need to go through all this if the Venice faction don't already use this model, it's only useful when there're two.
    I the naming you use, you put a little confusion between methods.
    let me explain: if you keep the default model name of your unit in the unit_stat_land (so euro_late_riflemen), when loading textures for this model, the game will look first if there is a texture specific to that faction (so Venice, and it will search euro_late_riflemen_venice) if it don't find one, it will use the default one (euro_late_riflemen).
    So in your case adding the venise stuff in the warscape table may be a little hard for the game to understand (because that's what it's looking for by default).
    So just change back the model in unit_stat_land to euro_late_riflemen and delete the two warscape_tables from your mod pack and that will work.

    Edit: Nice you do make that error because I'm sure a lot of people will. I'll probably update this part in the tutorial when you'll repport that it works.

  8. #8

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Quote Originally Posted by MrThib View Post
    I don't think you need to go through all this if the Venice faction don't already use this model, it's only useful when there're two.
    I the naming you use, you put a little confusion between methods.
    let me explain: if you keep the default model name of your unit in the unit_stat_land (so euro_late_riflemen), when loading textures for this model, the game will look first if there is a texture specific to that faction (so Venice, and it will search euro_late_riflemen_venice) if it don't find one, it will use the default one (euro_late_riflemen).
    So in your case adding the venise stuff in the warscape table may be a little hard for the game to understand (because that's what it's looking for by default).
    So just change back the model in unit_stat_land to euro_late_riflemen and delete the two warscape_tables from your mod pack and that will work.
    Oh alright, thanks!

  9. #9
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Tell me if that was the problem

  10. #10

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Quote Originally Posted by MrThib View Post
    Tell me if that was the problem
    Yeah, I just removed the warscape tables, added "euro_late_rifleman" to the model name and started the game, worked great

  11. #11
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Great, I'll add a notice of that problem in the tutorial later.
    You have to be credited for this

  12. #12

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Following the instructions of this tutorial I now assigned a custom texture to my custom unit (Gyulai Regiment, a guard infantry), but I have a problem. Only one man shows up in the whole unit and the rest will become visible only when I zoom in:

    Spoiler Alert, click show to read: 






    I guess I need to alter the lod code, but there's another serious problem. When I open my custom pack file, and select one of the tabs, I get this error message:

    "Could not load file or assembly 'DataGridViewAutoFilter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ab8934ab8a74bd53' or one of its dependencies. The system cannot find the file specified."

    Which means my custom pack I developed for days and nights is now corrupted. What could be the solution? Please help.
    Last edited by Aldgarkalaughskel; March 23, 2009 at 12:12 PM.

  13. #13
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Yes, that's defenitly related to the lod.

    For your problem opening the db, try to uncheck the use online definitions in the options of the PFM, I already had this sort of problems.

  14. #14

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    SUCCESS!

    Looks my other 2 files from PFM mysteriously disappeared and caused that error. Now it's fixed.

    LOD also fixed and working. It was set to 5 when only one man showed up and the rest by zooming in. I set it to 15, then all the men showed up, but started to disappear when I zoomed in. Set it to 0 and now all of my soldiers standing there. Yay!

    MrThibs, I can't put it any other way, you are ing awesome!

    edit: oh wait, I need to have 4 lines for each unit in the lods file So that was my problem! My bad!
    Last edited by Aldgarkalaughskel; March 23, 2009 at 12:48 PM.

  15. #15
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Yes, the for lines are for level of details.
    For units it's associated in most of the cases like this: 5 for LOD1 10 for LOD2 15 for LOD3 and 0 for LOD4.
    Don't forget to use the filters (small arrow) to find what you're looking for. NOTE:I usualy run 2 PFM, one with my mod and another with the pach.pack so I can copy/paste between the two.

  16. #16
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    no, model name isn't unit name,
    Can you post here the names you've choosed? (model name, unit name and texture name).
    But it must be the last part of the tutorial, the warscape_animated_table (not LOD).
    you should have the name of your new textures in this. (model name / texture path (with texture name) / animation)
    Be also sure to not do the same mistake than Sorkenlol, as I've explained in post 7.
    At last, don't forget to put the textures in your pack.
    Last edited by MrThib; March 23, 2009 at 01:41 PM.

  17. #17

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    Awsome tut MrThib. Rep to you sir.

    Now, All we need to do is find where the ship models are listed, as far as I know, the db viewer doesn't have a "Find..." feature yet.
    My named ships in Empire Total War: (that i can remember)

    Fifth Rate, HMS Poseidon.

    Fifth Rate, HMS Dauntless.

    Fifth Rate, HMS Enterprise NCC-1701

    Fifth Rate, HMS Simi.


    ------
    "Ya best start believing in ghost stories Miss Turner. You're IN one!"

  18. #18
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    @ Barbossa:
    No but it has a filter option (little arrows). That helps a lot!

  19. #19

    Default Re: [tutorial] How to add textures to custom units without affecting the others.

    MrThib, I now figured it out and works with the custom texture. Thanks again.

  20. #20
    Pikas53's Avatar Foederatus
    Join Date
    Dec 2006
    Location
    greater Prussia, known as Germany
    Posts
    29

    Icon9 Re: [tutorial] How to add textures to custom units without affecting the others.

    Well, I tried this, by making an additional unit for the prussian faction, copying and renaming the lods from the grenadiers, copying the dds files, repainting and renaming all of them normal, gloss etc. and add them. Changed all other necessary files. Works like a charm, in quickbattle and in campaign. BUT! in the campaign suddenly all ships are black on the strategic map!
    Before adding the lods, I had the unit added and it worked fine, but I wanted the old grenadiers and the new one with different skins. And only then this happened. Anybody has the same problem? I just try to solve, but I have now clue.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •