Hi
Exist some tutorials how to make other factions playable in Shogun 2 campaign, but their way isn't very comfortable. This is for reason that they basically based on "switching" factions keys (playable with no-playable) in all places in db and startpos (and also in scripts). Sounds like much work, right? Especially if do you want create overhaul mod with larger amount of playable factions than in vanilla.
So I decided to write this tutorial where I will show better way (which I used for my Last Alliance project). Here you also need switching faction keys but in one place - ui file and you don't have to use factions keys from vanilla. This way works for Sengoku campaign, for RotS and FotS you need do additional steps - informations in comment below.
Update: I wrote tutorial about adding new faction buttons to menu of new campaign - is here, but you should read this tutorial first.
What you need:
- Assembly Kit for Shogun 2 (you can also use esf editor to do it, but in this tutorial I use Assembly Kit)
- Assembly Kit's Update Pack 1.2 (unofficial patch for Assembly Kit, necessary if you want to edit vanilla campaign, but recommended also if you work on fully new campaign)
- UI converter by TAW (it needs Python to work)
- Notepad++ or something like it
- And of course RPFM or PFM
I hope that you have basic knowledge about use Assembly Kit and RPFM or PFM, if not you should go to other tutorials first to learn it
Important note: Key of one playable faction can't be fully included in key of another playable faction. It causes bug, where button of one faction is showing another faction. So, if you give keys for your factions e.g. kingdom1 and kingdom1_vassal and set both as playable, it can cause problems. You have to give them names e.g. kingdom1_main and kingdom1_vassal.
Go to binaries folder in Assembly Kit and run TWeak.Release, in left top side click Tools and select DAVE. Next click View and open Table Launcher.
Find start_pos_factions and open. Find faction which do you want make playable (here it is Saito Clan) and in column "playable" change "false" to "true" and apply changes.
Optional. If you want have right faction name under faction button in faction selection menu (not applicable to the name of the faction above the faction description) then go to ui_component_localisation, add new record and create new key in component_label column and write faction name in localised_string column. And apply changes.
Now you can close TWeak and run BOB. In BOB in raw_data column go to EmpireDesignData -> campaigns -> jap_shogun and click box beside jap_shogun and select all. Next you can click start (but before make sure that you have run steam). BOB will run Shogun 2 launcher, if faction is from your mod, then you have to select mod pack of your mod before launch game (but if you create mod with new factions in campaign then probably you know it). When you launch game, BOB will create startpos file and will close game automatically.
If you edit ui_component_localisation, then in BOB select raw_data column -> EmpireDesignData -> ui_component_localisation and run export proces.
Exported files you will find in working_data folder of Assembly kit, startpos file will be in campaigns\jap_shogun folder, ui_component_localisation will be in text folder. Add both to your mod pack (use RPFM or PFM to it).
If you want to play this faction in multiplayer campaign, you not have do to more.
Next use RPFM of PFM to open vanilla data.pack and go to ui -> frontend ui and here you will find grand_campaign_japan file - extract it.
Now you have to use ui_converter, it the best to put folder with it on your desktop and put in the same folder grand_campaign_japan file. Next hold shift and right click somewhere inside of this folder and open command window. In command window write this code:
Code:
Python convert_ui.py -u grand_campaign_japan grand_campaign_japan.xml
and click enter.
You will receive new xml file, open it in notepad++ (or in other text editor). Here you can change one faction button to another faction button. For example I will change Hojo button to Saito button. So you have to search all button_[faction key which you want hide] and edit it to button_[faction key which you want add to menu].
In this file you will find links to tga button file - you can change it to your button tga files (of course you have to prepare them manually).
You will find also <stateText>[faction name]</stateText> - you can edit it to new playable faction name, and under it you will find localisationID - here write key from ui_component_localisation.
Save changes and back to command window and write code:
Code:
Python convert_ui.py -x grand_campaign_japan.xml grand_campaign_japan
You will receive new grand_campaign_japan file, add it to your mod pack.
Now you have playable Saito in singleplayer campaign ^^ (I didn't add new button, because I'm lazy >.<)
I hope that this tutorial will be useful for someone and that all is clean (I'm not good teacher...) - this process is really easy and enough quickly