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

Request When intangible, show blue hurtbubbles

jra64

Smash Journeyman
Joined
Jan 30, 2004
Messages
372
I think this code would be great for training purposes for things like visualizing exactly when your intangibility runs out on things like perfect ledgedash, spotdodge, roll, etc. The yellow hurtbubbles cover the in game models a bit too much in my opinion. If someone could post some helpful memory addresses or an idea of how this can be done, I can try to get it working, but I'm not that great at doing gecko codes...
 
Last edited:

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
Edit: Added a bit of info.

I did some research on display states and found an interesting method of selectively skipping the draw of certain types of collision bubbles. I’ll go through my notes later and follow up with some more information.

This code will stop individual hurtbubbles from displaying unless they are in an intangible state. It requires that collision display be turned on:

$Only Display Intangible Hurtbubbles [Punkline]
C20806D8 00000004
80C30000 2C060001
40820014 3CC08000
60C6A244 7CC803A6
4E800021 00000000


The draw logic treats individual hitbubbles separately from the full-body invulnerable/intangible states. Because of this, inhibiting the draw of hurtbubbles does nothing to intangible or invulnerable body states.

So, it turns out that this doesn’t filter out invulnerability states, hitbubbles, or shieldbubbles because it only targets the individual hurtbubbles.

---

I wrote this second, more experimental code that can be used alongside it in order to turn collision bubble displays on only for the duration of any intangible hurtbubble states on a character.

This includes what I think are all of the possible intangibility indicators:
  • Individual hurtbubble statuses - hurtbubble 0x00
  • Player Body State 1 - player data 0x1988
  • Player Body State 2 - player data 0x198C
Note that the code will turn the display back off afterward, making it difficult to use for anything else:

$Force Display of Intangible Hurtbubbles [Punkline]
C20A0DAC 00000002
9421FFB0 38000000
90010048 00000000
C20A0DEC 00000003
807D0000 80810048
7C632378 90610048
C05D0028 00000000
C20A0EE0 00000007
889B21FC 60850002
807B1988 80DB198C
7C633378 70630002
40820014 80610048
70630002 40820008
708500FD 98BB21FC
80010054 00000000
040a0ef4 38210050



Here are both of the codes for MCM, with a few notes in the ASM:

Code:
    -==-


Intangible Hurtbubble Display Only
Skips hurtbubble draw during collision bubble display if not in an intangible state.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800806d8 --- 4BF89B6D -> Branch

80C30000 2C060002
beql 0x8000a244


    -==-


Force Display of Intangible Hurtbubbles
Overhauls the Collision Bubble Display State to serve the purpose of displaying intangible hurtbubbles while they are active. Turns off display when they are inactive.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800a0dac --- 9421FFC0 -> Branch

9421FFB0 38000000
90010048 00000000

---------- 0x800a0dec --- C05D0028 -> Branch

807D0000 80810048
7C632378 90610048
C05D0028 00000000

---------- 0x800a0ee0 --- 80010044 -> Branch

889B21FC 60850002
807B1988 80DB198C
7C633378 70630002
40820014 80610048
70630002 40820008
708500FD 98BB21FC
80010054 00000000

---------- 0x800a0ef4 --- 38210040 -> 38210050
Code:
    -==-


Intangible Hurtbubble Display Only
Skips hurtbubble draw during collision bubble display if not in an intangible state.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800806d8 --- 4BF89B6D -> Branch

# INJECTION @ 800806d8 : bl -> 0x8000A244
# r3 = start of hurtbox
# r4, r5 = arguments passed to collision bubble display function
lwz r6, 0(r3)
cmpwi r6, 2     # 2 == intan state
beql 0x8000a244 # if intan, then display
return:
.long 0x00000000


    -==-


Force Display of Intangible Hurtbubbles
Overhauls the collision bubble display state to serve the purpose of displaying intangible hurtbubbles while they are active. Turns off display when they are inactive.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800a0dac --- 9421FFC0 -> Branch

# INJECTION @ 800a0dac : stwu sp, -0x40(sp)
# we use the stack frame to store a variable for us
stwu sp, -0x50(sp)      # we add 0x10 to the stack frame for our own use
li r0, 0
stw r0, 0x48(sp)        # 0x48(sp) is now our variable for ORing the hurtbox status
return:
.long 0x00000000

---------- 0x800a0dec --- C05D0028 -> Branch

# INJECTION @ 800a0dec : lfs f2, 0x28(r29)
# r29 = current hurtbox in loop
# -- code simply checks for intangible status and ors to value in stack
# -- intan status is "2" and max ID is "2"--so we can rely on the "2" bit like a bool
# freshly returned from update function, no return values
# so volatile registers are free
lwz r3, 0(r29)          # load status (0, 1, or 2)
lwz r4, 0x48(sp)        # load ORed status
or r3, r3, r4
stw r3, 0x48(sp)        # OR status to the variable
return:
lfs f2, 0x28(r29)
.long 0x00000000

---------- 0x800a0ee0 --- 80010044 -> Branch

# INJECTION @ 800a0ee0 : lwz    r0, 0x0044 (sp)
# r27 = internal player data BA
# -- code checks the ors for any intangible bones and uses it to inform collision display
lbz r4, 0x21FC(r27)     # player display state
ori r5, r4, 0x02        # r5 = added toggle for collision bubble display

lwz r3, 0x1988(r27)     # r3 = player body state
lwz r6, 0x198C(r27)     # r6 = ... other body state (both seem to be used separately)
or r3, r3, r6           #
andi. r3, r3, 2         # check 2 bit like a bool
bne display             # if body state is intangible, display

lwz r3, 0x48(sp)
andi. r3, r3, 2         # check 2 bit like a bool (we ORed values that might include 1)
bne display             # if OR loop collected any 2 bits, then toggle on display
noDisplay:              # else, toggle off display
andi. r5, r4, 0xFD
display:
stb r5, 0x21FC(r27)
return:
lwz r0, 0x0054 (sp)     # we add 0x10 to the original instruction because of our change to the stack
.long 0x00000000

---------- 0x800a0ef4 --- 38210040 -> # OVERWRITE @ 800a0ef4 :
# addi sp, sp, 0x40
# ->
addi sp, sp, 0x50

Let me know if there are any bugs.

---

Your request has left me interested in making a code that allows for an easier method of filtering and highlighting collision bubble displays. I may continue to experiment with this idea.
 
Last edited:

jra64

Smash Journeyman
Joined
Jan 30, 2004
Messages
372
This is awesome! Sorry that I never replied Punkline Punkline I thought it was just going to end up being a dead thread. When I try it with no other codes on the latest 20XX version, it doesn't display the character model. I actually don't mind that it displays the hitboxes and invulnerability as well but is there a way to get the character model being displayed?

EDIT: Nevermind, you just have to use the official debug way to turn on the hitboxes, I was using 20XX Y+Dpad Right, you have to turn on the debug menu first... Working perfectly, I even like the hitboxes and invulnerability boxes, as well
 
Last edited:
Top Bottom