Results 1 to 2 of 2

Thread: How to properly edit a database, maximizing compatibility?

  1. #1

    Default How to properly edit a database, maximizing compatibility?

    Currently, I'm starting out small. I want to remove the trails from arrows, guns, and throwing axes. Easy enough, just got to set the model paths for their entries in projectile_displays to empty.

    But the guides are a mess. The youtube tutorials are long-winded, unscripted, do a bunch of irrelevant stuff, don't cover proper modding practices, and are about 30 minutes long. That's horrible. On the other hand, the written tutorials are equally pish; conflicting information, and "to draw an owl, draw an owl" instructions. E.g: https://www.twcenter.net/forums/show...mbly-Kit-Guide and https://steamcommunity.com/sharedfil.../?id=702343155

    The written tutorials recommend exporting the database as an .xml, youtube tutorials say to export as raw data. Neither state how to actually rename tables and have specific rows override the original tables, in order to make the mod compatible with other mods by just changing specific rows.

    How do I do that?

  2. #2
    Steph's Avatar Maréchal de France
    Patrician Artifex

    Join Date
    Apr 2010
    Location
    Pont de l'Arn, France
    Posts
    8,493

    Default Re: How to properly edit a database, maximizing compatibility?

    About the tools :

    1- Use RPFM. The best tool to edit table.
    2- Create a new empty pack.
    3- Right click on the left table. Select the option "Add File from pack". Select data.pack from CA (that's where most of the db files are located). Select the tables you need, and close the Add file pannel. The tables are now on the left tree view.
    4- Right click on a table and use the rename command to rename it.
    5- When you click on a table, you see the content on the right pannel. From there, It's easy to edit line, insert line, add lines, delete lines, clone them...

    You don't need the AssKit most of the time. It can be useful for two things:
    - Global Search; if you want to find in what tables an entry could be used.
    - Some tooltiip: sometimes, the Asskit displays some information about a column or an entry to explain a little what it is used for. But you don't have it everytime.

    However, once you get used to the tables, you don't actually need the AssKit for this.

    The case where you NEED the AssKit is if you have to edit the SartPos 'the campaign map)/

    RPFM is very convenient, with many functions (including a very welcome reference checker that put in red data with a broken reference. Create a weapon name "MyWeapon". In the land_units_table, for the Weapon, type "MyWeapno" it will detect the typo and put that in red.

    However, if you want to do some mass editign, RPFM can be a little too tedious. For this, you can in RPFM do a right clikc on the right pannel, export the table as a tsv file, edit it with Excel (where you can more easily filter, insert, replace, etc). And then you can import the changes back.

    About tables and row:

    - When a table has the same name as another table it replaces it completly. So if you have Main_units\__data, you add that to your pack and you remove a line it WILL crash, since you removed completly a unit but it is used as reference in many tables. In some cases you have to do this. For exemple, the building_unit_allowed table lists what units are available for each building. If you want to have a unit available at level 2 instead of 1, you do'nt have a choice, you need to name your table "__data", and remove the line for this unit at level_1. Keeping the table named "_data" is also named "coring the table", and you should use it only if you don't have a choice, since it is very bad for compatibility.

    - If you rename a table, then it will be consider as a modification of an existing table. Add Main_units\__data, rename it to Main_units\__MyMod, the table will be a modification of the Main_units table: this greatly reduce compatibility issue. Note that you can have several tables under the same folder. You can have Main_units\__MyMod_part, Main_units\__MyMod_part2, etc.

    - With a renamed table
    -- If a line is NOT included, then the base table is used instead (so no change)
    -- If a line is included, and also included in the base table, it replaces the line (overwrite it)
    -- If a line is included, and not included in the base table, it adds the line.

    So, if in Main_units\__data, you have Unit1 with a cost of 10 and Unit2 with a cost of 20, and you create Main_units\__MyMod, with Unit1 with a cost of 15, Unit3 with a cost of 25:
    - Unit1 exists in __data and __MyMod: MyMod replaces it, the cost is 15.
    - Unit2 doesn't exists in __MyMod : __data is used instead (no replace), cost is 20.
    - Unit3 exists in mm_Mod but not __data: this is a new unit cost 25.

    To simplify updating your mod, and maximize compatibility, it is recommended to only keep the lines you really want to change or add. Try to delete all the lines you don't change at all. It's easy to add them again if needed anyway.

    However, as you can see a renamed table allows adding a new line, or overwriting an existing line, but not deleting a line!

    That should cover most of the basics.
    Last edited by Steph; November 18, 2019 at 02:58 AM.

Posting Permissions

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