Results 1 to 8 of 8

Thread: Creating Units that have Two Weapons

  1. #1

    Icon5 Creating Units that have Two Weapons

    I can't find anything about this using keyword searches, so I am putting my question here:

    I would like to know if anyone has ever designed a working unit that, for example, would throw their spear and then draw a sword or axe and fight on with their sword and shield?

    Are all infantry units really confined to using just one hand weapon (besides the pikeman unit that drops his pike and draws a sword)?

    I would really like to arm sergeants with both a spear and a sword since this was historically correct. Most every soldier had a secondary weapon.

    Any advice or info about this would be greatly appreciated!

    Thanks!

  2. #2
    alhoon's Avatar Comes Rei Militaris
    Moderator Emeritus

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,758

    Default Re: Creating Units that have Two Weapons

    If Pikemen can do it, then other units can. But... can pikemen do it?
    I think only Cavalry does it. But again, if Cavalry does it, then other units can. It may be difficult or easy, but it is certainly possible.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  3. #3
    Callistonian's Avatar Ducenarius
    Join Date
    May 2018
    Location
    somewhere in the continental US
    Posts
    944

    Default Re: Creating Units that have Two Weapons

    Yes, this is quite common in vanilla and all mods. Ranged units are the obvious example - they use a primary weapon until running out of ammo and then switch to a secondary melee attack. Then you also have pike units in vanilla that switch to swords. And spear/lance cavalry units that switch to swords or etc. after the charge.

    If you check export_descr_units, you will see how primary and secondary attacks are defined. Then if you check the mesh group comments on the unit's models, you will see primaryactive0 used for the primary attack and secondaryactive0 used for the secondary attack. These tags determine which mesh groups show up during which attack modes. Your unit will also need animations for both both attack modes (see bmdb). I recommend finding a unit with primary and secondary attacks (like the vanilla pikemen) and copying the setup.

    The issue with giving a unit melee attacks for both primary and secondary is that they tend to switch to their secondary way too early. This is why most mods removed the secondary attack from pike units - in vanilla, the entire unit draws their swords as soon as they're in contact with the enemy, loses their pike bonus, and gets slaughtered because their sword attack is terrible. Spear/lance cavalry are the same way but it's more acceptable since they will take out their spears again for another charge (if they have enough time between charges) and they get their primary attack bonuses at the moment of impact.

  4. #4

    Default Re: Creating Units that have Two Weapons

    Quote Originally Posted by Callistonian View Post
    Yes, this is quite common in vanilla and all mods. Ranged units are the obvious example - they use a primary weapon until running out of ammo and then switch to a secondary melee attack. Then you also have pike units in vanilla that switch to swords. And spear/lance cavalry units that switch to swords or etc. after the charge.

    If you check export_descr_units, you will see how primary and secondary attacks are defined. Then if you check the mesh group comments on the unit's models, you will see primaryactive0 used for the primary attack and secondaryactive0 used for the secondary attack. These tags determine which mesh groups show up during which attack modes. Your unit will also need animations for both both attack modes (see bmdb). I recommend finding a unit with primary and secondary attacks (like the vanilla pikemen) and copying the setup.

    The issue with giving a unit melee attacks for both primary and secondary is that they tend to switch to their secondary way too early. This is why most mods removed the secondary attack from pike units - in vanilla, the entire unit draws their swords as soon as they're in contact with the enemy, loses their pike bonus, and gets slaughtered because their sword attack is terrible. Spear/lance cavalry are the same way but it's more acceptable since they will take out their spears again for another charge (if they have enough time between charges) and they get their primary attack bonuses at the moment of impact.
    Thanks. Yes, I was already aware of the Pikemen unit and cavalry, but I wanted to use spearmen instead. I did notice that pikemen drop their pikes right after impact, so I don't allow them to have secondary weapons. I just wanted to make sergeants a more all purpose unit than it is by giving them a sword, which they would use after absorbing the impact of a charge.

    I don't know how to do that and was hoping someone had posted a tutorial somewhere.

    Are you suggesting I could copy the basic set-up animations of, let's say, scots pike militia, and then turn them into spearmen with shields and swords?

    If so, that would be pretty cool.

  5. #5
    Callistonian's Avatar Ducenarius
    Join Date
    May 2018
    Location
    somewhere in the continental US
    Posts
    944

    Default Re: Creating Units that have Two Weapons

    Yes, copying the format of vanilla pike units, there are three things you must edit:

    1) set up the primary and secondary attacks in EDU (and any other data there like unit category, attributes, etc. that may change as a result of your edits).
    2) set up the primary and secondary skeletons in battle_models.modeldb (bmdb), again copy how they did it for vanilla pikes, if you've never edited bmdb before, there are plenty of guides on this on TWC
    3) edit the unit model(s) to set up the primaryactive0 and secondaryactive0 mesh groups. Iirc, the vanilla Sergeants unit starts with spear and shield, all you would need to do is port in a sword model and add its texture to the Sergeant's textures (body or attachments texture, doesn't matter), UV it, assign it to the hand joint, set the comment to secondaryactive0, and you're good to go. There are a few YouTube videos that cover similar processes.

    You may also want to change the unit description in export_units.txt. And I would also suggest testing that your data is set up correctly such that the unit uses their spears at all, I'm guessing you want them to at least use spears to absorb a charge. You could set their spear attack to something absurdly large (I think 63 is the max) and test with and without the absurd value to see if it ever works and if so how long it lasts.

  6. #6
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Creating Units that have Two Weapons

    Yes it's very much possible, but it's definitely not without its quirks. In my late Roman mod I had late Roman units having a spear as primary weapon and a sword as a secondary weapon so I have quite some experience with this setup.

    With this weapon setup the unit will start with a spear. When you attack a unit, the soldiers of that unit will pause for a moment, then switches to their swords and then charges the enemy. Once contact is made with the enemy the unit will tend to switch back to spears again. Also, expect your officers to be among the first to die, because they only have one weapon and will charge immediately towards the enemy while the rest of the unit is busy switching weapons.

    I hope this helps a bit.
    Last edited by Razor; February 01, 2022 at 05:29 PM.

  7. #7

    Default Re: Creating Units that have Two Weapons

    Quote Originally Posted by Razor View Post
    Yes it's very much possible, but it's definitely not without its quirks. In my late Roman mod I had late Roman units having a spear as primary weapon and a sword as a secondary weapon so I have quite some experience with this setup.

    With this weapon setup the unit will start with a spear. When you attack a unit, the soldiers of that unit will pause for a moment, then switches to their swords and then charges the enemy. Once contact is made with the enemy the unit will tend to switch back to spears again. Also, expect your officers to be among the first to die, because they only have one weapon and will charge immediately towards the enemy while the rest of the unit is busy switching weapons.

    I hope this helps a bit.
    Thanks for responding. Lol... that doesn't sound too promising. Why can't the unit just throw the spear and then draw swords? I'm mainly interested in that kind of unit since most sergeants had a side arm, although many spearmen did not since they were too poor for even a side arm other than a knife.

    The problem with pikemen is they drop their pikes after the cavalry charge and then try to fight them with swords and of course get massacred because knights on horseback swinging swords down on them cannot be countered except by holding a pike wall.

    I remember that MTW1 had a unit called Catalans who would throw their spear and then charge with swords, which I thought was really neat. I wanted mainly to give sergeants, who acted as castle garrison troops, both a spear and a sword along with their shield.

  8. #8

    Default Re: Creating Units that have Two Weapons

    Quote Originally Posted by Callistonian View Post
    Yes, copying the format of vanilla pike units, there are three things you must edit:

    1) set up the primary and secondary attacks in EDU (and any other data there like unit category, attributes, etc. that may change as a result of your edits).
    2) set up the primary and secondary skeletons in battle_models.modeldb (bmdb), again copy how they did it for vanilla pikes, if you've never edited bmdb before, there are plenty of guides on this on TWC
    3) edit the unit model(s) to set up the primaryactive0 and secondaryactive0 mesh groups. Iirc, the vanilla Sergeants unit starts with spear and shield, all you would need to do is port in a sword model and add its texture to the Sergeant's textures (body or attachments texture, doesn't matter), UV it, assign it to the hand joint, set the comment to secondaryactive0, and you're good to go. There are a few YouTube videos that cover similar processes.

    You may also want to change the unit description in export_units.txt. And I would also suggest testing that your data is set up correctly such that the unit uses their spears at all, I'm guessing you want them to at least use spears to absorb a charge. You could set their spear attack to something absurdly large (I think 63 is the max) and test with and without the absurd value to see if it ever works and if so how long it lasts.
    I'm slowly working my way through this. Thank you very much! A lot of it I have done, but not the graphics part, so that's going to be the main obstacle. I hope I can do it though.

Tags for this Thread

Posting Permissions

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