Results 1 to 1 of 1

Thread: How to add more slots for factions in menu of new campaign

  1. #1

    Default How to add more slots for factions in menu of new campaign

    Hi ^^
    This tutorial is continuation of my previous (which you should read firstly), where I showed how to change which faction is showing as playable in singleplayer campaign. In this tutorial I want to show how to add more slots for factions in this menu.

    What you need:
    - UI converter by TAW (it needs Python to work)
    - Notepad++ or something like it
    - WinMerge or something like it
    - And of course RPFM or PFM

    I created mod where is 46 slots for factions. Here is UI file in xml format – You feel free to use this UI file in own mod and modify it (by changing which buttons is for which factions or by adding new buttons) but please credit me - it was a lot of work to add so much buttons. In archive file I put also txt file with order of added buttons.

    Warning – always keep grand_campaign_japan file in xml format with your changes, not delete it. Because if you many times try convert this file to xml format and back, then may be that you will broke this file.

    Some basic information at first. When you open grand_campaign_japan.xml file then go to 8304 line – here is starting UI subgroup with faction buttons.
    In lines 8309 and 8310 you can choose position of group with buttons. If you set <xOff>0</xOff> then first button will be on line where grey background in menu ended on left, but always you can move buttons more to left, just write e.g. <xOff>-50</xOff>.
    In lines 8339 and 8340 you can choose size of group. It important if you want to have a lot playable factions, because if group width (at this moment I don’t know how to put buttons in more than one row) will be too small, then buttons will be one on another (but in most cases probably you will still can select every in game without problems). Anyway, if you set <width>1050</width> and above <xOff>0</xOff> then last button will be on line where grey background in menu ended on right.

    Now go to line 8388 – here is set how much factions buttons are in group, if you add next button, you have to edit this line and write amount of buttons.

    From line 8389 to 9100 is first button. Every button has the same lenght. In vanilla end of last button (Otomo) it line 16932, in my file with 46 factions end of last button (Mogami) it line 41140. If you want add next button, you need add file under last line of last button and paste prepared code of button.

    Here is example files of two buttons. Copy one and rename to create own faction button. Now you need compare this copy with second button. You can use for this e.g. WinMerge.
    In WinMerge select file-->open and next load both example buttons and click Compare. Because buttons are very long and you need edit only some lines then click View-->Diff Context-->0 lines – now program show you only lines with are different between buttons.

    In <title>button_[faction key]</title> put key of faction which you want to add to button list (if you don’t have yet new factions and you want just prepare UI then you can just write “placeholder1” or something).
    In <parentName>button_[faction key]</parentName> put the same name of button what is in <title>button_[faction key]</title> line for previous button.
    In all lines <path>UI\FrontEnd UI\Skins\[button icon name]</path> put name of .tga files which you will prepare for button. Will be good if you keep template of names.
    The importance of the line <stateText>[faction name]</stateText> and <localisationID>[key linked to ui_component_localisation.loc]</localisationID> I explained in previous tutorial.
    About line <xOff>[number]</xOff> looks that it only affects on order of buttons. However, for vanilla buttons space here it 82 (so chosokabe buttons has set <xOff>-69</xOff> and next button, shimazu, has set <xOff>13</xOff>).
    Rest of differences it IDs. Every button need unique IDs (in other case game will crash). However usually one ID is in several lines in button and you need keep this template (in other case, of course, game will crash).
    Select one ID and use Ctrl+F to search – program will mark all places where this ID is.

    Now you can save changes, open xml file in notepad++ and copy new button to grand_campaign_japan.xml and convert file to game format like in previous tutorial.

    And that’s all, I hope that my files and tutorial will help you ^^

    About FotS and RotS campaigns. At this moment I don’t know how to add more buttons (or even switch this which exist) for this menu campaigns. But you can use menu and factions slots from Sengoku campaign for FotS or RotS campaign – I explained it here.
    Last edited by Sara Temer; October 24, 2020 at 07:26 PM.

    One Ring to rule them all, One Ring to find them,

    One Ring to bring them all, and in the darkness bind them,
    Last Alliance: TW
    Last Alliance: TW on MODDB
    Last Alliance: TW Patreon

Posting Permissions

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