Results 1 to 8 of 8

Thread: How to Create a Dynamic Unit Cap

  1. #1

    Default How to Create a Dynamic Unit Cap

    Many mods out there have "dynamic unit caps" for both vanilla and modded units in order to increase/decrease the difficulty or rebalance the game. I'm going to teach you how to do that yourself.

    In this tutorial, I'll be using Pack File Manager (From here on out, I'll just refer to it as PFM), but the concept is the same for the official mod tools aside from the last step of creating the mod.pack, which I don't really know how to do right.

    STEP 1: Open PFM, from the menu at the top select "File -> New", or press "CTRL+N".

    STEP 2: Once you've done that, select from the menu at the top "Files -> Add -> From Pack".

    STEP 3: The tables that you will need are located in the Data.pack under db, and they are
    effects_tables
    (Optional) technology_effects_junction_tables
    effect_bonus_value_unit_record_junctions_tables
    building_factionwide_effects_junctions_tables
    unit_tables
    You will also need one file from the local_en.pack, the file being located under "text -> db"(if you use the english version of the game. for other languages I'm afraid I can't be of any help)
    effects.loc
    Once you have all those tables in the pack, you should save it. We'll be calling it Tutorial.pack because thinking of a real name is too hard.

    STEP 4: Now we have to create a new effect in the
    effects_tables. Using PFM, click on a row (any row, it doesn't matter) and at the top of the right side of PFM click "clone row". PFM will highlight the row in red to remind you that it's not unique, so we have to rename the left most box. We will call itunit_cap_tutorial. Save again. Trust me, you want to save. sometimes when using PFM I've had issues, you may see later on.

    STEP 5: In the
    effect_bonus_value_unit_record_junctions_tables create a new row by clicking on the "Add Row" option (to the left of the "clone row" button we used in the last step. You'll figure it out). In the left most box type "unit_cap" without the quotes. In the middle box, type unit_cap_tutorial. Depending on your settings in PFM, and the version you are using, you may have to type the whole thing out, or just select it from the list of effects. If you can't select it from the list because it's not there, or you typed it out and it gives you an error, close PFM and re-open Tutorial.pack. I'm not sure why this happens, but I've had to deal with it before. It's just a minor inconvenience, and it won't bother us because we've saved our progress. In the right box, type/select the unit you wish to change the unit cap for.

    STEP 6: Now, if doing this for the ROTS or Sengoku campaign, you won't see the effects in game if you attach them to buildings (I'll get into that more in later steps), but you will see them in FOTS. Either way, we need to make an entry in the effects.loc. If doing it for the ROTS or Sengoku campaign it doesn't really matter what you make the description. Select a row, and clone it just like in STEP 4. In the left box type effects_description_unit_cap_tutorial. In the right box, type what you want the description to be. It won't show up in the ROTS or Sengoku campaigns like I've been saying, but if there isn't an entry for the effect here it will ruin the tooltip thing when you mouse over the building you put the effect on.

    STEP 7: This is where you get a choice. The most common thing to do is to use the building_factionwide_effects_junctions_tables. Try to find the building you want the effect on in one of the rows, and clone that row. If you can't find it, no worries, you can just create a new row and select the building from the list. The building should be on the left, for instance "SHO_Buddhist_1_Temple". In the middle box, type or select your effect again. And lastly, in the right box type how much you want to increase the unit cap.

    STEP 8: Last thing you really need to do is the add a unit cap, since many units don't already have one. This step is semi-optional, and you only need to do it if the unit you want it to affect doesn't already have a cap, like the Yari Ashigaru. In the unit_tables find the unit you want, and scroll right till you see a column labeled "total cap". Either change it to 1, or any other number besides 0. Save and you are done.

    STEP 9 (Optional): You can also use the technology_effects_junction_tables to add the effect to a technology in the mastery of the arts. In this table, find the technology you wish to use, and clone a row. The left box is the technology, for instance "shogun_civil_main_core_way_of_chi". The middle box is where you effect goes. And the right row is the value, the number you want to increase the unit cap by.

    If you have any trouble, let me know and I'll try to help. I'm sure my ramblings are a little confusing.

  2. #2

    Default Re: How to Create a Dynamic Unit Cap

    I have a question here. if for step 5, you link multiple effects into 1 unit, what will happen? like say I give Archery Dojo 2 effects: increase all bow infantries by 2 (link this effects to all bow infantries) and increase bow samurai by 1, will this building increase my bow samurai by 2 or by 3?

  3. #3

    Default Re: How to Create a Dynamic Unit Cap

    Quote Originally Posted by Raizen View Post
    I have a question here. if for step 5, you link multiple effects into 1 unit, what will happen? like say I give Archery Dojo 2 effects: increase all bow infantries by 2 (link this effects to all bow infantries) and increase bow samurai by 1, will this building increase my bow samurai by 2 or by 3?
    effects are acumulative

  4. #4

    Default Re: How to Create a Dynamic Unit Cap

    It's as weierstrass said. it's cumulative, so you would increase the cap for bow samurai by three. Though, an effect to increase the cap of ALL bow infantry (I'm assuming you meant bow ashigaru, bow samurai, bow warrior monks, hattori bandits, and so on) and one that increased ONLY bow samurai cap is a little redundant. It's all up to you, but I prefer to create effects for each specific unit so as to have more control over the total caps.
    Last edited by kugkings; July 29, 2015 at 02:45 PM.

  5. #5

    Default Re: How to Create a Dynamic Unit Cap

    @ Kugkings

    I've tried to set it for 1 unit of each type but I can recruit 7 Ashis to start then 2 more when I get a new city.
    Step 6 will give me a text on vanilla with a blank/white card how do assign a card for it?

    http://prntscr.com/jtji1j
    http://prntscr.com/jtji1j
    http://prntscr.com/jtjj50
    http://prntscr.com/jtjjrz
    http://prntscr.com/jtjkbf

    What am I missing?
    Thanks

  6. #6

    Default Re: How to Create a Dynamic Unit Cap

    I worked it out.

    I had to enter nothing in effects.loc
    and I had to have it set to 1 in units

  7. #7

    Default Re: How to Create a Dynamic Unit Cap

    I have also managed to make lots of new effects using this tutorial.

    I managed to get seperate upkeep and recuitment costs for ashigarus and seperate armour upgrades for samurai and ashigaru.

    Thanks Kugkings

  8. #8

    Default Re: How to Create a Dynamic Unit Cap

    Hi, I'm not sure to understand all here,

    What I need is a very simple answer (not how to make it):

    Is it possible to link a unit limit to the number of buildings a player have?

    For example, player can have 1 samurai katana per dojo (and eventually, improving the dojo increase that number) ?

    Thanks for answering!

Posting Permissions

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