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
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!
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
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 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: