Page 1 of 1

Battlefield-like Knife weapon?

Posted: Wed Jul 02, 2014 7:16 pm
by LRKfm946
I had a pretty cool idea today that I thought was worth sharing and pursuing. It'd be really cool if there could be a knife in swbf2 that functioned like knives in Battlefield 3/4. Here are my ideas so far:

I'd like to at least have the take-down attack when you attack the opponent from behind. This would have to be a separate weapon from the normal knife slash attack. I'm thinking the takedown would have to be based on force choke (to keep the victim in place), with custom animations for both the attacker and the victim similar to the video. The alternative would be to make it an emitter ordinance or force push and specify the custom animation as the death animation (if that's possible). Getting it to only work when attacking the opponent from behind will get really complicated, and might not be possible. That'd require some serious math and LUA work.

Then of course there could be the normal slash attack, which I know has been done before, but I feel like there hasn't been a really refined and authentic looking animation for it (that I've seen).
We could also bring in blocking against both attacks, but that could get complicated with all the bugs with blocking in the game.

I know it's pretty ambitious, and may not even be possible. But I'd totally be down to collaborate with anyone else who's interested and see if we can come up with something.

Re: Battlefield-like Knife weapon?

Posted: Wed Jul 02, 2014 8:56 pm
by razac920
It should be possible to determine the angle between the way two characters are facing through LUA (I can help you with that), but then you would still have to use LUA scripting to recreate the weapon effects you want (I don't know much about animations)

Re: Battlefield-like Knife weapon?

Posted: Wed Jul 02, 2014 10:36 pm
by LRKfm946
Yeah that's what I was thinking: if they're looking in the same direction, give or take 20 or so degrees, then the takedown will work. The only problem is preventing it from executing if they're not. It could be as simple as giving the victim a ridiculous health regen or someting so the attack does no damage, but the attacker would still perform the animation and they would be stuck in place for however long the animation lasts (assuming we use force choke as the template and prevent all movement).

Another question: can .combos only be used with melee weapons?

Re: Battlefield-like Knife weapon?

Posted: Wed Jul 02, 2014 11:52 pm
by TWINKEYRUNAWAY
Looks very interesting. Wish you luck on seeing this project come to fruitation. Maybe the force choke odf could aid in this?

Re: Battlefield-like Knife weapon?

Posted: Thu Jul 03, 2014 2:50 am
by MileHighGuy
LRKfm946 wrote: Another question: can .combos only be used with melee weapons?
Yes, but they come from the hp_fire of the weapon which can be anywhere, you can specify the length and width of the edge, and you can attach explosions

Re: Battlefield-like Knife weapon?

Posted: Thu Jul 03, 2014 1:47 pm
by LRKfm946
After looking at the choke odf, I think I can just use that and change a couple things and it'll function correctly as far as how the attack itself executes. At that point all it needs is the custom anims.

Then of course there's still the issue of making only work when coming up behind someone. Another idea I had is letting it work all the time, and if the opponent also has a knife, they can block the attack when facing the attacker, buuuut nothing can prevent you from being choked except slow run, which is obviously not an option here... :x thoughts?