View Full Version : Creating a new weapon type?
OK, what I'd like to accomplish is equipping cavalry with lances that can only be used once, then left in the first poor dead bugger they charged down and they switch to swords. This is both more historically accurate, more realistic, and would go a long way towards balancing cavalry better IMO.
I tried giving them a javelin type weapon with range 1, but they refuse to charge, walking up to within range, then getting embroiled in melee. Once they finally got a shot off, CTD.
So, I would like to create a new weapon type, lance, that uses all the existing melee animations, but is an ammo based weapon with range 0. Any suggestions on how to go about this?
Monkwarrior
02-21-2005, 19:04
OK, what I'd like to accomplish is equipping cavalry with lances that can only be used once, then left in the first poor dead bugger they charged down and they switch to swords. This is both more historically accurate, more realistic, and would go a long way towards balancing cavalry better IMO.
I tried giving them a javelin type weapon with range 1, but they refuse to charge, walking up to within range, then getting embroiled in melee. Once they finally got a shot off, CTD.
So, I would like to create a new weapon type, lance, that uses all the existing melee animations, but is an ammo based weapon with range 0. Any suggestions on how to go about this?
As it is used only once, is the ammo=1 for this new weapon?
In this thread https://forums.totalwar.org/vb/showthread.php?t=42905 (see post 24) it is said that the minimum ammo for a javelin-type weapon is 2. Perhaps this is your CTD problem.
Cheers.
Good thought, Monk, and that may well be the CTD issue. However, the fact that they walk up to within range rather than charging makes me doubt if the whole javelin approach will ever work. I got a CTD when I set the range to zero, so that won't do it either.
I don't know enough of how the animations are tied to the units to try this, but I wondered if I could set the cav to be jav cav, then relace the firing animation with the charging animation from heavy cav. I'd have to set the jav range to match the distance at which the charge begins. Any tips on how to change the firing animation for one unit but not all units of that type?
Red Harvest
02-21-2005, 21:15
You will need to have the skeletons right for when they make the switch to secondary. (And some combinations appear to be impossible at present.) It looks pretty tough to me. However, you will need ammo of at least 2. A value of one is "right out" from what I've seen. Zero ammo = no ranged attack option, they show up with secondary weapon at the outset of battle.
I don't think range 0 is possible, they would have to be physically at the same center from what I can gather. Try 10. Even so this is going to cause some strange problems for sure, since you will probably have units on the flank firing toward some central point. Plus they will find it difficult to get set to do the firing sequence.
Depleting lances would be an interesting twist. Although to really implement it you need some percentage that break without any kills (probably at least half.) Similar could apply to spear and pike units of course...and this would even result in handing pikes forward I suspect.
Pila getting stuck in shields is another aspect. When a javelin or pila is blocked by a shield there would be some percentage chance that the shield would become unusable and be discarded by its owner.
As you can imagine this could get very complex in a hurry. (As would losing part of a chariot horse team or cav mount losses and fighting on foot--you will end up with individuals fighting on their own all over the place.)
After looking at the skeletons file, I thik I'll try adding the three missile animation lines from the fs_hc_javelin skeleton to the fs_hc_spearman skeleton, but link to the spearman ready and thrust animations, with the distance tag identical to the existing spear distance. Set ammo to two and that leaves only the range question. If the missile release tag is set to the spear thrust anim, do I set the range to like 1 or 2? Or should I set the range equal to the charge distance in hopes that they actually will charge?
As for the other complexities, if I can get the cav to only pull one extra lance out of their bags of holding I'll consider it a victory. If you can come up with a way to do half of what you suggested, RH, I'll adopt you into my pantheon as a minor deity :)
Sundjata Keita
02-21-2005, 21:47
Had a go at tackling this problem. I tried to edit the cavalry auxilia to charge in and jab a spear in so I changed the "throw" and "javelin" things to "simple" and "melee" in the export_descr_unit file for cavalry auxilia. Probably been done before but anyway.
When put into battle and asked to charge they ran in with spears up as if going to throw javelins but instead kept them there and charged the enemy. Then they ran back up the hill they had just charged down as if ready to fire another lot of javelins (actually charging instead of firing). Then they charged back down the hill towards the enemy without me telling them to attack again. Then they routed.
I thought if you change the animation of the auxilia raising the javelin above their head to one where it is like a normal cavalrys spear then they would have a limited amount of charges. However if minimum ammo is two then they will have to be allowed two charges. Then do javilineers who have run out of ammo automatically go to secondary weapon? If they do then that is pretty much problem sorted. ~:)
Plus you won't have to judge charging distance or anything. I have not tested this extensively though so I don't know if they will be allowed unlimited charges.
Sundjata Keita
02-21-2005, 22:25
After further testing I have noticed after the first charge and then the strange half run away when they come back they don't attack again and just sit there while they get slaughtered. ~:confused:
Well, my tests aren't going very well either. I tried the skeleton mods I outlined in my last post, and agin had the problme of the cav walking up to engagement range, then CTD. No help from show_err. Afraid I've overreached my modding capabilites :help:
Red Harvest
02-21-2005, 23:38
Show_err finds errors in syntax and such when it parses the text files. In that case it exits to the desktop because it found an error. But the CTD's are caused by page faults during execution. Somewhere deep in the code there is some sort of conflict/discontinuity being introduced by the mod.
Yeah, I suspect that deep in the bowels of the beast the types of animations allowed for a skeleton are linked to the weapon type used by the unit. The spearman skeleton just didn't support the archery related animation tags, and the weapon types seem to be hardcoded to trigger certain animation tags. I tried using ballistas, since they don't require the thrown attribute like javs do, but I think it went looking for a loading animation as soon as they came in range and CTD'd also. I think I've been beaten. :embarassed:
Red, you bum, why didn't you tell me earlier you'd created the new arrow2 weapon type by modding d_projectile_new? I just read your thread on disabling flaming arrows. Now I'm wondering if playing around in that file with pilum2 or javelin2 might get me somewhere.
Legionario
02-22-2005, 23:17
the weapon types seem to be hardcoded to trigger certain animation tags.
:embarassed: I'm afraid so.....certain combinations are simply not possible... :furious3:
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.