Page 21 of 21 FirstFirst ... 1112131415161718192021
Results 401 to 409 of 409

Thread: How to create a custom unit - a complete guide

  1. #401
    Alwyn's Avatar Frothy Goodness
    Content Director Patrician Citizen

    Join Date
    Feb 2014
    Location
    United Kingdom
    Posts
    9,340

    Default Re: How to create a custom unit - a complete guide

    Hi Guardiadel Rey, here's a short answer, followed by a long explanation:-

    - Make a modded pack file containing a building_units_allowed_table, a units_table and a units_to_exclusive_factions_table.
    - Rename the database tables (for example, building_units_allowed could become cossacks_building_units_allowed or new_building_units_allowed)
    - Make the modded pack file a 'movie' file (so that it will activate automatically when the file is in the data folder, without needing a mod manager or user script file to activate it).
    - In the building_units_allowed_table and units_table, delete all rows in those database tables except for the rows which refer to the cossack_infantry unit.
    - In the units_to_exclusive_factions_table, delete every row except for the row which contains 'poland_lithuania' and 'cossack_infantry'. In that row, change 'False' to True'.
    (This answer assumes that you already know how to do these things. In case you do not know, I will provide a more detailed answer below).

    Put the modded pack file (the mod) in your data folder and start a campaign as Poland-Lithuania. To recruit a unit, we need to satisfy all of the conditions. These include:-
    - Constructing a building which can recruit the unit
    - Owning a region which has the resource code needed to recruit the unit
    - For some units, having the correct government type

    The building requirement should not be a problem, as Cossack Infantry can be recruited with low-tier buildings. Cossack Infantry can only be recruited in Russia, so Poland-Lithuania will need to capture or negotiate to acquire one or more regions in Russia. Cossack Infantry can only be recruited by an absolute monarchy and Poland-Lithuania begins the game as a constitutional monarchy, so you will need to change your government. (Perhaps this was the problem which you experienced? Initially, I made a mod to allow Poland-Lithuania to recruit Cossack Infantry and took a region from Russia. When I could not recruit Cossacks there, I thought that the mod had failed to work. Perhaps you did the same thing? However, the reason why I could not recruit Cossacks was that Poland-Lithuania was a constitutional monarchy.)

    If you would like to change Poland-Lithuania into an absolute monarchy, you need to keep public order for the upper class below zero in your capital for three consecutive turns. To do this, set taxes for the upper classes to maximum. You will probably also need to destroy building(s) which promote public order/happiness and move all military units out of your capital region. (If you want to keep all of your regions, then, if other regions suffer riots, you will need to exempt them from taxes). After three turns, a civil war will begin. You will be asked to choose a side - the government or the rebels. Choose the rebels. You will be given a rebel army. Use this army to capture your capital. When you have done this, you should be able to recruit Cossack Infantry as Poland-Lithuania in regions which belonged to Russia at the start of the game.

    Demonstration Mod
    I made a demonstration mod which you can download using the link below. The mod file is called cossacks_for_poland_mod.

    How to install

    Download the file
    Unzip it (it was zipped with the free software 7zip, which you can find with an online search)
    Put it in your data folder. On my PC, this is C:/ProgramFiles(x86)/Steam/steamapps/common/Empire Total War/data.

    That's it - you do not need to use a mod manager or user script file to activate the mod.

    How to uninstall

    Simply cut and paste the cossacks_for_poland _mod file from your data folder to somewhere else.

    Thanks and permissions

    Thanks to the creators of Pack File Manager 1.5.9 (which was used to extract the database tables from copies of the vanilla files, to create an empty pack file, to add the extracted database tables to the pack file and to turn the pack file into a 'movie' type file) and Pack File Manager 1.5.3 (a component of husserlTW's EasyDB tool), which was used to edit the database tables. Thanks to the modding community for your advice and support. Anyone who would like to make your own mod by editing this file or who would like to add this file to your mod has my permission to do so; if you use my work, please mention this in the description of your mod.


    A more detailed explanation of how to make the mod

    I recommend doing the following steps slowly, saving your work at each stage. Even a trivial typing error, such as calling the unit cossacks_infantry instead of cossack_infantry in one entry in the database, can prevent the mod from working, cause the game to crash or (if you are unlucky) 'break' the game, preventing it from working unless you delete it and reinstall it.

    1. Get the tools you need.

    You will need Pack File Manager (PFM). Many different versions are available in the mod workshops for different TW games. I only use PFM 1.5.9 to create blank new mod files, to extract files from copies of the vanilla patch.pack files, to add those files to the blank mod files which I have made and to change the mod file so that it is a 'movie' type file. I do not use PFM 1.5.9 to edit any database tables (when I tried doing this, the mods did not always work). PFM 1.5.9 is available from the Napoleon Total War Mod Workshop, in the 'Tools, Tutorials and Resources' section, via a link from erasmus777's guide to making a mod.

    I normally use PFM 1.5.3 for all of the editing of the entries in database tables (the only exception is when PFM 1.5.3 crashes when trying to edit a particular table - in that case, I use PFM 3.5.1, which is (or, at least, was) available in the Mod Workshop for Rome II. PFM 1.5.3 is a component of husserlTW's EasyDB tool. There is a link to EasyDB from this post. I was not able to use EasyDB itself to make mods which worked (which is probably my fault, not the fault of husserlTW). When you open EasyDB, you can then open PFM 1.5.3 and, in my experience, that works.

    2. Create modding folders

    I have an 'ETW Modding Tools' folder which contains various versions of PFM and an 'ETW Modding Files' folder which contains
    - a 'vanilla files' folder with copies of the (unmodified) main.pack and patch.pack, patch2.pack, patch3.pack, patch4.pack and patch5.pack files. I use copies of the game files, not the original files, to avoid accidentally editing the files which I use to play the game.
    - a folder for each mod

    3. Create a blank modded pack file

    (a) I open PFM 1.5.9. I use early versions of PFM, which were made using earlier versions of Windows, so I start PFM in compatibility mode:-

    - Right-click on PackFileManager.exe
    - Select 'Troubleshoot compatibility'
    - Select 'Try recommended settings'
    - Select 'Test the program'
    - A message pops up asking if I want to allow a program from an unknown publisher to make changes to my computer. I click 'Yes.'
    - PFM then opens.
    - With older versions of PFM, PFM asks me to select a directory which the packed files will be relative to. Initially, I thought that I should choose the data folder, but I was wrong. The folder to choose is whichever folder on your computer will contain the mod file, while you are working on it.
    (If you use the latest version of PFM, you probably will not need to do this).

    (b) Select 'New' to create an empty pack file.

    (c) I right-click on the new pack file and select 'movie'. A movie file activates automatically, so you do not need a mod manager or user script file to activate the mod. If you will use a mod manager or user script file, you can skip this step.

    4. Extract the database tables you need

    Save your empty pack file. Close it.

    Open the vanilla game files to find the latest version of each database table. If there is a copy of the database in patch5.pack, extract that table. It look in patch4.pack, then patch3, pack, then patch2.pack, then patch.pack, then main.pack. Right-click on the database tables and select 'Extract file'.

    5. Add the extracted database tables to the empty pack file which you made earlier

    Open the empty pack file.

    Right-click on it. Select 'Add file' and select the first of the database tables which you extracted. Repeat this step until you have added all of the database tables you need.

    6. Rename the database tables

    For example, you could rename building_units_allowed to cossacks_building_units_allowed or new_building_units_allowed. To do this, simply click on the name of the database table and enter the new name (as if you were renaming a file on your computer's hard drive).

    7. Edit the database tables

    (a) Remove the entries which you do not need. To unlock cossack_infantry, you only need the rows which relate to that unit. To delete rows in PFM, I click on the blank space on the left hand side of a row - the row is now highlighted. I use the 'Delete' key to delete the row. You can highlight multiple rows to delete many rows at once.

    (b) These are the specific changes which I made to allow poland_lithuania to recruit cossack_infantry:
    - In the building_units_allowed_table and units_table, delete all rows in those database tables except for the rows which refer to the cossack_infantry unit.
    - In the units_to_exclusive_factions_table, delete all entries except for the entry which contains the entries 'poland_lithuania', 'cossack_infantry' and 'False'. Change 'False' to 'True'. (To find this row, if you click on the column which contains units, then the units should be listed in alphabetical order.)

    I edit database tables using PFM 1.5.3, which is a component of husserlTW's EasyDB tool. To use it, I do the following:-

    - Right-click on EasyDB_ETW.exe
    - Select 'Troubleshoot compatibility'
    - Select 'Try recommended settings'
    - Select 'Test the program'
    - A message pops up asking if I want to allow a program from an unknown publisher to make changes to my computer. I click 'Yes.'
    - EasyDB then opens. Along the tabs at the top of the EasyDB screen, there is a 'PFM' tab. I click on that.
    - PFM 1.5.3 then starts. PFM asks me to select a directory, which the packed files will be relative to. Initially, I thought that I should choose the data folder, but I was wrong. The folder to choose is whichever folder on your computer will contain the mod file, while you are working on it.
    - I then open the mod file, edit it and save it.

    (c) Save your work. I saved the file many times during step 7.

    8. Test your mod.

    Put it in your data folder. On my PC, this is C:/ProgramFiles(x86)/Steam/steamapps/common/Empire Total War/data.
    Start the campaign.
    Attached Files Attached Files
    Last edited by Alwyn; September 10, 2016 at 03:08 AM.

  2. #402
    Alwyn's Avatar Frothy Goodness
    Content Director Patrician Citizen

    Join Date
    Feb 2014
    Location
    United Kingdom
    Posts
    9,340

    Default Re: How to create a custom unit - a complete guide

    Part 2 (see the post above for part 1)

    I wrote above that Cossack Infantry can only be recruited by an absolute monarchy. Perhaps, playing as Poland-Lithuania, you would like to be able to recruit Cossack Infantry while remaining a constitutional monarchy?

    If so, it is possible to make a mod to unlock Cossack Infantry for Poland-Lithuania and to allow any government type to recruit this unit.

    In addition to the steps above, you would need to include a units_to_gov_types_permissions_table. Rename this table, like the others (for example, it could be cossacks_gov_types_permissions). Delete all rows except for the rows which relate to cossack_infantry. For the rows which relate to constitutional monarch and republic, replace 'non_reinforceable' with 'enabled'. I believe that you also need to add a different number in each row, in the column in between the government type and the 'enabled' (or other entry). If I understand this correctly, the only thing that matters is that this number is not used by the units_to_gov_types_permissions_table for any other unit - you can choose any number.

    Below, you can download a demonstration mod which unlocks Cossack Infantry for Poland-Lithuania and which allows any government type to recruit this unit. Installation instructions are in the previous post, above. This file is called cossacks_for_poland_allgov.

    (You would still need to capture or negotiate for a region in Russia to recruit this unit. If you want Poland-Lithuania to be able to recruit this unit from the start, find the region ID entry for cossack_infantry in the units_table. By default, this is russia_home_regions. You could change this to europe (to allow this unit to be recruited in any region in Europe) or poland_home_regions (to allow this unit to be recruited in regions which belong to Poland-Lithuania, but not Russian regions, at the start).
    Attached Files Attached Files

  3. #403

    Default Re: How to create a custom unit - a complete guide

    Dude I cant thank you enough. This mod is exactly what I wanted but I couldnt figure out how do it myself. Its funny because some days ago I thought like: "It would be super awesome if there is a mod to enable that but I doubt that anyone would make a mod just for me..." thanks again!

  4. #404

    Default Re: How to create a custom unit - a complete guide

    good job @Alwyn as a noob on that subject I appreciate that guide too,will give it a try when time allows me

  5. #405

    Default Re: How to create a custom unit - a complete guide

    I can't find dlc units ?

  6. #406

    Default Re: How to create a custom unit - a complete guide

    Hey Alwyn, I'm trying to download your sample mod file, but it's blocking it under suspicion of malware. Chrome isn't giving me an option to download anyways... any ideas? (Edge downloads them just fine and I'm now working with Minors1a!

    I got some stuff going finally. Unfortunately, when I add files from the DB, I get the error "DB header type unknown".

    I don't get that error when I'm opening an existing pack file, but the pack file I need is missing the parts of the db that I need to modify, so I need to re-import the relevant sections.

    Just following the directions above. I extracted the patch5.pack to bring out the DB. Not sure what's wrong with my process so far. PFM 1.12 doesn't play nicely with those files at all. I can modify data in the native.pack that I'm using as a learning tool. I've tried adding all the DB files that were extracted from patch5.pack and as soon as I click on the entry, it says DB Heater type unknown.

    I haven't been able to find anything in google either. There are a few old mentions of the problem in other languages, but my Italian is weak and my Russian is non-existent. Cyrillic Illiterate.
    Last edited by eschelar; March 08, 2017 at 09:10 AM.

  7. #407

    Default Re: How to create a custom unit - a complete guide

    anyone know what is wrong with my custom unit. game crashes everytime i click on the faction my unit is categorized under.
    brewsters_rangers.rar

  8. #408

    Default Re: How to create a custom unit - a complete guide

    hello, i am a neewbi at modding, but there is a problem i cannot solve, i downloaded the pfm4.1.2, but every time i try to open the model.pack and access a unit texture it appears as mesh not DDS or TGA so i can't open or modify with photoshop
    could anyone help with this matter ??

  9. #409

    Default Re: How to create a custom unit - a complete guide


    " Nothing is true, everything is permitted "

Posting Permissions

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