SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: Giftheck on November 16, 2026, 02:07:44 PM

Title: New discovery: basic melee combo system
Post by: Giftheck on November 16, 2026, 02:07:44 PM
First off, special thanks to Dark_Phantom for finding this.

I always wondered why I couldn't use 'FireAnim' commands with the melee weapon class. Turns out there is a good reason for it.

Inside all lightsaber ODFs, you will have seen the following line:

SwingTime           = "0.7 0.5 imp_weap_lightsabre"
I wasn't sure what the first two values were for, though the third is clearly what sound to play when the melee weapon is swung. So I asked Phantom. He explained that the first value was the duration of the swing in seconds. In this example, it takes 0.7 seconds for the swing to complete. The second is damageTime - when the weapon actually deals damage to whatever it strikes. This doesn't function entirely - regardless of what you put here, the damageTime is always half the SwingTime, with one caveat: if this value is set to a negative value, it instead results in no damage being dealt at all. This might be useful for creating 'deflect' versions of lightsaber weapons.

Phantom told me that you could define three SwingTime entries in a melee weapon to create variant swings, each with individual values (if you wanted the second swing to last half as long as the first, and have a different swing sound, for instance). This intrigued me, because the game's lightsaber animation bank only has two fire animation - shoot and shoot3, and shoot3 is the Force Power animation, so I thought that, surely, this was deprecated.

I decided to give it a test anyway, added a second saber swing animation to the lightsaber animation bank in the shoot2 slot, and define a second SwingTime entry in the ODF, beneath the first.

It only went and worked.

The way it works is that each 'swing' has a specific 'SwingTime' entry in the ODF for the melee weapon. You can have up to three SwingTime entries in your ODF - one for each of the maximum amount of fire animations an animation bank can have (shoot, shoot2, shoot3). The weapon will then randomly choose one of the swing animations to play (one for each SwingTime entry). You do not have to have three SwingTime entries - one will play just the fire animation, two will choose fire or fire2 randomly, and 3 will choose randomly from all three.

You can see a demonstration of it here:


(NOTE: this uses Phantom's BF1MemExt, which also allows me to define damage for melee weapons, which is why the vibrosword strike doesn't take out a unit in one hit like a lightsaber does)

You can use this with the gamorrean_animation bank to bypass the fact that the lightsaber bank already has a shoot3, or you can settle for two maximum swings if you'd rather stick with the lightsaber bank, and obviously we don't (yet) have the ability to add more animation banks. Nevertheless, this makes using the melee weapon more interesting.
EhPortal 1.34 © 2026, WebDev