Results 1 to 10 of 10

Thread: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

  1. #1
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    Exporting a custom building model to TED and Shogun2


    Quick basics As always, there are some special conventions for buildings you have to follow. One of them is the naming of the folder and files.


    • Your building-folder should be placed under raw_data/art/land/.../buildings/
    • Every building needs a folder on it's own. This folder can have sub-folders inside, e.g. if your building has variations.
    • The name of the folder has to be the name of the 3dsMax file (eg. acw_snake_fence_1m)
    • The name for the model has to be: xyz_piece01_destruct01.cs2

    For example (acw_snake_fence_1m_piece01_destruct01.cs2)

    • For the creation of the collision files you do need two files:
      • xyz_tech.cs2 (name has to be the same as the folder and as the 3ds max file with "_tech" as subfix, eg. acw_snake_fence_1m_tech)
      • xyz_tech.xml


    Click image for larger version. 

Name:	basics.jpg 
Views:	50 
Size:	64.5 KB 
ID:	302885



    3ds Max It's recommend that you take a look at the example models of CA, since I will only mention the most important things.

    Program needed: 3ds Max 2010, with higher versions the cs2. plugin by CA doesn't work.

    1) If you take a look at my screenshot and especially the layer manager you will see few layers and models I will explain their name and what they are used for.

    2) piece01_destruct01_lod01

    This is the first LOD, the model with the most details.
    In my example I have only one LOD but its recommend to create as much as needed to have the best performance. For each Lod you need another layer (or you will go insane when working on complex buildings).
    Simply name it them "piece01_destruct01_lod02/03/04...

    As you can see at the name you can also have several pieces of a building and several destruction models. This could be used for a wall, which can be destroyed and then stormed.


    3) Rigid Model Scipts

    To run the scripts, go to Maxscript/run script/ and choose the Attriputes script (don't forget to place the scripts from the assembly kit in the script folder of 3ds Max!)

    A new window opens where you can choose a shader (for buildings "standard" is good enough), press apply (4) and then you edit some of the attributes in the menu (5).
    Not really necessary, if you don't apply a shader, Bob will automaticly use the standard shader.

    6) _tech

    The collision model. You need a spline (piece01_destruct01_hard) which outlines the building and a 3D Model (piece01_destruct01_collision3d) for the height etc. You can use for each destruction level an own collision model. The model has to be closed at all sides (means you shouldn't delete the polygons at the bottom for example)
    Special are bridges, who also need a mesh named platform (more on this later)

    5) _tech.xml

    Here are the EF-Lines stored. Those can't be used atm since we are lacking an exporter script (maxscript)

    7) Texturing

    Create a new Material in the Material Editor and give it a name. Attention. You have to use the name of the diffuse texture. E.g. wood_diffuse.
    If you use several tileable textures (instead of an atlas) you have to split up the model, since each object can only have one texture.

    8) Export

    First select the piece01_destruct01 - model and export it, with the cs2 exporter by CA. Pay attention to the naming of the files which I outlined in the basics.
    Then export the collision model with the same exporter. pay attention the naming conventions. Only yourmodelname_tech.cs2 - no piece01_destruct01!

    Click image for larger version. 

Name:	3ds-max.jpg 
Views:	78 
Size:	246.4 KB 
ID:	302886



    BoB

    If your names are correct you can select all files for export. Bob automaticly creates DB-tables for the "battlefield_building"-, "models_building"-, "warscape_rigid_lod"- and "warscape_rigid"-tables

    Click image for larger version. 

Name:	bob.jpg 
Views:	37 
Size:	156.5 KB 
ID:	302884



    PackFileManager

    Copy the files to the shogun data folder, create a new pack (eg. modbuildings.pack) and place the new files inside.

    If you want the building to show up in TED you have to do two things:
    1) Change the pack type to "Movie". If not, TED isn't able to read the table.
    2) Go to the battlefield_buildings and set the option for "visible in local TED" to "true".

    Click image for larger version. 

Name:	pfm.jpg 
Views:	27 
Size:	73.1 KB 
ID:	302883



    If everything was correct, you now should be able to place your custom building in TED:

    Click image for larger version. 

Name:	proof.jpg 
Views:	382 
Size:	206.6 KB 
ID:	302882

    Edit 1:


    If you want to make a wall/fence "vaultable" (=soldiers can jump over it), you have to name the spline "piece01_destruct01_vwall" instead of "piece01_destruct01_hard".
    In PFM you have to use the building class "vaultable wall"

    Edit 2: You are now able to create new garrisonable buildings for Empire, Napoleon and Shogun 2!

    Using the EFLines Tools Maxscript
    I fixed the direction issue. Soldiers now face straight ahead, depending on the EFline orientation.

    -Added a button for assigning the rotation. This will add a new line indicating the direction of the spline.
    -Added a button for mirroring the rotation. Sometimes the rotation might be in the wrong direction, or you made changes to the spline and now have to recalculate the direction. Press the button erase the old rotation and add a new.

    Usage:

    Extract the folder and copy it to 3dsMaxdirectory/scripts/
    Run by clicking on Maxscript, run script --> EFtoolsbuttons - this opens the dialog.

    Create a new Spline with only two points. First set the properties (which building piece, which destruction level) and which type it has. Different types have different effects. "Low wall" makes soldiers kneel while firing and so on.
    Then use the add direction button, afterwards you are good for exporting. Choose a directory and a name which fits with the building name (like acw_eftest_tech.xml")

    Use Bob and have fun with your garrisonable building.

    Attachment 307336

    Example:

    Spoiler Alert, click show to read: 


    ~~ Download ~~

    EF Line Tools.rar

    Last edited by Primergy; May 15, 2014 at 11:00 AM.

  2. #2
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Exporting a custom building model

    Edit 1: Added information about how to make a wall not an impassable object but rather allow soldiers to jump over it.

  3. #3

    Default Re: Exporting a custom building model

    ok, now you got my atention .. so it could be possible to take a s2 wall and make it vaultable? .. for example .. the zen wall?

  4. #4
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Exporting a custom building model

    In theory yes - but I'm not sure if it's enough to change it in the db tables to a vaultable wall, or if you also have to do a bit of hex editing with the .cs2.parsed file of the zen wall.

  5. #5
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    Added a Maxscript for exporting EFLines - needed for making an building garrisonable, like forts, fort walls and so on.

  6. #6

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    Can you add cannons on a fort like in ETW/NTW? For example the way you add cannons on ships.

  7. #7
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    There are two ways - you can add cannons similar to how it's done for "bow towers" and the "star forts". In 3ds max place a helper object (those green cubes) there where you want the arrows/shells/etc. coming out, naming it "arrow01" (or so), and then exporting it together with the other building objects. You can find out the real naming by examining the bow tower with a hex editor. Problem is, it shoots 360 degrees. Maybe you can stop this 360 firing by using the terrain to block shots.

    The second way (= coastal gun batteries) is more complicated. Taw made a converter for the model_building_db file. This enabled me to extract the EF Lines code for the coastal batteries, but I didn't managed it to create a working custom battery.

  8. #8

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    Maybe this would help, from Attila workshop:
    http://www.twcenter.net/forums/showt...ldings-in-game

  9. #9

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    @Primergy
    Do you have an example file (3ds max) of the efline fence?
    I have been trying to add one, but can't make them work.

  10. #10

    Default Re: Exporting a custom garrisonable building model for Empire, Napolen and Shogun

    Yeah, if anyone has any working examples and would be willing to share, that would be really appreciated

Posting Permissions

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