Page 1 of 12 1234567891011 ... LastLast
Results 1 to 20 of 234

Thread: How to make a custom unit with PFM

  1. #1

    Default How to make a custom unit with PFM

    [I will add some images of the process and expand some parts of the tutorial once the forum starts to behave, I lost part of my post two times before I managed to post it ]

    Hey, guys!! Since a lot of people are wondering about this and I have made some progress, I will try to guide you through the process. English is not my native language and I have never done a tutorial before so bear with me.

    Before we begin you should read daniu's Warscape Modding Primer, especially if you have not meddled with warscape and PFM before.

    So, let's start

    1) What you will need.

    From the data_rome2.pack the absolutely necessary db tables you will need to extract and add to your mod are the following:

    buildings_units_allowed
    --> Which buildings are required to recruit your unit.
    land_units --> Contains important unit stats will, be discussed below.
    land_units_to_units_ability_junctions --> What abilities the unit has.
    main_land_units --> More unit stuff such as cap limits, recruitment times, types etc.
    naval_units --> same as three rows above but for naval (add this only if you want to add naval units)
    naval_units_to_units_ability_junctions --> same as three rows above but for naval (add this only if you want to add naval units)
    unit_set_to_units_junctions --> In which unit groups the unit belongs to.
    unit_variants --> Which variantmeshes, UI icons etc the unit uses.
    units_custom_battle_permissions --> Which factions can use the unit in custom battles.
    units_to_groupings_military_permissions --> Which factions can use the unit.

    Other tables you might need depending on what you want to do with your new unit:
    Spoiler Alert, click show to read: 
    armed_citizenry_units_to_unit_groups_junctions --> set the unit up as a garrison unit in buildings.
    commander_military_unit_permissions --> make the unit available as a general's bodyguard in the campaign.
    unit_required_technology_junction_tables --> this will add a technology requirement for the recruitment of a unit on top of the building one.
    Note: Units with this will not be availabe as general's bodyguard in the campaign until the technology is researched. After this is done they will be even if you do not have the building required as the rest of general's bodyguard units.
    variant --> if your unit uses custom variantmeshdefinitions, you need to list them here.


    From the local_en.pack you will need some text\db files, namely:
    land_units.loc --> all land units are listed here. If a unit is not here it won't be in the game.
    naval_units.loc --> guess what?? same for naval units
    unit_description_short_texts.loc --> a mini customized description of the unit. If you make one you will need to add the unit_description_short_texts db table and add its entry there.
    unit_description_historical_texts.loc --> a more detailed description of a unit or a class of units. If you make one you will need to add the unit_description_historical_texts db table and add its entry there.

    For custom unit textures: (I will expand this one with another example soon)
    Spoiler Alert, click show to read: 
    Finally if you want to create a totally new appearance for your unit you will need to go to models_rome2.pack variantmeshes\variantmeshdefinitions find a unit that looks as closely as possible to your own extract that and use Jacklusted's guide to edit it. After you are done add it to your mod.pack and list its name in the variant_tables db.


    2) A simple example

    So we will create a basic Periokoi cavarly unit for the spartan faction that is so popular right now.

    First we extract all the db files from part 1, except from those in the spoilers and those for the naval units, and add them to our mod.
    Note: On all tables click on top of the unit/unit key etc column so they will be placed in alphabetical order. This will make your life a lot easier since you can then fight units fast by their national prefix.


    Now we will go to our first db table, that would be buildings_units_allowed. There are four improtant columns here: building (the building which is required to recruit the unit), unit (the key of your unit), xp ( the starting xp of the unit) and key (a unique number that indentifies each row).To make our life easier we will find a line that has the building we need and click clone row. Then in the unit field we will type the key of our unit, lets make it Gre_Periokoi_ Cav.
    Our unit will be recruited from the second level of main military buildings and above. Search among the greek units to find a suitable building entry and use it. We have to repeat the process for all the buildings in the chain. We will leave the starting xp to zero except for the hero shrine building. Finally we will set the keys to each row. What I usually do is quickly find the largest first digid and go some thousands upwards.


    Now to the second table, land_units. The order of this table's columns is a little messy. Move the bottom par right until you find the unit key and sort it out again alphabetically. Many things to see here and most columns do something. I will skip those with stat values as they are pretty much self-explanatory and will briefly describe some of the other to the best of my ability.
    We will find a unit with the general qualities we want and clone its row. Gre_Light_Cav seems like a good choice. We change the key to Gre_Periokoi_Cav and tweak the stat values to our liking.

    Some more specific info:
    Spoiler Alert, click show to read: 

    If you want to add custom unit description short and historical texts in the appropriate columns you will first need to create them in the corresponding .loc files in the text\db directory. Then you will need to add them to unit_description_short and historical db tables. Only then you can use them here on your custom unit.
    The armor rating of the unit is now determined by its type and the type of the shield. So to calculate a units armor you will need to refer to unit_shields and unit_armor db tables. Similarly the damage is determined by the weapon (melee_weapons db table) and probably the melee attack value of a unit.
    The man_entity column presets some things, like hit-points and the height of a unit (heights of specific units can be individually be changed in the variant_units table).Again there is a db table that explains the different man_entities but I do not remember its name and staring for five minutes into the db list produced zero results.
    Primary melee and missile weapons have a trick. If a units variantmesh does not contain them, the units will appear emty handed on the battlefield. Same with shields. The attribute_group also adds some abilites that can be seen analytically in unit_attributes_to_groups_junction_tables.



    Third table, land_units_to_units_abilities_junction is one of the easiest tables. Simply we will clone the rows with the abilities we want and paste our unit key. Let's give our low level cavalry unit the diamond formation.


    Fourth table is main_land units. The second most tiresome table but still easy compared to land_units. Things that can be done here is set recruitment limits, time and costs. We will find the Gre_Light_Cav and clone it then proceed to make our changes. Here we will put our unit key to both land_unit and unit columns.
    Spoiler Alert, click show to read: 
    Things to notice: (will be expanded)Land units that will be used as marines need to have two entries. One with the is_naval column true.Unit weight categories can be seen in units_weight table.



    Fifth table is unit_set_to_unit_junctions. Again this is straight forward. We will find the sets are unit belongs to, clone the rows and paste our key.Our Periokoi caralry will need cavalry_units_hellenic and melee_units_spear. Check other units to get an idea of which units go where.(units_sets table contains the available sets)


    For now skip variant_units and go to units_custom_battle_permissions. Again things are pretty easy. We will find the entry of a spartan unit, clone it and change the key to Gre_Periokoi_Cav.NOTE: Units that are recruitable both normally and as general's bodyguard need to entries here one with true and one with false in that column.


    Second last table, units_to_groupings_military_permissions. Another easy table. We are getting spoiled!!! Just copy a spartan unit and paste in our key.


    Now to the final db table, unit_variants. Here we can set our units variantmeshes and unit cards, as well as change its predetermined from the man_entiry column height. For this expample we will use variantmeshes and unit cards that are already in the game, cause you are probably tired and possibly frustrated or bored by now and want to end this. I know I am frustrated cause the forum ate my post and I had to re-write some stuff. Once more we will copy the Gre_Light_Cav unit, leave its unit card and variant untouched and change the unit and name columns to Gre_Periokoi_Cav.

    That's it!!! We are done!!! ...With the db tables. I am joking we are almost done here .

    Now we will go to text\db and open land_units.loc
    We will add a new row and write exactly the text of a vanilla entry: land_units_onscreen_name_Gre_Periokoi_Cav. In the localized string entry we will put our units in-game name. Lets name it Periokoi Cavalry!! Yeah, that is so unique!!!


    Time to save the pack. Go to the postprocess menu and click rename all. Use any prefix you like. Then again from the postprocess menu click minimize db files. During those to operations PFM might seem to freeze but that is normal. It will add the prefix optimized_ to you mods name.
    Alright let's test the pack. Place it in your ROME II data folder, the run Mod Manager, select it and run the game.
    That is believe. I hope I did not tire you. Please let me know of any mistakes so I can correct them or inform me on things to add.


    Infinite credits to daniu for PFM and all the people who worked for the schema files. Also to .Mitch. for his great Mod_Manager.
    Last edited by blackheartz; October 29, 2013 at 07:25 AM.

  2. #2
    General K's Avatar Libertus
    Join Date
    Apr 2010
    Location
    Great Britian, Scotland
    Posts
    57

    Default Re: How to make a custom unit with PFM

    You couldn't have picked a better time for this my friend. Was just doing this myself but couldn't get custom battle to show my unit properly.

    EDIT: Managed to fix it, i forgot t
    o re-name vanilla entry. Always make a silly mistake. Anyway good guide for those not familiar to the Modding world. Should get people up and going if unsure.
    Last edited by General K; September 14, 2013 at 06:29 PM.
    " Nemo me impune lacessit"
    No One Provokes Me With Impunity

  3. #3

    Default Re: How to make a custom unit with PFM

    whats jack lusted guide to edit it?

    ------CONAN TRAILER--------
    RomeII Realistic Heights mod
    Arcani
    I S S G A R D
    Creator of Ran no Jidai mod
    Creator of Res Gestae
    Original Creator of severall add ons on RTW from grass to textures and Roman Legions
    Oblivion Modder- DUNE creator
    Fallout 3 Modder
    2005-2006 Best modder , skinner , modeler awards winner.
    actually modding skyrim [/SIZE]

  4. #4

    Default Re: How to make a custom unit with PFM

    Well it is not exactly a guide but he explains it quite well here: http://www.twcenter.net/forums/showt...initions-files. I will update the tutorial with more info on this at some point.

  5. #5

    Default Re: How to make a custom unit with PFM

    question. certain tables you list here are ones that do not seem to open for me, like the land_unit_abilities tab. unit_variants are another table that does not seem to want to open for me. any ideas on how to fix that?

  6. #6
    Foederatus
    Join Date
    Apr 2011
    Location
    Fort Richardson, AK
    Posts
    31

    Default Re: How to make a custom unit with PFM

    Do you have the latest schemas?

  7. #7

    Default Re: How to make a custom unit with PFM

    Quote Originally Posted by Cacciato View Post
    Do you have the latest schemas?
    EDIT: never mind. I found the latest schemas. I have the tables now. Thanks for your help!
    Last edited by Fewrfreyut; September 14, 2013 at 10:37 PM.

  8. #8
    Foederatus
    Join Date
    Apr 2011
    Location
    Fort Richardson, AK
    Posts
    31

    Default Re: How to make a custom unit with PFM

    No problem man, glad you got it.

  9. #9

    Default Re: How to make a custom unit with PFM

    Having a problem with step 1 of Step 2, making a new column in the data base of the buildings_units_allowed file, I'm using Pack Manger to do this, and it's not working it seems. Is there another tool that can work on this.
    Pray for Pastor Saeed, and here is a link to sign a petition for his release: http://beheardproject.com/saeed#sign

    I believe in Jesus Christ our Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.

    "I am the Way, the Truth, and The Life..." (John 14:6) Yeshua HaMashiach
    http://khouse.org/




  10. #10

    Default Re: How to make a custom unit with PFM

    new question. the .loc files. How can I edit them in the pfm? Unless I'm supposed to not try to extract the .loc, but instead edit them within the local_en_rome2.pack file?
    Last edited by Fewrfreyut; September 14, 2013 at 11:01 PM.

  11. #11
    Foederatus
    Join Date
    Apr 2011
    Location
    Fort Richardson, AK
    Posts
    31

    Default Re: How to make a custom unit with PFM

    @Man of West Gondor: To clarify, you mean a new row right? I don't think there's any reason to be making a new column. You should just select a row and clone it, replacing the previous unit info with the one you're creating/editing.

    @Fewrferyut: I had to extract them to edit them.

  12. #12

    Default Re: How to make a custom unit with PFM

    Quote Originally Posted by Cacciato View Post

    @Fewrferyut: I had to extract them to edit them.
    ok I've done that, but I can't seem to import them into my mod. I can however add the line directly into the land_units.loc file within the vanilla pack. Would that work or would that cause conflicts?

  13. #13
    Foederatus
    Join Date
    Apr 2011
    Location
    Fort Richardson, AK
    Posts
    31

    Default Re: How to make a custom unit with PFM

    You can edit the vanilla packs if you like. I've edited a lot of mine, I just make sure to keep an untouched copy separately in case there's an issue.

  14. #14

    Default Re: How to make a custom unit with PFM

    Quote Originally Posted by Cacciato View Post
    You can edit the vanilla packs if you like. I've edited a lot of mine, I just make sure to keep an untouched copy separately in case there's an issue.
    yes I just tested and it works. My mod works, my unit is officially in the game. Now all I have is one final question. How can I copy a variantmesh file from the models pack? I seek to alter the aesthetics of my unit without tampering with the vanilla source.

  15. #15

    Default Re: How to make a custom unit with PFM

    I created a Carthaginian archer unit. It currently uses the greek archer variant mesh. I want to give it different visual in-game armour without altering the greek archer appearance. How does one clone a variant mesh?

  16. #16

    Default Re: How to make a custom unit with PFM

    aha! I think I got it. You have to click add and then file, rather than trying to import the file as a tsv.

  17. #17

    Default Re: How to make a custom unit with PFM

    @ Cacciato: Thank you for clearing that up! ok I see So it just replaces it got it. But what are the Digits he speaks about what colim are they found in and how do you change it?
    Last edited by Man of West Gondor; September 15, 2013 at 12:37 AM.
    Pray for Pastor Saeed, and here is a link to sign a petition for his release: http://beheardproject.com/saeed#sign

    I believe in Jesus Christ our Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.

    "I am the Way, the Truth, and The Life..." (John 14:6) Yeshua HaMashiach
    http://khouse.org/




  18. #18

    Default Re: How to make a custom unit with PFM

    Thanks! This is one way to help other more enthusiastic and skillful modders complete their projects, and with your guide it'll be possible for me too!

    All the best,

    TWS

  19. #19

    Default Re: How to make a custom unit with PFM

    Good stuff! I'll add this in Rome 2 editor to create units easily. + rep! (if forum permits so...) Edit: do you change the Unique Index id in main table?
    Last edited by husserlTW; September 15, 2013 at 04:24 AM.




  20. #20

    Default Re: How to make a custom unit with PFM

    Quote Originally Posted by husserlTW View Post
    Good stuff! I'll add this in Rome 2 editor to create units easily. + rep! (if forum permits so...) Edit: do you change the Unique Index id in main table?
    Thanks for the commend!! Yes the unique index in main_units needs to be changed. Two rows cannot have the same index number.

Page 1 of 12 1234567891011 ... LastLast

Posting Permissions

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