• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Completed Jab Reset Config

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
This code allows users to finely adjust the threshold that triggers a jab reset through floating point parameters, and tie them to knockback values. When configured, the code may be used to set a damage threshold, a knockback threshold, both, or neither -- if desired.

This code requires the latest version of Melee Code Manager.

Jab Reset Config
Edit: DOL Mod temporarily unavailable -- install ASM or Gecko Code
Code:
    -==-

ASM - Jab Reset Config
Edit <jabreset_config> to configure jab reset parameters
[Punkline]
<jabreset_config> NTSC 1.02
# Modify the .long value below to change the
# threshold type used for jab resets:

.long 2

# The following threshold types are available:
#  0 = Disable Jab Resets
#  1 = Use only Damage Threshold
#  2 = Use only Knockback Threshold
#  3 = Use both Damage OR Knockback (not exclusive)
#  7 = Use both Damage AND Knockback

# The game uses type 1 by default.
# This mod uses type 2 by default.


# To set the Damage/Knockback thresholds,
#  change the following .float values:

.float   7.0 # Damage Threshold  
.float  60.0 # Knockback Threshold


# Finally, the following .float value will scale the
#  knockback of a successful jab reset.

.float  1.00 # reset knockback scale

# Setting this to 1.0 causes no scale, while
#  setting it lower than 1.0 will allow for
#  higher damage/knockback jab resets.



NTSC 1.02 --- 8009f15c ---- FC020040 -> Branch
# just before conditional branch for default jab reset threshold
# f2 = damage value
# r5 = player data
# if returned cr0 contains value 'lt', then reset is made

# register names:
.set fDV, 2   # damage value
.set fDT, 12  # damage threshold
.set fKV, 11  # knockback value
.set fKT, 10  # knockback threshold
.set fScale, 9 # scaled knockback, for successful jab resets

.set rPlayer, 5  # player data
.set rParams, 12 # jabreset_config

# player data offsets:
.set xKBValue, 0x1850

# parameter offsets:
.set xThresholdType, 0x0
.set xDMGThresh,     0x4
.set xKBThresh,      0x8
.set xScale,         0xC

# bool names:
.set bDamage,    31
.set bKnockback, 30
.set bLogicAND,  29

lis r0, <<jabreset_config>>@h
ori rParams, r0, <<jabreset_config>>@l
# construct address of <jabreset_config> parameters

lwz   r0, xThresholdType(rParams)
mtcrf 0b00000001, r0
# boolean values are now in cr7

lfs   fDT, xDMGThresh(rParams)
lfs   fKV, xKBValue(rPlayer)
fcmpo cr0, fDV, fDT
lfs   fKT, xKBThresh(rParams)
lfs   fScale, xScale(rParams)
fcmpo cr1, fKV, fKT
crand bDamage, lt, bDamage
fmuls fScale, fScale, fKV
crand bKnockback, lt+4, bKnockback
cror  lt, bDamage, bKnockback
# load and compare values in cr0 and cr1
# bDamage and bKnockback become AND gates

# only the 'lt' bit will be measured on return:
# True  = qualifies for jab reset
# False = over threshold

bf+ bLogicAND, _check_scale
  crand lt, bDamage, bKnockback
  # if bLogicAND is true, then use crand instead of cror
  #  - now lt is True only if both conditions are fulfilled

_check_scale:
bf+ lt, _return
  stfs fScale, xKBValue(rPlayer)
  # if jab reset is successful, update with scaled knockback value

_return:
.long 0
$Jab Reset Config [Punkline]
C209F15C 0000000D
4800004D 7D8802A6
800C0000 7C001120
C18C0004 C1651850
FC026040 C14C0008
C12C000C FC8B5040
4FE0FA02 ED2902F2
4FC4F202 4C1FF382
40BD0008 4C1FF202
40A00020 D1251850
48000018 4E800021

00000002 40E00000
42700000 3F800000

60000000 00000000


Modify the yellow lines to configure parameters:
0x0 = Threshold Type
0x4 = Damage Threshold
0x8 = Knockback Threshold
0xC = Knockback Scale

Click the Edit button to modify <jabreset_config>


The Cape The Cape originally requested a code that allows the threshold to be triggered by knockback instead of damage, so this code has been designed to allow for both damage and/or knockback to trigger jab resets.

By default, the threshold has been set to 60.0 knockback, using threshold type 2 to ignore damage.
The parameters may be configured to use other types of thresholds, if desired:

0 = none (disable jab resets)
1 = damage (game default)
2 = knockback (code default)
3 = damage OR knockback (either or both)
7 = damage AND knockback (both required)


If threshold(s) are set too high, then a wakeup in midair will result in a failed jab reset animation. To counter this, I’ve included a knockback multiplier that may be used to scale the resulting knockback calculation of a successful jab reset. This allows for larger attacks on damaged players to land on the ground, triggering the reset animation.

By default, this multiplier value is 1.0 -- nullifying the effect. Set it to a value below 1.0 to allow for larger thresholds.

---

If anyone has any suggestions, questions, or finds any bugs; then please let me know. Happy Holidays!
 
Last edited:

The Cape

Smash Master
Joined
May 16, 2004
Messages
4,478
Location
Carlisle, PA
Trying to figure out how to modify the pieces on this. Have been playing around with it and I am not sure if I am making headway.

This is already much more than I requested so awesome job!

It looks like when I adjust the type of thresholds, even using the default, it removes jab resets.

I also get the attached error whenever I try to add the code as you have it above (no edits)
 

Attachments

Last edited:

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
Trying to figure out how to modify the pieces on this. Have been playing around with it and I am not sure if I am making headway.

This is already much more than I requested so awesome job!

It looks like when I adjust the type of thresholds, even using the default, it removes jab resets.

I also get the attached error whenever I try to add the code as you have it above (no edits)
DRGN DRGN there seems to be a parsing bug involved with compiled codes (machine code) that are using the new <<RAM>> syntax. I've sent you a PM with some details about another case where I've run into this problem. It seems that the ASM version works fine.

The Cape The Cape try installing the ASM code in place of the DOL Mod for now. There's a '!' at the top of the code that you will need to erase in order to enable it, but it should install just like a normal DOL mod afterwards.

Edit: I've modified the post to remove the DOL mod temporarily. The ASM version has had the '!' mark removed so that it can be installed like a normal code. A gecko code has also been added.
 
Last edited:

The Cape

Smash Master
Joined
May 16, 2004
Messages
4,478
Location
Carlisle, PA
The ASM version worked and I found values that work extremely well. I used damage at 6.1 and knockback at 80 combined which works extremely well.

Question with this:

The thresholds, are those "Less than" or "less than or equal to"?

Therefore if it's set to six damage, does the move have to do 6 or less, or less than 6?
 
Last edited:

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
The ASM version worked and I found values that work extremely well. I used damage at 6 and knockback at 80 combined which works extremely well.

Question with this:

The thresholds, are those "Less than" or "less than or equal to"?

Therefore if it's set to six damage, does the move have to do 6 or less, or less than 6?
The game uses "less than" to trigger the reset, and "greater or equal to" to trigger a normal hit. The values compared are real floating points, so you can also use non-integral numbers if you want. If a damage threshold is set to 6.0, and a move's damage has been scaled to 5.9 or something -- then a jab reset would still be triggered. You can use a threshold value like 6.01 to make 6.0 inclusive in the reset trigger.
 
Last edited:

Stormghetti

Smash Journeyman
Joined
Aug 23, 2015
Messages
400
Location
Europe
Slippi.gg
STRM#798
NNID
Stormghetti
MCM 4.1 doesn't seem to work on my build for whatever reason, no matter what I do, so I'm inclined to ask if you could make a gecko version if possible?
 

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
Woops, forgot to update the OP. Sorry Stormghetti Stormghetti ; this code uses a special syntax that’s new to 4.1 MCM, but a small bug causes the compiled hex code to be interpreted incorrectly. You can install the ASM version instead in the meantime, just like a normal code. I’ve spoken to DRGN about the issue.

Since it’s a simple code, I’ve also updated the post to include a gecko code that uses a blrl table to access the custom parameters. It should function similarly.
 

Stormghetti

Smash Journeyman
Joined
Aug 23, 2015
Messages
400
Location
Europe
Slippi.gg
STRM#798
NNID
Stormghetti
Woops, forgot to update the OP. Sorry Stormghetti Stormghetti ; this code uses a special syntax that’s new to 4.1 MCM, but a small bug causes the compiled hex code to be interpreted incorrectly. You can install the ASM version instead in the meantime, just like a normal code. I’ve spoken to DRGN about the issue.

Since it’s a simple code, I’ve also updated the post to include a gecko code that uses a blrl table to access the custom parameters. It should function similarly.
Thanks, I had to use the gecko version it seems. It works great so far!
 
Top Bottom