Results 1 to 19 of 19

Thread: Adding new clans to Shogun 2!

  1. #1
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Adding new clans to Shogun 2!

    To preface this, I do not mean the clan-swapping stuff I have been doing. I also do not mean applying this custom clan to the campaign map. I am starting much more basic than that. I simply mean creating a custom clan that you can use in custom battles!

    I will start simple. This will mean no custom visuals will be used. I'm thinking more people will understand this way. I thought this would be much more complex. I was prepared for a lengthy quest to get this right. Humourously, I got it right the first time.

    You will need the following program:
    -Pack File Manager. TWC page: http://www.twcenter.net/forums/showthread.php?t=433370
    -WordPad (or any text editor)

    You will need the following files (open each .pack with Pack File Manager):
    1. From data.pack, you will need:
    -faction_banners
    -faction_uniform_colours
    -factions
    Their file path is "data.pack > db". From here you can see folders like "faction_banners_tables". Inside the folders "faction_banners_tables", "faction_uniform_colours_tables", and "factions_tables" are the files you need.
    2. From models.pack, you will need:
    -banners.tai
    This files' file path is "data.pack > rigidmodels > flags > textures > banners.tai"
    3. From local_en_patch.pack, you will need:
    -factions.loc
    This files' file path is "local_en_patch.pack > text > db > factions.loc". Important: "en" is my localization. For anyone who doesn't use the english language in Shogun 2, that "en" bit may be different. Look for something like "local_<2 letters here>_patch.pack". <2 letters here> means... well... two letters .

    Before you extract these, create a folder. Call it anything you want. This will be for your custom .pack file. Extract each file I listed above into this one folder. They will overwrite the originals.

    Before we get to editing, let's get some things clear. Even though I'm calling this simple, if you start this from scratch it can be a lengthy process. We will be using pre-existing information and changing the important things.

    It will be easier if we start with "banners.tai". This is because Pack File Manager cannot edit .tai files. There is a detail we need to make note of before editing the file; the faction ID. This is used throughout the game files, so you need to be absolutely clear about what your faction ID is. I am re-using database information for the Ukita clan, and I will use the faction ID "ukita2".

    Now, open the file with WordPad. There are a bunch of banners you can use for your custom clan. As I said before, I will not get into custom visuals in this tutorial. I plan to make a nice and detailed tutorial for that soon. Our focus is simply getting the bare essentials together.

    I will use the Toyotomi banner for my custom faction. The entry will look like this:
    mon_stratbanner_toyotomi_diffuse.tga banners2.dds, 2, 2D, 0.500000, 0.250000, 0.000000, 0.250000, 0.250000
    Copy this. Be careful that you don't copy anything else. Click your mouse after hovering to the right of the last number in that line. For every entry, this number is "0.250000". Hitting enter will create a line between the Toyotomi and Tokugawa entries. Remember how I told you to copy the entry? Well, paste it in this blank line.

    Do you have your faction ID? Mine is "ukita2". In the entry I just pasted, I need to replace "toyotomi" with "ukita2" so the game knows to load that particular banner. Part of my banners.tai file now looks like this:
    mon_stratbanner_toyotomi_diffuse.tga banners2.dds, 2, 2D, 0.500000, 0.250000, 0.000000, 0.250000, 0.250000
    mon_stratbanner_ukita2_diffuse.tga banners2.dds, 2, 2D, 0.500000, 0.250000, 0.000000, 0.250000, 0.250000
    mon_stratbanner_tokugawa_diffuse.tga banners2.dds, 2, 2D, 0.750000, 0.250000, 0.000000, 0.250000, 0.250000
    Save it. If you did this and everything to follow properly, the game will know to load the banner. You can do this for any of the listed banners. Just follow the same instructions.


    Now to create the .pack file. In 'Pack File Manager' go File > New. You need to browse for the folder that contains the files you extracted. Once you do that, right-click somewhere under "untitled.pack" and "add directory...". Do the same thing, and select the folder you made. You will be able to expand everything.

    Open the "factions" table. Remember how I said we were using pre-existing information? Well, we will be using one of the rows in each of the db tables. We do not need more than one, so we will delete all but one. Look under the "Faction IDRef" for what clan you want to keep. I am using the information for the Ukita clan, so I will keep the row with "ukita" as the Faction IDRef. To delete a batch of rows, click on one using the column to the left of "Faction IDRef" (it has no information, it is meant as a way to select entire rows), then while holding the shift key do the same thing further down. Then hit the 'del' (delete) key. For me, I am left with one row: the one with "ukita" as the Faction IDRef. To limit this to what is absolutely necessary, there is only one thing that really needs changing. Change the Faction IDRef entry to the one I told you to create earlier. Remember, mine is "ukita2". We need to do a little bit extra to tell the game that this clan can be used in custom battles. Under "Early Availability" and "Late Availability" you need to change the "False" entries to "True". We are done.

    Do the same deleting of rows for the "faction_banners" table. You will really only need to change the Faction IDRef to your own Faction IDRef here. The rest of the values change the colours of the soldiers' sashimono, amongst a few other things. For now, we just want to get our clan going. The details can be made better once we get it working.

    Do the same deleting of rows for the "faction_uniform_colours" table. It's getting pretty easy, isn't it? This time, the database calls the column "Faction ID" instead of "Faction IDRef". No matter. Change the original entry with your own Faction IDRef.

    We have one more thing to do: add the name of the clan. Before we make changes, I should note something. Do not delete any entry on "factions.loc". It will be easier if we sort these names by the "Localised String" column, so click on "Localised String". The fifth entry you should see should be something like this:
    Entry in "Tag" column: factions_screen_name_amako, Entry in "Localised String" column: Amako
    Let's clone this fifth entry, and the sixth one below it with the "factions_screen_adjective_amako" entry in the "Tag" column. You should see two rows of these entries. We now need to enter our Faction IDRef as well as the custom clans' screen name. For me, these new entries look like this:
    First "Tag" column entry: factions_screen_name_ukita2, first "Localised String" column entry: Ukita2
    Second "Tag" column entry: factions_screen_adjective_ukita2, second "Localised String" column entry: Ukita2
    There are three other Ukita entries I did in my successful test, them being the "factions_screen_name_when_rebels_ukita2", "factions_screen_name_when_shogun_ukita2" and "factions_defend_desc_ukita2". These shouldn't be needed, but I did them to be comprehensive. Make those changes if you want.

    This concludes the edits you will need to get your clan to show up. Before you go ahead and save your .pack file, right-click anywhere under "untitled.pack", move the cursor over "change pack type" and choose "movie". This will make sure your pack file is prioritized. Now, go "file" and hit "save". Search for Shogun 2's data folder. I use 64-bit W7, so for me it is:
    C:\Program Files (x86)\Steam\steamapps\common\total war shogun 2\data
    This might be different for 32-bit users or anyone not using Windows Vista/7. Give it a unique file name; it doesn't matter what, just as long as it isn't the same as any of the preexisting pack files. From there, load up the game and test it. If something doesn't work, download my .pack file which I have attached to this post in a .rar file and have a look at what you need to do.

    As I have noted, this is the bare basics. I might do a 'Part II' that has a look into things that make up the adding of a clan for the sake of customizing, like choosing crests from data.pack, changing RGB info and so forth.

    Screenshots (BTW, with the first screen, don't worry about the Kiso crest; SP battle preferences told it to do that.



    I'm on the TWC pretty often, so I'll be able to get back to anyone pretty quickly. Specifically, if you don't think something is clear, or if I have made lots of spelling errors let me know for the sake of other TWC members. Also, this is my first TWC tutorial; critique me. Did I lack any detail? Does the thing actually work?! Oh, and I have attached my test file to this page, as noted above.

    I intend to make more tutorials, including but not limited to a detailed one for making custom banners.

    Anyway: good luck, guys!
    Last edited by Akaie; September 17, 2011 at 05:02 AM.

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  2. #2

    Default Re: Adding new clans to Shogun 2!

    Thanks, awesome tutorial! You wouldn't happen to be making another for how to add the custom clan to the singleplayer campaign, would you?

  3. #3
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by kairlano View Post
    Thanks, awesome tutorial! You wouldn't happen to be making another for how to add the custom clan to the singleplayer campaign, would you?
    A few theories come to mind as to how I would do that. With more investigation on my part I will post my findings here .

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  4. #4

    Default Re: Adding new clans to Shogun 2!

    I'll keep an eye out for it. Keep up the good work!

  5. #5
    The Hedge Knight's Avatar Fierce When Cornered
    Artifex

    Join Date
    Oct 2009
    Location
    England
    Posts
    5,875

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by Anton93 View Post
    A few theories come to mind as to how I would do that. With more investigation on my part I will post my findings here .
    Don't waste your time Anton, nice tutorial and all but adding clans to the campaign is as of yet impossible in any warscape game, feel free to prove me wrong but esfs are sure as heck frustrating.

  6. #6
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by The Hedge Knight View Post
    Don't waste your time Anton, nice tutorial and all but adding clans to the campaign is as of yet impossible in any warscape game, feel free to prove me wrong but esfs are sure as heck frustrating.
    Yeah I know what you mean. I was free-floating for a while but now I'm seriously starting to feel the modding limitations of the warscape engine.

    When a significant modder such as yourself suggests that, I'm very inclined to listen .

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  7. #7
    The Hedge Knight's Avatar Fierce When Cornered
    Artifex

    Join Date
    Oct 2009
    Location
    England
    Posts
    5,875

    Default Re: Adding new clans to Shogun 2!

    Well, for tgw we wanted to add soviet russia as a new faction to the campaign but there is a load of associated BDI (and other) stuff that just could not be done manually.

  8. #8

    Default Re: Adding new clans to Shogun 2!

    I think it will work too for empire and napoleon total war

  9. #9
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    Yeah. The part regarding the banners would be invalid, as that seems to be the first time a tw game had what is essentially atlas files for banners.

    Judging by N:TW's factions table, it seems the ui/flags directory contains the files used in the same manner as those created by the banners.tai file.

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  10. #10

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by Anton III View Post
    It will be easier if we start with "banners.tai". This is because Pack File Manager cannot edit .tai files.
    I'll add it to to the list of text files for PFM.
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  11. #11
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by daniu View Post
    I'll add it to to the list of text files for PFM.
    Thank you! To reflect my appreciation, consider this gif:


    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  12. #12

    Default Re: Adding new clans to Shogun 2!

    Jesus. I'm struggling to even follow these instructions. There's no way I'll ever become proficient with this before I get distracted by the next big thing.

  13. #13
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    Hmm. That sucks. Is there a particular point that is tripping you up?

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  14. #14

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by Anton III View Post
    Hmm. That sucks. Is there a particular point that is tripping you up?
    All of it, really. It's a lot to soak all at once. I find I spend a lot of time back tracking and double checking I'm working with the correct line. There's also the problem with the ambiguously labeled columns in the PFM. I can never tell if the column was intentionally left blank and the residing zero is moot or if the column was left blank as an oversight and the residing zero is actually a critical part of code.

  15. #15
    Akaie's Avatar Sangi Ukon'e no Chūjō
    Join Date
    Jun 2011
    Location
    Australia
    Posts
    3,291

    Default Re: Adding new clans to Shogun 2!

    It's understandable. Everyone has to learn somewhere .

    Spoiler Alert, click show to read: 


    Have a look at this. I have highlighted the important parts in the "factions" table. For now, ignore the rest of the table.
    -The "FactionIDRef" is simply the name of your faction in the game files.
    -The "True" value under "Early Availability"/"Late Availability" will make sure they show up in custom battles.
    -The file path "data\ui\flags\ukita" under "Flag" is cosmetic. If you want, just keep using "data\ui\flags\ukita" until you know your clan is working.

    As for "faction_banners" and "faction_uniform_colours", perhaps you should start by changing the values in the "NewClanTest.pack". Do you understand that the numbers under "Rx", "Gx" and Bx" (x being either 1, 2 or 3) establish an RGB value?

    Similar to my suggestion above, for the changes made in "factions.loc", try changing things in the "factions.loc" file provided until you understand what you've done.

    The main faction banner is also cosmetic; there will be a white rectangle where your banner was supposed to be, but nothing crashes.

    The S2 Onin War Mod | Boshin: Total Domains
    Patron of Erwin Rommel
    Under the proud patronage of Radious


  16. #16

    Default Re: Adding new clans to Shogun 2!

    Is it possible to edit the name of a faction so that it will have a custom name in the campaign?

  17. #17

    Default Re: Adding new clans to Shogun 2!

    Hey I can't find the lines you have stated above to edit in local_en_patch.pack . I found a same file in local_en.pack and used that instead ! But still nice tut ! :

  18. #18

    Default Re: Adding new clans to Shogun 2!

    Quote Originally Posted by evan300 View Post
    Hey I can't find the lines you have stated above to edit in local_en_patch.pack . I found a same file in local_en.pack and used that instead ! But still nice tut ! :
    All the patch files have been integrated into the main packs with the latest update, so if you come across any tutorial mentioning a *_patch.pack, you'll have to look in the corresponding main file.
    Tools: PFM 4.1 - EditSF 1.2.0
    (Download PFM - Download EditSF)
    Warscape Modding Guide
    Join the PFM User Group on Steam to receive PackFileManager update notifications.

    Respecto Patronum

  19. #19

    Default Re: Adding new clans to Shogun 2!

    And what if I just want to create a new banner? what kind of program should I use? (GIMP? photoshop?)

    and how can I implement these to the game itself?

Posting Permissions

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