• Welcome to Freedom Reborn Archive.
 

Scripting Wrestling Grapple/Hold and Throw Attacks

Started by TaskMasterX, September 02, 2007, 08:22:35 AM

Previous topic - Next topic

TaskMasterX

I eventually grew tired of simulating wrestling holds with Melee Stasis attacks and seeing the target held but then seeing the attacker begin running around or attacking with another power when he's suppose to be not doing anything except holding onto the target. So I've tried to simulate this with some scripting and have it about 90% working.

Here's how it works:
This is a state swap which you can swap for Stasis, Blind, etc. When the attack is successful, both the target and the attacker are held in place. You'll want to choose an animation for this that resembles a wrestling hold move because the animation will be locked while the hold is taking place. Every two seconds the target has a chance to break free. If the hold is maintained, then damage is dealt to the target equal to twice the attacker's strength. The hold can also be broken if the attacker is takes damage or is put under a Primary State, like Mental Blanked. To prevent this attack from being too uber, I made it so the hold is automatically broken after 6 seconds. So, damage will be dealt to the target no more than 3 times in one attack. I tested it out using a ranged attack and it works well. So, this could be used for Mr. Fantastic's elongated arm tangle attack, too.
I also created an attribute called wrestler that increases the chance to maintain the hold or to escape holds. Mr. Fantastic could use this attribute to simulate his ability to hold targets stronger than him and to escape these holds.

catwhowalksbyhimself

Hmm--probably the most original FFX additions I've seen recently.

Perhaps you could try an underpowered knockback at the end--something set with scripting so low that they don't actually get knocked back.

Perhaps using a dummy power with no animation would work as well.

BentonGrey

Very cool idea TMX, I see great potential for lots of characters.

Epimethee

Nice idea TMX. :)

I think you can fix the "can't unlock" bug by adding after you unlock call the following line:
RegTimer('landonfeet', 0.1, 0, char)

A suggestion: Since resistances and passive defences should ideally be taken into account, maybe you could add a call to getCrushResistanceValue() to get a damage multiplier. Also, it might be safer to employ FFX_ApplyDamage() rather than use Trigger_Damage() directly.

TaskMasterX

Thanks for the suggestions, Cat and Ep. I tried both of your ideas for the 'unlock bug' but neither worked. Grasping at straws, I added in lines to re-enable M25's AI, which seems to work. Strange :huh:.

I updated the above code with the fix and Ep's suggestions for incorporating the target's resistances vs. crushing damage and applying damage. Any more ideas for improvement are welcomed, of course.

Xenolith

Golly.  This is a mighty fine idea.  Really useful for Anaconda and those types who's whol schtick is grappling.  I can't wait to use it.  Would you mind telling me where that code goes?  Its been a while since I've messed with it.  Thanks.

Outcast

Hey, great new attribute!  :thumbup: Glad you were able to solve the bug. Any screenshots as to get an idea on how the animation looks like? :rolleyes:  Too bad i'm still stuck with FF1. :banghead:


TaskMasterX

Quote from: Xenolith on September 24, 2007, 08:01:35 PM
Would you mind telling me where that code goes?  Its been a while since I've messed with it.  Thanks.
The first, large block of code and the last block of code both go into the ffx.py file. The single line in the middle goes into the FFX_TO_TYPES list in the ffxdefault.py file.

Quote from: Outcast on September 24, 2007, 08:50:32 PM
Any screenshots as to get an idea on how the animation looks like?
The animation can be any one you choose for the power you're swapping. There aren't many wrestling animations for meshes because wrestling couldn't be simulated very well in the game. Maybe this might be a catalyst for the meshers and hexers in this fine community to start adding wrestling animations to meshes!! :D
Anyway, here's a couple of pics I took of She-Hulk grabbing hold of a couple of AIM agents. You need to get as close as possible to get the best look. For the AI  to use it just add a line like:
"TMelee('grapple',time=2.2,maxdist=20)",
so the AI will only use the Grapple attack when they're really close to the target.



She-Hulk and the AIM agent are locked in this position until the grapple is broken or released.

crocodamon


Xenolith

I'm surprised Tommyboy hasn't cranked out an animation for male_basic and female_basic yet.   :)  This seems like something he'd really like.

Would it be possible to stack or swap damage types?  For example, could I swap out crushing damage with electrical damage or heat damage?

TaskMasterX

Hmmm. I think you could create a power that does electrical or heat damage and then use Stun as the swap for the grapple. That might work. Or if the character has the Overheated or ShortCircuited Attribute, then they'll cause heat or electrical damage just by being next to the target while grappling them.

M25

Would it be possible to use Trigger_Force to make it look like one character is throwing the other after they have been grappled?

TaskMasterX

Nice idea, M25. Although, there is the Throw State Swap that you could use while you are grappling. I'll try it out and see what looks and works best.

Xenolith

Wow, what if you could apply the throw object animation with this, too.  That would be pretty sweet.

electro

Thanks alot for this cool new attribute - Now i'm going to ring your neck for making me again go threw hundreds of hero files & add it :blink:

TaskMasterX


yell0w_lantern

should I try to make a 'grapple' animation? If so, what should it look like?

electro

It should look alot like The Ant melee 2 - I can use The Ant keys in most of my male basic meshes so maybe this animation can be hexed onto some better male_basic keys for a quick fix :blink:


Xenolith

Nice.  I can see that animation being skoped into a bunch of different male_basic sets.

TaskMasterX

The animation probably shouldn't have the character bend over so much. The flailing animation you see the AIM Agent using in the pics above is, I believe, the animation all targets will be in while the hold is in effect. It may look like the grappler has buried his head in the target stomach! The grappler should stand more erect, like She-Hulk.

yell0w_lantern

I can make a grapple animation fairly easily and have done so for the 3R version of male_basic then taken it over to the 3R version of female basic and a 3R version of female_longhair (my desktop can only export for 3R at this time) so I don't know if the animation can be skoped between FF1 and FF2 meshes or not. If not, I can eventually do a grapple for FF1 on my laptop.

I have included the bip and the animation notes for nocapeman/male_basic.

Find them here:

http://games.groups.yahoo.com/group/crazy_lantern_2nd_floor

TaskMasterX

That looks great, YL! I can't wait to try it out! Thanks!

yell0w_lantern

Okay, I've exported a set for FF1: male_hulking_brute.
Check the above link.

Xenolith

For some reason I can't get the female grapples to work in  :ffvstr:.  The male and male hulking seem to work.  Is it just me?  Also, I'm not sure how to get the melee attack to use this animation.  Should I rename grapple to melee_grapple or something like that?  I've tried this, but it doesn't recognize the grapple animation as a melee attack.

yell0w_lantern

I may have forgotten to put a note key in the grapple loop for contact. It probably won't come up on the animation menu without it. Try EZ Hero by Alexx to assign the animation - that should do the trick.
I assumed since TM has using a flailing animation that it didn't need a contact.

TM, how do you set the animation? What if I put the contact note key in the start grapple and animation - could you set the grapple loop animation to play if he hits?

TaskMasterX

I think that the contact needs to be there for the animation. The grapple is triggered by a successful "hit" so I would think that needs to be in the animation. Not only that, but it would make it easier to select the animation in-game while making the power. Tomorrow, I should be able to test the animation to see how it looks when it gets locked and adjust anything if need be. Although, if Xeno is able to test it before me, I'd be interested to hear the results.

yell0w_lantern

I can put in an extra note key that's no problem.
So it should be in the grapple loop then?

Xenolith

I can test it tonight if you have time to repost it, YL.  I'll probably go off-line around 9:30PM CST.  I think it would make more sense if the contact was in the loop, but I don't know for sure.

Volsung

Great! I always thought that Freedom force needed those kind of melee moves!
What you guys can do with python is impressive!

Slightly off topic.
Do you think that throwing moves could be possible aswell?
Of course, that's unthinkable to impose a specific animation (for the sufferer) on every existing models.

But, let's imagine we give to a specific character a 'circle throw' move.
http://www.judosport.net/technik/tomoenage.JPG
You know that, in character nifs, there's many mesh objects hidden for collision and selection use.

Would it be possible to 'link' an opponent that undergo a successfull throw to an hidden object, so this object could dictate to the model an appropriate translation and orientation so the sufferer could move according to the assailant throw?

(my english is a bit rusty)

catwhowalksbyhimself

Ummm--FFX already has a throwing state swap, which works quite well and looks pretty good.  Has since the very first version I ever downloaded, which was over 3 years ago.