Results 1 to 10 of 10

Thread: How to add a custom Battle Building

Hybrid View

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

    Default How to add a custom Battle Building

    How to add a custom Building for Battlemaps - (Difficult)



    Welcome to my Tutorial “How to add a new custom Building for Battlemaps”. Here i will show you how to implement a complete new building without the need to replace a vanilla one.
    This Tutorial should work for both ETW and NTW.
    If you find Mistakes of found out a new thing, feel free to report them to me and i will update this Tutorial. Be aware that i won’t cover the modeling process or how to work with UU3D (which is needed to export the Models). I think you all are able to find the save button on yourself, or? It’s also not a step by step tutorial, i will only outline the steps which you have to do and where you have to take care.
    It’s recommed to have the DB Tables opened while reading so you can have a look on the Names etc.

    1.) What you need





    2.) Using Taw’s tools on the Models Building Table.

    Refer to Hedge Knights Tutorial for basic questions

    Usage:

    jruby models_buildings_unpack db/models_building_tables/models_building tmp/models_building.txt

    jruby models_buildings_pack tmp/models_building.txt db/models_building_tables/models_building_new

    3.)How does the DB load the the model?

    Needed DB Tables:


    • Battlefield_buildings_tables
    • Models_building_tables (not editable with PFM or DBE)
    • Warscape_rigid_lod_tables (Model path, definitly needed)
    • Warscape_rigid_tables (Texture path, definitly needed)
    • Warscape_animated_Lod_tables (only if you want a destruct animation)
    • Warscape_animated_lod_Tables (only if you want a destruct animation)


    DB Tables Connection and Naming Convention:

    Click image for larger version. 

Name:	Custom Prop - DB drawing.jpg 
Views:	10 
Size:	52.1 KB 
ID:	320166

    As you can see in the drawing the battlefield_buildings_table is the one, which connects all other DB’s.

    The first Building ID is used as general ID, to which the Building Entries within the Maps refer to.
    The second ID is the Model ID, which uses the game to load all model parts together.

    The ID has to fit with the one in the models_buildings_ID aswell with the “prefix” of the Model ID within the Warscape Tables.
    The subfix piecexy_destructyz tells the game in which part (buildings can consits of many parts wich are destroyed seperate) this is.

    Since we have to use the collision mesh of the vanilla buildings i would suggest to follow the architecture of the vanilla buildings.
    If it only has one part, only use one part in your model. Example:

    Attachment 146473
    Attachment 146475

    4.) Taw’s Tool

    The Game needs an entry within the models_buildings_table to load a model and it’s collision mesh.

    Therefore convert the Table with Taw's DB Converter and open it up with Notepad++ to get proper spacing between the lines.

    Your Entry should look like this:

    Attachment 146474

    Make shure that you have exact the same outline of your new entry as the vanilla ones, if not the game will simply crash.

    5.) EF - Splines, Cs2 Meshes and other things

    EF Splines are used by the game to place soldiers within a garrisonable building.
    CS2 Meshes are the collision meshes, where soldiers can walk, where not, where they can be hit etc, also seams that those are placing the fort_cannons.

    Usages of both files: If we ever get an converter for the cs2 meshes, we could a) do our own collision meshes and b) making some nice assets like the leuthen church with garrisonable walls, or a proper Hougamont.

    6.) What might happen if you make errors and solutions

    At the moment the chances to make an error are pretty high, especially within the models_building_table, so here are some problems i encountered which might help you:


    • Game chrashes while loading the Map - Error within models_buildings (eg an empty line between entries)
    • Map is loading, but asset don’t appear - Most likly an error in your Model ID’s; wrong model path, or you wrong names for buildings; eg not following the model naming convention.
    • Model is black - Texture path is wrong, or you don’t have specifed a texture path while exporting a model.


    7.) I want to thank:


    • Taw for his great tools which opened up this possibilty
    • The Hedge Knight for his splendid Tutorial on how to use Taw’s tools on Windows
    • Topcat/ T.C for cooperation with the UU3D Developer
    • The Creators of the PFM, DB Editor and all those who helped me.


    I will post many of the links and attachments as soon as the TWC works fine again, as long i'm sorry

    8.) Additional Things and interesting facts

    It seams that if you want a prop where Units can walk through, you have to set the type in the battle_buildings table to incidential. What the other types like windmill, townhall are doing is unknown.

    Edit: Doesn't seam to work on "large" models...only on small props.


    Last edited by Primergy; January 25, 2015 at 07:13 AM.

  2. #2

    Default Re: How to add a custom Battle Building

    that's a great step, thanks primergy! will that be possible for NTW and SH2?

    Anyway, we will be abble to do some walls, casemates etc.

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

    Default Re: How to add a custom Battle Building

    NTW and SH2?
    For NTW surly, Shogun i don't know, but the workflow might be nearly the same.

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

    Default Re: How to add a custom Battle Building

    added a small entry how you can get props "walkthroughable"

  5. #5
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: How to add a custom Battle Building

    (Slightly off-topic as this if for E:TW, but the tutorial is applicable for N:TW as well):
    I can't seem to find stone walls in the battlefield_buildings table in N:TW.

    How would one place such walls on custom maps in N:TW?

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

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

    Default Re: How to add a custom Battle Building

    Quote Originally Posted by Aanker View Post
    (Slightly off-topic as this if for E:TW, but the tutorial is applicable for N:TW as well):
    I can't seem to find stone walls in the battlefield_buildings table in N:TW.

    How would one place such walls on custom maps in N:TW?
    There's a large stonewall model with some dead soldiers in ntw if thats what you are looking for.

    Or do you mean those stonewalls were you can place your troops behind?

  7. #7
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: How to add a custom Battle Building

    Quote Originally Posted by Primergy View Post
    There's a large stonewall model with some dead soldiers in ntw if thats what you are looking for.

    Or do you mean those stonewalls were you can place your troops behind?
    Yeah, precisely, the stonewalls you can place your troops behind.

    They seem to be like deployables, however: their CS2 parsed files are inexistant within the .pack files of N:TW, as if their collision models are related to the splines, which seems largely improbable.

    I can't imagine why CA would hard code the collision/projectile block abilities of their stone walls, either.

    The strange thing is, that they are placed like buildings on an E:TW map (Anatolia), so they should be placeable on E:TW maps at least.

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

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

    Default Re: How to add a custom Battle Building

    Quote Originally Posted by Aanker View Post
    Yeah, precisely, the stonewalls you can place your troops behind.

    They seem to be like deployables, however: their CS2 parsed files are inexistant within the .pack files of N:TW, as if their collision models are related to the splines, which seems largely improbable.

    I can't imagine why CA would hard code the collision/projectile block abilities of their stone walls, either.

    The strange thing is, that they are placed like buildings on an E:TW map (Anatolia), so they should be placeable on E:TW maps at least.
    Ok, those are handled completly different then normal buildings.
    They are placed in the farm_template_tiles (i also wrote a reource thread for those), were you basicly insert the coordinates of four spline knots.
    Along that spline the rigid_spline is placed, and somehow the game detects that this is a stonewall and lets place your troops behind (but only if you added some more splines, to determine were soldiers are kneeling).

  9. #9
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: How to add a custom Battle Building

    Quote Originally Posted by Primergy View Post
    Ok, those are handled completly different then normal buildings.
    They are placed in the farm_template_tiles (i also wrote a reource thread for those), were you basicly insert the coordinates of four spline knots.
    Along that spline the rigid_spline is placed, and somehow the game detects that this is a stonewall and lets place your troops behind (but only if you added some more splines, to determine were soldiers are kneeling).
    Oh, thanks mate, really great help!

    You have deserved some +rep I believe.

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  10. #10
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: How to add a custom Battle Building

    I have a problem when I use taw's models_buildings_pack with jruby.

    All work fine when I use db_unpack but when I use models_buildings_pack I always get the error :

    C:\Users\xxxxxxxxxxx\Desktop\db>jruby models_buildings_unpack db\models_buildings_tables tmp\models_buildings
    models_buildings_unpack:18:in `initialize': Permission denied - db\models_buildings_tables (Errno::EACCES)
    from models_buildings_unpack:18:in `open'
    from models_buildings_unpack:18:in `initialize'
    from models_buildings_unpack:69:in `new'
    from models_buildings_unpack:69
    I've checked folders paths, they are right.
    I've checked that no windows is pointing to the directory that jruby will use, it's ok.

    The command line for db_unpack look like this :
    directory_path>jruby script_to_execute path_to_db_tables_to_convert_folder path_to_converted_db_tables_folder

    C:\Users\xxxxxxx\Desktop\db>jruby db_unpack db\abilities_tables tmp\models_building_tables

    The command line for models_buildings_unpack shouldn't look like this ? :
    C:\Users\xxxxxxx\Desktop\db>jruby models_buildings_unpack db\abilities_tables tmp\abilities_tables


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

Posting Permissions

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