Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: [TUTORIAL] How to Create a New Unit

  1. #1
    Mooncabbage's Avatar Ducenarius
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    990

    Default [TUTORIAL] How to Create a New Unit

    Right now this is a placeholder, I just finished working it out so I will write the proper tutorial tomorrow. I am posting this now so that anyone desperately stuck trying to figure it out can make use of my notes as well as my test mod, as a reference.

    What follows is a list of useful tables in the DB, and a brief summary of what they do. This table is not 100% complete, but covers probably 95% of what might be needed for a unit.
    db\armed_citizenry_unit_groups_tables\ << Add the unit here to allow it to be used in garrisons.
    db\armed_citizenry_units_to_unit_groups_junctions_tables\ << Points the Unit Group in armed_citizenry_unit_groups_tables to the actual unit.
    db\building_level_armed_citizenry_junctions_tables\ << What buildings provide the troop as a garrison.
    db\building_units_allowed_tables\ << What buildings allow the recruitment of this unit. You must include all the tiers at which it's available, not just the first.
    db\cdir_military_generator_unit_qualities_tables\ << Tells the game what type the unit is, and how good it is as an abstract value.
    db\faction_rebellion_units_junctions_tables\ << What factions can have this unit in rebellion armies.
    db\land_units_tables\ << Many of the core unit infos live here, including animations, weapons, audio, armour type, model and descriptions. Together with main_units_tables, this is the most important table.
    db\loading_screen_quotes_tables\ << If you want to add the unit to the loading screen quotes, this is where you supply the link to the accompanying image.
    db\loading_screen_quotes_to_units_tables\ << this links the unit to the above quote table.
    db\main_units_tables\ << Includes most of the Campaign/UI info for the unit, such as what porthole camera to use, the cost to recruit, the upkeep etc. Together with land_units_tables, this is the most important table.
    db\melee_weapons_tables\ << Here you define the actual effects of a new melee weapon. Note that this is _NOT_ to do with the cosmetics, which are unrelated to this table.
    db\missile_weapons_tables\ << Here you define a custom ranged weapon, and link it to it's projectile. This is important! 90% of the missile weapon is actually the projectile.
    db\projectiles_tables\ << This is where you define the effects of your custom ranged weapon defined in missile_weapons_tables.
    db\ui_unit_bullet_point_unit_overrides_tables\ << Here you link your unit to predefined bullet points. Note that these don't add any effects, and it's purely a UI element.
    db\unit_description_short_texts_tables\ << Here you point to your "short text", as defined in db\unit_description_short_texts.loc & .txt. I'm not sure how localisations work, it seems impossible to have two at once.
    db\unit_set_to_unit_junctions_tables\ << This table tells the game some basic information about what kind of unit you have, and how it relates to other effects. Kinda like tagging your unit with some flags for the game.
    db\unit_variants_tables\ << This table sets up the unit model variant, and the unit card.
    db\units_custom_battle_permissions_tables\ << Which factions are able to use your unit in a custom battle.
    db\units_to_groupings_military_permissions_tables\ << What factions can use this unit in the campaign game.
    db\variants_tables\ defines a variant in terms of it's variantmesh and it's lowlod variantmesh. Also seems to include a scale factor.

    variantmeshes\variantmeshdefinitions\***.variantmeshdefinition << Any mesh combo you want to use, especially important if you want to do a weapon edit.

    Below is a link for my WIP Empire State Troop Bowmen unit module. I provide it for use as a template when trying to figure out your own units.
    Empire Bowmen
    Last edited by Mooncabbage; June 05, 2016 at 08:23 AM. Reason: Formatting
    Not actually on the moon.

    Empire: Tactical Warfare Mod v1.0

  2. #2
    the_mango55's Avatar Comes Rei Militaris
    Citizen

    Join Date
    Oct 2004
    Location
    Raleigh, NC
    Posts
    20,753

    Default Re: [TUTORIAL] How to Create a New Unit

    You also need the Culture_to_battle_animation_tables table if you are adding a troop to a faction that doesn't have that animation. My unit of chaos dwarf thunderers wouldn't animate until I fixed that.
    ttt
    Adopted son of Lord Sephiroth, Youngest sibling of Pent uP Rage, Prarara the Great, Nerwen Carnesîr, TB666 and, Boudicca. In the great Family of the Black Prince

  3. #3

    Default Re: [TUTORIAL] How to Create a New Unit

    I am new to modding, and I wanted to say thanks for the great tutorial it has really helped.

    I do have a question though. I keep having a problem where my units are missing weapons. Everything else is working properly but the weapons are missing. I have played around with various setting but I can't seem to figure out where to fix this. I am not trying to add a new weapon, just give an existing weapon from one unit to another.

    Any suggestions on what I might be doing wrong?

  4. #4

    Default Re: [TUTORIAL] How to Create a New Unit

    I figured it out. One of the animation options for dwarfs does not work. The great axe + rifle one is broken, so if you select it the weapons bug out and appear underneath the map, even if you have the right variantmeshes. Thanks again for this thread though. Really saved me a lot of time to see how a functional mod is put together.

  5. #5
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    i want to add the dwarf gyrobombers to empire faction. Anyway, thanks!
    Last edited by THANGDACLAC; July 18, 2016 at 08:03 AM.

  6. #6
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    Quote Originally Posted by Karast View Post
    I am new to modding, and I wanted to say thanks for the great tutorial it has really helped.

    I do have a question though. I keep having a problem where my units are missing weapons. Everything else is working properly but the weapons are missing. I have played around with various setting but I can't seem to figure out where to fix this. I am not trying to add a new weapon, just give an existing weapon from one unit to another.

    Any suggestions on what I might be doing wrong?
    First of all backup you file, then open variants.pack\variantmeshdefinitions, choose and extract unit (by right click) which you want to edit. Then open it with notepad to edit (copy, paste) the weapons what you want. Good luck!
    - For example:
    emp_greatswords

    <VARIANT_MESH>
    <SLOT name="head" >...................
    WEAPONS HERE >>(copy and paste):
    </SLOT>
    <SLOT name="weapon_1" attach_point="be_prop_0" >
    <VARIANT_MESH model="VariantMeshes/wh_variantmodels/hu1/emp/emp_props/emp_greatswords_sword_2h_01.rigid_model_v2" >
    <META_DATA>audio_melee_weapon_type:sword</META_DATA></VARIANT_MESH>
    <VARIANT_MESH model="VariantMeshes/wh_variantmodels/hu1/emp/emp_props/emp_greatswords_sword_2h_02.rigid_model_v2" >
    <META_DATA>audio_melee_weapon_type:sword</META_DATA></VARIANT_MESH>
    <VARIANT_MESH model="VariantMeshes/wh_variantmodels/hu1/emp/emp_props/emp_greatswords_sword_2h_03.rigid_model_v2" >
    <META_DATA>audio_melee_weapon_type:sword</META_DATA></VARIANT_MESH>
    </SLOT>
    <SLOT name="weapon_2" attach_point="be_prop_1" />
    <SLOT name="shield" attach_point="be_prop_2" />
    <SLOT name="weapon_3" attach_point="be_prop_3" />
    <SLOT name="weapon_4" attach_point="be_prop_4" />
    <SLOT name="weapon_5" attach_point="be_prop_5" />
    Last edited by THANGDACLAC; June 10, 2016 at 09:26 PM.

  7. #7
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    Edit Swordsman to look like Karl Franz
    Last edited by THANGDACLAC; July 18, 2016 at 08:02 AM.

  8. #8
    SHREDDER's Avatar Creator CoW, TATW, WF&S
    Join Date
    Jul 2006
    Location
    Ukraine, Kiev
    Posts
    596

    Default Re: [TUTORIAL] How to Create a New Unit

    People - need help
    Added new unit (Kossars for Kislev).
    Now need make retexturing. But problem - how to prescribe the old model new textures?
    I start small - change the texture to one embodiment of heads.
    But where to register new tecture?
    Help.
    Last edited by SHREDDER; June 25, 2016 at 09:11 AM.
    3Dmodeller for Call of Warhammer Third Age With Fire and Sword 2 Hetmanat

    Bes
    t Ukrainian site and forum Sich TotalWarS totalwar.fun/board/

  9. #9
    SHREDDER's Avatar Creator CoW, TATW, WF&S
    Join Date
    Jul 2006
    Location
    Ukraine, Kiev
    Posts
    596

    Default Re: [TUTORIAL] How to Create a New Unit

    I tried to open *_head_03.rigid_model_v2 the hex editor and do there address textures - there you are...
    what am I doing wrong?

    3Dmodeller for Call of Warhammer Third Age With Fire and Sword 2 Hetmanat

    Bes
    t Ukrainian site and forum Sich TotalWarS totalwar.fun/board/

  10. #10
    SHREDDER's Avatar Creator CoW, TATW, WF&S
    Join Date
    Jul 2006
    Location
    Ukraine, Kiev
    Posts
    596

    Default Re: [TUTORIAL] How to Create a New Unit

    a mystery (((
    3Dmodeller for Call of Warhammer Third Age With Fire and Sword 2 Hetmanat

    Bes
    t Ukrainian site and forum Sich TotalWarS totalwar.fun/board/

  11. #11
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    Quote Originally Posted by SHREDDER View Post
    a mystery (((
    Yeah! it's a mystery. Where did you change it exactly, for examble: emp_greatswords_head_03.rigid_model_v2 or ...? So i can extract it to send you for replay that error one, Get it ?

  12. #12

    Default Re: [TUTORIAL] How to Create a New Unit

    I had my units working with their variant meshes, and I tried to remake my mod for the new patch, and everything is working except for the variants.

    I am trying to use the same working file from the previous mod. Could someone please eyeball this for me and tell me what I am doing wrong. The first time through I could not get it to work without the rifle in both weapon 3 and 4. Now it doesn't seem to be working at all no matter how I tweak it. I know I am missing something but I can't figure out what.

    Any help would be greatly appreciated!

    Spoiler Alert, click show to read: 
    <VARIANT_MESH>
    <SLOT name="body" >
    <VARIANT_MESH_REFERENCE definition="VariantMeshes/VariantMeshDefinitions/dwf_miners_base.VariantMeshDefinition" />
    </SLOT>
    <SLOT name="helmet" >
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_miners\head\dwf_miners_helmet_01.rigid_model_v2" />
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_miners\head\dwf_miners_helmet_02.rigid_model_v2" />
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_miners\head\dwf_miners_helmet_03.rigid_model_v2" />
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_miners\head\dwf_miners_helmet_04.rigid_model_v2" />
    </SLOT>
    <SLOT name="backpack" >
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_miners\head\dwf_miners_backpack.rigid_model_v2" />
    </SLOT>
    <SLOT name="weapon_1" attach_point="be_prop_0" >
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_props\dwf_miners_pickaxe_2h_01.rigid_model_v2" >
    <META_DATA>equipment</META_DATA> <META_DATA>audio_melee_weapon_type:axe</META_DATA></VARIANT_MESH>
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_props\dwf_miners_pickaxe_2h_02.rigid_model_v2" >
    <META_DATA>equipment</META_DATA> <META_DATA>audio_melee_weapon_type:axe</META_DATA></VARIANT_MESH>
    <VARIANT_MESH model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_props\dwf_miners_pickaxe_2h_03.rigid_model_v2" >
    <META_DATA>equipment</META_DATA> <META_DATA>audio_melee_weapon_type:axe</META_DATA></VARIANT_MESH>
    </SLOT>
    <SLOT name="shield" attach_point="be_prop_2" />
    <SLOT name="weapon_3" attach_point="be_prop_3" >
    <VARIANT_MESH model="VariantMeshes/wh_variantmodels/hu3/dwf/dwf_props/dwf_thunderers_rifle_2h_01.rigid_model_v2" imposter_model="VariantMeshes\wh_variantmodels\hu3\dwf\dwf_props\dwf_thunderers_rifle_2h_01.rigid_model_v2" />
    </SLOT>
    <SLOT name="weapon_4" attach_point="be_prop_4" >
    <VARIANT_MESH model="VariantMeshes/wh_variantmodels/hu3/dwf/dwf_props/dwf_thunderers_rifle_2h_01.rigid_model_v2" />
    </SLOT>
    <SLOT name="weapon_5" attach_point="be_prop_5" />
    </VARIANT_MESH>

  13. #13

    Default Re: [TUTORIAL] How to Create a New Unit

    Never mind figured it out! Nothing like having a fat fingered typo in the middle of a line to screw everything up!

  14. #14
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    Quote Originally Posted by Karast View Post
    I had my units working with their variant meshes, and I tried to remake my mod for the new patch, and everything is working except for the variants.

    I am trying to use the same working file from the previous mod. Could someone please eyeball this for me and tell me what I am doing wrong. The first time through I could not get it to work without the rifle in both weapon 3 and 4. Now it doesn't seem to be working at all no matter how I tweak it. I know I am missing something but I can't figure out what.

    Any help would be greatly appreciated!
    You can not use 2 hands for dwf_miners_pickaxe and delete shield.
    Last edited by THANGDACLAC; July 20, 2016 at 08:29 AM.

  15. #15

    Default Re: [TUTORIAL] How to Create a New Unit

    Yeah got it working. At least for custom battles and old saves. Right now I am trying to figure out why, it, and other unit mods are causing new campaigns to crash.

    At first I thought it was just mine, but after trying a few other mods, I get the same issue. Not sure if anyone else is having it.

  16. #16
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    Quote Originally Posted by Karast View Post
    Yeah got it working. At least for custom battles and old saves. Right now I am trying to figure out why, it, and other unit mods are causing new campaigns to crash.

    At first I thought it was just mine, but after trying a few other mods, I get the same issue. Not sure if anyone else is having it.
    I have upgrated steam tanks, crossbowmen(mod) and edited swordsman to look like Karl Franz and play it without any crash. I had finished victory and continue playing. I have edited these in data.pack directly, but i backed up it. This video is in campaign and gameplay.
    Staff Of Volans
    https://youtu.be/JT4CSSzWqTM
    Last edited by THANGDACLAC; July 01, 2016 at 11:34 AM.

  17. #17

    Default Re: [TUTORIAL] How to Create a New Unit

    Well after tinkering with it. It no longer crashes on a new campaign, but it does crash on end of turn. I think it might have something to do with the building_unit_allowed tables.

    Have you tried your mods on a new campaign? It seems to work fine on my old saves, which is odd.

  18. #18
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    If i will play a new campaign with other factions, so i'll have to mod again for which faction i'll choose. My version of TWH is 1.1.0 Build 10514.892912, i'm playing it not in old saves.
    Last edited by THANGDACLAC; July 11, 2016 at 06:50 AM.

  19. #19
    THANGDACLAC's Avatar Civis
    Join Date
    Oct 2008
    Location
    IN THIS GREAT MAYA
    Posts
    162

    Default Re: [TUTORIAL] How to Create a New Unit

    @Karast: At any time game will be updated and added some new units or some things to data.pack;variants.pack; models.pack...So, i will have to mod it again and again to avoid game crack.(ver 1.1 add Blood Knights and some things newer).

    I find another way to change units not modify in variants.pack(this causes game to crash).
    Last edited by THANGDACLAC; July 11, 2016 at 06:55 AM.

  20. #20

    Default Re: [TUTORIAL] How to Create a New Unit

    Can anyone help me please... i want to know how can i make that the AI chooses more often my units, or some custom units that i downloaded?

Page 1 of 2 12 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
  •