• 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 Nametag = Player's Percent v2.0

UnclePunch

Smash Ace
Joined
Nov 9, 2014
Messages
673


Code:
$Nametag = Player's Percent v2.0 [UnclePunch]
C22FCEEC 00000013
3C608045 60633080
7DC32214 806DB6D8
7FC4F378 4800006D
7CA802A6 A8CE0060
3D80803A 618C70A0
7D8903A6 4E800421
806DB6D8 8063005C
7FC4F378 38A00000
3D80803A 618C6FEC
7D8903A6 4E800421
A88E0060 38A000FF
2C0400FA 40800030
5486F87E 7CC62850
98A30006 7CC42850
98C30007 7CC42850
98C30008 48000010
4E800021 25642081
93000000 889F0000
60000000 00000000
Code:
#Inject @802fceec

#Get Static Block in r8
load r3,0x80453080
add r14,r3,r4

#Setup Function Call to UpdateTextStruct
lwz    r3,-0x4928(r13)    #Text Struct
mr    r4,r30        #Subtext ID
bl    Text
mflr    r5
lha    r6,0x60(r14)        #Percent Int

#Update Text Struct
branchl    r12,0x803a70a0

#######################
## Update Text Color ##
#######################

lwz    r3,-0x4928(r13)    #Text Struct
lwz    r3,0x5C(r3)
mr    r4,r30        #Subtext ID
li    r5,0x0
branchl    r12,0x803a6fec        #Get Subtext Pointer

lha    r4,0x60(r14)        #Percent Int
li    r5,0xFF        #Base color value

#Stop Changing Color When Over 250%
cmpwi    r4,250
bge    exit

#RED
srwi    r6,r4,0x1
sub    r6,r5,r6
stb r5,0x6(r3)

#GREEN
sub    r6,r5,r4
stb     r6,0x7(r3)

#BLUE
sub    r6,r5,r4
stb     r6,0x8(r3)

b    exit

Text:
blrl
.long 0x25642081
.long 0x93000000


exit:
lbz    r4, 0 (r31)


Code:
$Nametag = Player's Percent v1.0 [UnclePunch]
C22FD1F0 00000005
7DC802A6 48000011
7C8802A6 7DC803A6
48000014 4E800021
82608260 82608260
00000000 00000000
C22FD208 00000003
3884FFF3 1CBB0004
38C2FDB0 7C86292E
7C9FF214 00000000
C22FCEEC 0000002F
3C608045 60633080
7C832214 A8640060
3CA06666 60A56667
7C051896 7C001670
54060FFE 7C003214
1C00000A 7C001850
540E063E 3CA06666
60A56667 3CE051EB
60E7851F 7C071896
7C002E70 54060FFE
7C003214 1C000064
7C001850 7C050096
7C001670 54060FFE
7C003214 540F063E
3CA01062 60A54DD3
3CE051EB 60E7851F
7C071896 7C003670
54060FFE 7C003214
1C0003E8 7C001850
7C070096 7C002E70
54060FFE 7C003214
5410063E 38C2FDB0
1CFE0004 7C66382E
38A0000B 2C100000
4182001C 38802000
7C848378 98A30000
B0830001 38630003
48000020 38801A1A
98A30000 B0830001
38630003 48000004
2C0F0000 4182001C
38802000 7C847B78
98A30000 B0830001
38630003 48000020
38801A1A 98A30000
B0830001 38630003
48000004 2C0E0000
4182001C 38802000
7C847378 98A30000
B0830001 38630003
48000018 38802000
98A30000 B0830001
38630003 48000004
38802103 98A30000
B0830001 38630003
38800F0D B0830000
889F0000 00000000
 
Last edited:

UnclePunch

Smash Ace
Joined
Nov 9, 2014
Messages
673
Updated to v2.0

Learned more about text structs, this code could have been muuuuch smaller. Percents are also centered in the text box and change color w/ increased percentages.
 
Last edited:
Top Bottom