Results 1 to 5 of 5

Thread: Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    scope2007's Avatar Civis
    Join Date
    Aug 2007
    Location
    United Kingdom... somewhere.
    Posts
    177

    Icon14 Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

    Importing custom textures or 3d meshes into the Assembly Kit

    The purpose of this tutorial is primarily for custom skins, however it is the exact same process for custom meshes created in 3ds max too. The benefit of using the unit editor when creating custom skins - is that you can preview your changes in the editor without ever having to fire up shogun 2 (which is extremely time consuming). This also allows for quick and dirty unit cards/icons to be created in the correct folders, in .tga format without ever having to fire up GIMP or Photoshop and resize screenshots. (they can of course be cleaned up and edited afterwards)


    Folder Structure - an explanation of where the files go, and how they work

    The Folder structure for the mod tools work similar to how things are structured in the packfile. All changes you make to your database, and any additions you make to variantmodels, text and UI have to be saved in the "Working_Data" folder (from here the paths are identical to those of PFM) - default path should be -

    "C:\*moddingfolderpath*\working_data\"

    In my case it is -

    "C:\modding\working_data\"

    This means that any custom unit parts, textures or unit_variants that we wish to add to our mod need to be placed in the "
    C:\modding\working_data\Variantmodels", folder so that they are visible in the editor and can be exported by BOB when we create our packfile.

    Variant model's

    A variant model (saved with the extension .soldier.unit_variant or .officer.unit_variant), is the template/blueprint file which defines what unitparts and skins a unit uses. It is not actually a 3d model itself, and only tells the engine how to build a model from the numerous heads, torso's models etc saved in the UnitParts folder. This is how units can have individual looking models - the unit makes each man with a random choice of parts specified in the unit_variant file. The Variant model is referenced to in the "db/uniforms_table" - telling the engine to use a variant model file for it's intended unit in game. It is straight forward enough.

    I already have two custom variant files called "Toku_ninja_inf_kisho_ninjas.soldier.unit_variant" and "Toku_ninja_inf_kisho_ninjas.officer.unit_variant" for my mod, but you can create these from scratch or edit a currently existing unit then add the custom textures in the unit_variant after we add the custom files to our working_data folder.

    Save your unit_variant files, or copy an existing one to "C:\moddingpath\working_data\VariantModels\Units" as below



    UnitParts / Skins

    Now for custom skins/unit parts. If you have created your own custom skins before, then you need no explanation of the UnitsParts folder as it is structured the same in the modding folder as it would be when placed in packfile manager. You only need to know where to save your mesh/skins in the modding folder to get them into the editor.

    For those who are unsure of how they work, you only need to know that the custom skin you are trying to use will be in a folder structuie somewhat like this one -

    Example of custom torso skin - "UnitParts/Japan/Torsos/custom_torso_name/tex".

    The "...\custom_torso_name\..." folder comprises of a "mesh.variant_part_mesh" (the model), and a "tex" folder - which contains the skins itself. The model you are using might not be saved in the folder structure above - regardless you will have to create the folders yourself as...

    The "C:\*moddingpath*\Working_Data\Variantmodels" folder doesn't have a "UnitParts" folder by default. so you will have to create it yourself using the below folder structure then paste in your custom skins folders.

    Syntax- "C:\*modpath*\working_data\VariantModels\UnitParts\Japan\*Category*\*Skin_Name*\tex"

    Example file - "C:\modding\working_data\VariantModels\UnitParts\Japan\campaign\tokuhero\tex"




    Ensure to put your skin/mesh in the correct *Category* - a head skin thats been put in the torso's folder is hardly going to work correctly is it?

    Likewise if your skin is a campaign piece based model (Metsuke, Geisha, Ninja etc), these models use a single mesh and therefore only use one skin for the entire body - ensure that the category is "Campaign" for models like these.

    After you have ensured the .dds files are in the Tex folder, and that your.mesh file is in the "custom_texture_name" folder - you will be able to load the mesh and texture in the editor onto any unit.

    Thats all there is to it really - fire up TWeak, load the unit editor, then look for your variant model file in the list (or click "load from file" button in the bottom left to load manually), or even edit an existing uniform. *Note* - for your units to show in the database list of the unit editor, you will need to add custom entries to the "DB/Uniforms" table in tweak for the new unit first - otherwise you will have to click the "load from file" button and manually load your variant file.






    You can apply your custom textures to the variantmodel on the right side from the correct category- i.e if it was a custom torso you will find it under torso's.

    you can add skins to your variant model on the right by double clicking, and remove them from the model by clicking on the name on the left. Remember to click save for your changes to apply.

    You then have two choices -

    a) Add the variant file and unitparts folders directly to your packfile using Packfile Manager - effective for quicker editing of existing mods
    b) Export to binary and have BOB create the packfile with your new variantmodel in it. - best for new mods which do not yet have a packfile.

    I have tried to make this as clear as possible - any questions can be posted below and answered in due course.

    Thanks.
    Last edited by scope2007; November 09, 2012 at 08:10 AM. Reason: addition of diagrams
    -Scope

    Author of:

    Ninja Hero Mod V3.0 (For Hattori, Tokugawa and FOTS Factions) *Released 08/06/2013* - Addition of new FOTS campaign Shinobi Hero unit, rebalancing and new unit randomisation.

  2. #2

    Default Re: Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

    i was thinking, is it possible to get a unit (any unit) fight with the ninja wakizashi; or the general's wakizashi; i tried to do it, but it shows the wakizashi on the back of the soldier and the soldier waving an unseen sword towards the enemy (and winning!) hehe any idea if this is possible with the new kit;

  3. #3

    Default Re: Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

    This might be a dumb question, but where do you create new textures?

  4. #4

    Default Re: Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

    Is it possible to import skins from Assembly kit to PFM? Since I don't know how to Change hats, shirts, pants, Etc. in the PFM.

    If it's possible can you please tell me how?

  5. #5
    Xorte-Renshe's Avatar Civis
    Join Date
    Jan 2011
    Location
    Newcastle, England
    Posts
    159

    Default Re: Importing custom unit textures/ 3d meshes into Assembly Kit's Unit Editor

    I am unable to "save" or "save as" in TWeak after (or before) editting the outfit options on a unit variant. I click "save", and it says "saved", and I click "save as", and it brings up the save as box, and I set the name of the file and save it. But the new file never appears in the folder I saved it to, and if I re-open a unit I clicked "save" on, it loads reverted back to the way it was before I changed it.

    When I close TWeak, it gives me a dialogue box saying "t:\branches\shogun2\modders\common\warscape\source\platform\EngineStats.cpp(119) : WARSCAPE::WS_ENGINE_STATS_IMP::resource_destroyed" and "m_total_size >= size Failed", then the options to "Abort", "Retry", "Ignore", and "Ignore All", all of which crash the software.

    Any ideas?

    ===[EDIT]===
    I figured it out. The programs saved the files to another location. So, I've found the variant models I made. The crash thing is still baffling, though.
    Last edited by Xorte-Renshe; January 09, 2013 at 09:05 PM.

Posting Permissions

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