Unit Creation Template

If you liked this item, please rate it up on Steam Workshop page.

Author: Avila

Last revision: 10 Jun, 2016 at 10:12 UTC

File size: 6.14 KB

On Steam Workshop

Description:

Inspired by what Sebidee did for Rome 2, this is a hollowed out and renamed version of our Night Gobbos Expansion. I made this to help other people learn how to add units to the game, it’s surprisingly easy once you get the hang of it!

Now, a short guide on using this template:

Open 2 PFM windows, one for reference, one for working. Then, rename every single table in the "db" categories, such as the table in "buildings_units_allowed" to something of your own design, but do keep the "__core" part, (I think :P). Example could be "Orc_axes__core" if you’re doing a single unit of orc axeboys. The tables can easily be named exactly the same, it shouldn’t conflict. Adding a prefix like this means the files you’re making will load alongside the vanilla ones, not on top of, so to speak.

Now, every entry in the tables that says "Template" should be replaced with your unit’s name. This is NOT what they’ll be called in-game, it’s a handle, so to speak. All I did to this mod was delete all units but one, and rename everything to "template". So, to keep going with the same example, you could switch "Template" in each table with "Orc_Axeboys".

Now, you should have no more entries called "Template". For example, the entry "wh_main_unit_long_text_Template" in the column "historical_description_text" should now say "wh_main_unit_long_text_Orc_Axes", and so forth. Eradicate those "Template"s!

Combat stats are found in land_units_tables, while most campaign stats are in main_units_tables. Main_units_tables has a column called "land_unit", and it is important that that column says the EXACT same thing as the "key" column of "land_units_tables". This is what links your campaign stats to your battle stats, so to speak.

UPDATE: Forgot to mention something, the unique indexes. Two numbers in this template need to be changed to a number that’s totally unique to your unit, and NOT the same between the two numbers. Right now, both of those indexes say "9000", which means the unit won’t work until you change them to two seperate, and unique, numbers. The first one is located in "buildings_units_allowed", and is called "unknown3". The second one is simply called "unique_index", and is located in "main_units_tables".

Now, you need a variant. This is the "skin" of your unit, it decides how they will look. You see the Template_base.variantmeshdefinition and Template.variantmeshdefinition, located in "variantmeshes" -> "variantmeshdefinitions"? Those two files, added together, give a guy who looks like an Empire Spear & Shieldman.

You can open and edit variantmeshdefinitions as texts in the PFM. Left-click the variant you want to change, then right-click it, and choose "open as text". Now, open up "variants.pack" with the secondary PFM you opened earlier. Here, in "variantmeshes" -> "variantmeshdefinitions", is every single variant of the vanilla game. You can copy and paste lines of text from a vanilla variant to yours, by using ctrl + c and ctrl + v, and through that, edit your unit’s looks.

An explanation of bases: A base is a variantmesh that makes massproduction of units easier. Alone, a base i just a guy with a helmet, pants, and a shirt, most of the time, anyways. You make another variant, and point it’s <SLOT name="body" > to the base you made, and then just add weapons. Bases don’t normally have weapons, or anything much really, it’s just the basic guy with no snizz. The snizz is added through the actual variant, not the base it uses.

I really hope I’m making sense, and good luck! 🙂

Will update this in the future with step-by-step instructions, but for now, I hope this can help some of you get started!

Happy modding!