• 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

stumpy

Quote from: yell0w_lantern on March 03, 2008, 01:55:08 PMArgh! I don't remember which version of FFX I'm running!  :banghead:

You should be able to open your script.log and see a line that looks something like
Starting ffx.py v. 3.2.0 build 11; branch = Gold / Release

TaskMasterX

I updated the zip file with ffxdefault.py and also updated the header of ffx.py to show the correct version/build of this Mod.

There's a few other things that I forgot to mention:
1. The Melee Grapple can also use different attack types (Physical, Mental, Mystical, etc.) just like the Ranged Grapple.
This feature is something I really like in these swaps. It allows us to create different type of "stasis" attacks without having to use the single, mystical-based Stasis provided by the game to simulate every kind of grapple/hold/stasis/net attack. Also, the Strength vs. Stasis/Freeze option in FFXCC would allow characters with exceptional Strength break every Stasis and Freeze attack, while these grapple-type state swaps will use the correct resistance of the target to determine if they can break the hold.

2. I included the code for the Wrestler Attribute. It gives +2 to Strength for breaking or maintaining ONLY Physical-type Grapples and Ranged Grapples. You'll need to add it into FFEdit.

3. I mentioned the Mesh Size chart for Throwing but never posted it.
# Mesh Size Options:
#
# tiny (1ft) = 0.6 (male_tiny)
# dwarf (4ft) = 0.8 (male_dwarf)
# mansize (6ft) = 1 (male_basic, male_cape, female_basic, female_longhair, male_muscular_tall, etc.)
# hulking (8ft) = 1.3 (male_hulking, male_hulking_brute, Male_Titan, etc.)
# giant_10ft = 1.6 (Giant-Man_II_Gren)
# giant_12ft = 1.8 (Giant-Man_Gren and a male_basic mesh using TommyBoy's male_basic 12ft Giant Keyframes)
# giant_15ft = 2 (Goliath_III_Gren, goliath_giant_t, goliath_giant_alpha,tv_giant_15ft Keyframes)
# giant_18ft = 2.2 (goliath_titan_alpha, Male_Titan2, male_basic mesh using TommyBoy's male_basic 18ft Giant KFs)
# giant_20ft = 2.5 (goliath_titan)
# giant_25ft = 2.7 (goliath_huge_t, tv_giant_25ft Keyframes)
# giant_30ft = 3 (male_basic mesh using TommyBoy's male_basic 30ft Giant KFs)
# giant_50ft = 6 (male_basic_giant)
# giant_60ft = 8 (male_basic mesh using TommyBoy's male_basic 60ft Giant KFs)
# giant_120ft = 30 (male_basic mesh using TommyBoy's male_basic 120ft Giant KFs)

The first thing is just a generic name I gave each Mesh Size. The number is the actual Mesh Size you put in the customization and in parentheses are the examples of some of the meshes which belong to that Mesh Size. This chart is also at the bottom of the ffxcustom2.py file.

Here are some examples of customizing these Swaps in ffxcustom2.py:
## Explosive Tangle Wire
FFX_EXPLOSIVETANGLE_CUSTOM=[
["default","etwire","effect_ffx_tanglewire",5],
["types","aExplosion","OTangle FX","iHold Strength"],
["blacklash","etwire1","effect_ffx_tanglewire",5],
]

Here, Blacklash is using an explosion power from FFEdit called etwire1 as the explosion that triggers on the target. The name of the FX loop that plays on the target is called effect_ffx_tanglewire, and the Strength of the hold is a 5. (Target's with a 5 Strength will have a 50% chance to break the tangle before the explosion.)

### Tangle
FFX_TANGLE_CUSTOM=[
["default","effect_ffx_tanglenet",5],
["types","OTangle FX","iHold Strength"],
["avengers hawkeye","effect_ffx_tanglenet1",5],
]

Hawkeye is using effect_ffx_tanglenet1 as the FX loop that plays on the target and 5 is the Hold Strength.

### Grapple
FFX_GRAPPLE_CUSTOM=[
["default","","Yes",0,"Yes"],
["types","OFX","PUse Current Strength","iHold Strength","PDamage"],
["thing","","Yes",0,"Yes"],
["mentalblock","effect_mental_sparks","No",7,"No"],
]

The Thing isn't using any FX loop for his wrestling grapple. He is using his Strength as the Hold Strength, so the Hold Strength should be 0. This Grapple also inflicts damage, which will equal to twice his Strength.
The second, example shows MentalBlock is using the effect_mental_sparks FX loop. He isn't using his Strength as the Hold Strength, but rather assigning the Hold Strength the value of 7. And this Grapple inflicts no damage. This grapple is suppose to be a mental grapple so would be swapped for Blank, or Rage and would use the target's resistance vs. Mental attacks to determine if they can break the Hold Strength of 7.

### Ranged Grapple
FFX_RANGEGRAPPLE_CUSTOM=[
["default","effect_ffx_tanglewire","Yes",0,"No"],
["types","OFX","PUse Current Strength","iHold Strength","PDamage"],
["wonder woman","effect_ffx_tanglelasso","No",9,"No"],
["mr fantastic","effect_ffx_tanglearm1","Yes",0,"Yes"],
]

The first example shows Wonder Woman using the effect_ffx_tanglelasso FX loop. She isn't using her Strenght as the Hold Strength, but rather the Hold Strength of the Lasso, which is 9. And the grapple causes no damage.
Next, Mr. Fantastic, is using the effect_ffx_tanglearm1 FX loop and is also using his Strength as the Hold Strength, so the Hold Strength should be 0. And damage is inflicted equal to twice his Strength.

### Throw2
FFX_THROW2_CUSTOM=[
["default",1,2,1.5,""],
["types","iMesh Size","iPick Up Time","iLeave Hand Time","AThrow Animation"],
["avengers hulk-1960s",1.3,0.3,0.95,"throwperson"],
["avengers giant-man 12ft",1.8,2.8,0.2,""],
["avengers giant-man 16ft",2,2.9,0.2,""],
["avengers giant-man 22ft",2.5,2.8,0.4,""],
]

First example, Hulk's Mesh Size is 1.3 because I have him on the male_hulking_brute mesh. Next is the time in seconds to hold the target in front of Hulk before the target begins to lift into the air during the pickup_object animation. Next is the amount of time the taget is held over Hulk's head before they start shooting forward during the throw_object animation. Last, is the name of the "pickup-and-throw" animation if not using the default animations.
Next are the different variations of Giant-Man's height. First is the Mesh Size, then the target hold time in front of the thrower, then the hold time over the thrower's head, and finally the animation name. Giant-Man isn't using a special animation, so he'll use the mesh's default pickup_object and throw_object animations.
Remember that for most man-sized meshes, you won't have to customize this at all. Some may require you to adjust the Mesh Size only or maybe only the timing, or maybe both, or maybe none, depending on the mesh.
The original Throw Swap only has a Mesh Size customization.

Epimethee

Congrats TMX!

Quote from: yell0w_lantern on March 03, 2008, 01:55:08 PM
Argh! I don't remember which version of FFX I'm running!  :banghead:
Open your script.log file; you can check the info about the FFX version number at the beginning.

EDIT: Oops. Stumpy beat me to it.

TaskMasterX

I've been trying to perfect this grapple stuff, and I think I have it working really well with relation to the Physical-type attacks working correctly against Active Defenses. Using M25's code, I'm able to detect when the AI has an AD vs. Crushing active. But, this doesn't work with PC characters. I was able to get the FF Active Defense to be detected on both PC and AI characters, but only because it's a scripted attribute. But for PC characters that are using a built-in AD, what I did was spawn a ffx_tiggot, and have it fire off a power at the target that has no FX and does the damage I'm looking to block. The Power has No Mag. but has Extreme Stunning. To ensure that the target is stunned if the power isn't blocked by an AD, I used:
    Trigger_Power(name,char,'ffx_melee_crush_test','',10)
to multiply the Stunning by 10 and then if the target is stunned, the code removes it and continues to apply the effects of the grapple. It works great. I haven't had one instance where the target wasn't hit and stunned if they didn't have an appropriate AD up.

I also improved the locking and unlocking of the target.

One other issue (the final one - I hope) is dodging. Even though I set the grappler's Agility to 0 during the grapple, he still dodges some attacks. When he dodges, he gets locked in the Dodging animation and it looks silly. So, my question is:
Is there any way to script "No Dodging" like the Ponderous Attribute? If not, then I guess I'll need to cancel the Grapple if it detects a dodge animation.


Xenolith

Hi,

I played around with this last night, and I was wondering if a damage "text ballon" was supposed to show up when the grappled character took damage?  I wasn't sure if the Abomination (the grappler) was actually damaging Titania (the grappled) or not. 

More testing soon.

Thanks,
Bill

TaskMasterX

No, no damage bubbles. I'm using FFX_ApplyDamage() instead of just Trigger_Damage(), per Ep. I noticed it doesn't allow the bubbles, but it allows you to designate mental damage. You can see the damage inflicted by hovering the mouse over the target during the grapple.

I thought I found another approach to detecting AD on PC characters, but it's not working out how I expected. I discovered that if I'm controlling a character and then select the Start AI command on the character (I have M25's PLAYERAITOGGLE on) and the character comes under the control of M25's AI, I can use m25ai.HasActiveDefenseActive() on the character and properly detect the AD. I can then switch off the AI with the command, Stop AI, and m25ai.HasActiveDefenseActive() no longer works. So, I thought that if could have it automatically turn the AI on a PC character, check the AD, then turn the AI off again, I could detect the AD with less code than I'm using by Spawning a Tiggot (as mentioned in my previous post), but it's not working. I don't get any errors, it just isn't detecting the AD. Here's the code I was using:
        if Object_GetClass(char)&OC_CONTROLLABLE:
            AIEnabled=ffx.FFX_ObjectGetAttr(char,'playerAIEnabled')#I added this to m25ai.PlayerEnableAI() so I could detect if the PC was already under the control of the AI
            if not AIEnabled:
                print 'target is a PC'
                m25ai.PlayerEnableAI(char,char)
                if m25ai.HasActiveDefenceActive(char,damage_type,damage_mode):
                    print 'target has AD vs. Crushing!'
                else:
                    print 'target not protected!'
                    eTangleStart(char, source)
                m25ai.PlayerDisableAI(char,char)


I even tried increasing the time after m25ai.PlayerEnableAI(char,char) using RegTimer to run an event that has

if m25ai.HasActiveDefenceActive(char,damage_type,damage_mode):

up to 2 seconds after the AI is enabled, thinking that I wasn't giving it enough time to enable before detecting the AD, but that still didn't work. I even increased the time after the AD check is run before Disabling the AI and still no go. If it works using the command on a PC, shouldn't it work by using the code the command executes, too? I'm sure there's something I'm missing. I'm still happy with the "Spawn of the Tiggot" method, but I'd like to have less code if possible.

TaskMasterX

oh well, nevermind about detecting the AD by switching on and off the PC AI. I ended up moving this all to it's own grapple.py module, per the issue of the ffx.py file is getting cloe to it's size limit.

I found a way to detect the Dodging by adding a couple of new functions to the mlogreader.py. Now I'm able to cancel the the grapples when a dodge animation occurs! This also means I'm finished!! :thumbup: I'll whip up a couple of videos and post the !FINISHED! Grapple Mod in the Mods forum.

Xenolith

The grapple power works great, especially when I use a mesh that has the grapple animation YL created.  Its pretty fun to watch the Abomination squish a good guy 'til he KOs.  Just for fun, could you force your script to play the power up animation if the the grappled guy is KO'd due to damage sustained by the grapple?  I think it would look great, and just give the whole situation the spice it deserves.  Many thanks to you and YL for doing this.  I still haven't tried the other version yet, but since I know the function works I feel confident about the rest. 

The only trouble I've had is setting up Throw and Throw 2.  I don't get what the difference is between the two, and I can't get the AI to do it.  I know I have someting set up incorrectly.  Do I buy a ranged power and then swap stun to throw or throw2?  Sorry, its been a while since I've played around with this stuff, and I sort of need a FFX for dummies on this one. 

TaskMasterX

Throw is the exisiting FFX Throw Swap which makes the thrower throw the target up and over their head to land behind them. Throw2 is more like the Throw command that you have on throwable objects like cars, mailboxes, etc. - the thrower pickups up the target and heaves them forward instead of behind them. The direction the thrower is facing is the direction the target is hurled.

Not sure about the PowerUp anim at the end of the grapple, other meshes using this might not look as good. I guess it could be added as a custom and have the player choose the anim at the end of a KOd grapple. But I'm looking forward to completing this and moving on to some other things I've been wanting to do. It'd be something I'd do later.

Sorry about the delay in releasing the newest version, but there is an issue w/ the AI using it that I'm sure there's a simple fix for, it's just RL has suddenly become a priority, so I've had no time to get to it. But I did make a video, so I'll go ahead and give the link to it:

http://www.youtube.com/watch?v=gm7hWXt48I0
Sorry for the poor quality, but I think you can see what's going on.

Gremlin

Dude, that is so cool.  Way to go!  This is one of the coolest things I've seen in about forever.  That one bit in your earlier video where Hulk picked up the tank was just too awesome.

|