You are not logged in.
Pages: 1
Has anyone ever actually done this specifically? I think I've seen at least one discussion about it but I can't seem to find it.
I've currently got the fourth stats page/characteristics code ported from TPP Anniversary Crystal, but I can't make heads or tails of how it works yet, so I'm not sure how to get it to just spit out the raw information into text.
Offline
I had a good friend help me out. It took quite a bit this morning, but the result was worth it. It even calculates the HP value!
This is just the relevant code; it doesn't have anything other than the DV text. On the plus side, you can drop this into any vanilla project fairly easily, edit the coords and call it on any of the stat screens. (pls leave credits in thank)
My personal taste was to display the numbers vertically, but it could easily be done as just two lines horizontally.
Anyways, it might not be the most optimal or efficient code, but I'm just happy it works.
; by Aurelio Mannara - BitBuilt 2017
; ShockSlayer helped ( °v°)
TN_PrintDVs:
; print labels
hlcoord 15, 9
ld [Buffer2], a
ld de, .label_DV ; DV
call PlaceString
hlcoord 14, 10
ld [Buffer2], a
ld de, .label_HP ; hp
call PlaceString
hlcoord 14, 11
ld [Buffer2], a
ld de, .label_ATK ; atk
call PlaceString
hlcoord 14, 12
ld [Buffer2], a
ld de, .label_DEF ; def
call PlaceString
hlcoord 14, 13
ld [Buffer2], a
ld de, .label_SPE ; spe
call PlaceString
hlcoord 14, 14
ld [Buffer2], a
ld de, .label_SPC ; spc
call PlaceString
; print 16 bit value of DVs
ld de, TempMonDVs
ld a, [de]
ld b, a
inc de
ld a, [de]
ld c, a
push bc
ld de, TempMonDVs
ld a, 0
ld [de], a
inc de
pop bc
ld a, b
push bc
and $f0
swap a
ld [de], a
hlcoord 18, 11 ; atk disp coords
lb bc, PRINTNUM_LEADINGZEROS | 2, 2
ld de, TempMonDVs
call PrintNum
ld de, TempMonDVs
ld a, 0
ld [de], a
inc de
pop bc
ld a, b
push bc
and $f
ld [de], a
hlcoord 18, 12 ; def disp coords
lb bc, PRINTNUM_LEADINGZEROS | 2, 2
ld de, TempMonDVs
call PrintNum
ld de, TempMonDVs
ld a, 0
ld [de], a
inc de
pop bc
ld a, c
push bc
and $f0
swap a
ld [de], a
hlcoord 18, 13 ; spe disp coords
lb bc, PRINTNUM_LEADINGZEROS | 2, 2
ld de, TempMonDVs
call PrintNum
ld de, TempMonDVs
ld a, 0
ld [de], a
inc de
pop bc
ld a, c
push bc
and $f
ld [de], a
hlcoord 18, 14 ; spc disp coords
lb bc, PRINTNUM_LEADINGZEROS | 2, 2
ld de, TempMonDVs
call PrintNum
ld de, TempMonDVs
ld a, 0
ld [de], a
inc de
pop bc
bit 4, b
jr z, .noAttackHP
set 3, a
.noAttackHP
bit 0, b
jr z, .noDefenseHP
set 2, a
.noDefenseHP
bit 4, c
jr z, .noSpeedHP
set 1, a
.noSpeedHP
bit 0, c
jr z, .noSpecialHP
set 0, a
.noSpecialHP
push bc
ld [de], a
hlcoord 18, 10 ; hp disp coords
lb bc, PRINTNUM_LEADINGZEROS | 2, 2
ld de, TempMonDVs
call PrintNum
ld de, TempMonDVs
pop bc
ld a, b
ld [de], a
inc de
ld a, c
ld [de], a
.label_DV
db "DVs:@"
.label_HP
db "HP@"
.label_ATK
db "ATK@"
.label_DEF
db "DEF@"
.label_SPE
db "SPE@"
.label_SPC
db "SPC@"
ret
Offline
I would love to implement this, where would I place this code? Super new to the disassembly and playing around with it yielded no results.
Offline
You can put it at the bottom of stats_screen.asm. It'll probably be more suitable to use if you port the fourth stats screen page.
Offline
Oh I see... I'll try what you did at the top and port it from TPP and see how I go tonight. Thanks ShockSlayer!
Offline
Sure thing. If you get stuck, let me know, and I'll send you my version of the file. I don't remember 100% but I think everything is contained within the file, so you miiiight be able to replace it directly.
Offline
I tried to use this awesome code you posted, but the fourth stat screen I got from TPP doesn't show up. Is there anything I need to port or change besides fourth_stats_screen.asm?
Offline
Can you explain how to also add a display for Happiness? This has been EXTREMELY helpful, but I am stumped on how to add Happiness in a similar way.
Offline
There are wTempMon____ values for everything. In this case, you want wTempMonHappiness.
My projects on GitHub:
• Polished Map 4.7.1 or 2.7.1++
• Tilemap Studio 4.0.1
• Pokémon Polished Crystal 2.2.0 or 3.0.0 beta
• Pokémon Red★/Blue★: Space World Edition 2020-11-01
Offline
Pages: 1