You are not logged in.
One more:
I have changed the stats screen so that it shows the pokemon's current happiness, e.g. 70/255. It works. But the number displays with the game's "¥" money symbol in front. Its not game-breaking but I'd rather it not be there.
The script I have for displaying happiness in engine/battle/stats_screen.asm is:
LoadOrangePage:
ld de, HappinessString
call PlaceString
hlcoord 1, 9
ld de, wTempMonHappiness
call PrintNum
ld de, HappinessTextString
call PlaceString
; now for caught location
call .PlaceCaughtLocation
ld de, MetAtMapString
hlcoord 1, 11
call PlaceString
ret
Is there a simple way to fix it?
Last edited by nightbringer (2022-01-07 17:52:43)
Offline
Put "lb bc, 1, 3" before "call PrintNum". The comment in engine/math/print_num.asm explains why:
; Print c digits of the b-byte value from de to hl.
; Allows 2 to 7 digits. For 1-digit numbers, add
; the value to char "0" instead of calling PrintNum.
; The high nybble of the c register specifies how many of the total amount of
; digits will be in front of the decimal point.
; Some extra flags can be given in bits 5-7 of b.
; Bit 5: money if set (unless left-aligned without leading zeros)
; Bit 6: left-aligned if set
; Bit 7: print leading zeros if set
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
Rangi, you hero.
I was reading that text in engine/math/print_num.asm and figured that was something to do with it but I couldn't figure what exactly to do. Glad to know I was on the right track - just needed a little helping hand!
Offline
Btw, BOOST15673, it sounds like something might be up with your RGBDS installation? Maybe you didn't get all the packages you needed when you installed it?
Doesn't sound like there's anything wrong with the ROM code or with the emulators so it sounds like there's a problem with the software that's building the game from the code.
Last edited by nightbringer (2022-01-08 12:36:33)
Offline
after a small hiatus from modding GSC i'm back with tinkering with Item Effects... but i'm a bit struck ATM...
maybe someone has an idea to improve it... the goal is to give my PKMN a berry (RAZZ_BERRY) and increase its happiness outside of a battle AND without healing it
well, here's the script:
RazzBerryEffect:
ld c, HAPPINESS_RAZZ_BERRY
jr RazzBerryCommon
RazzBerryCommon:
ld b, PARTYMENUACTION_HEALING_ITEM
call UseItem_SelectMon
jp c, .DecidedNotToUse
ld a, MON_ITEM
call GetPartyParamLocation
pop bc
cp 0
jr nz, .skip_happiness
farcall ChangeHappiness
call RazzBerryMessage
ld a, 0
call QueueScript
ld a, [wItemEffectSucceeded]
cp 1
call z, UseDisposableItem
ret
.skip_happiness
jp StatusHealer_Jumptable
.DecidedNotToUse:
xor a
ld [wItemEffectSucceeded], a
ret
it technically works, but only in battle... outside of it, it just displays the text that my PKMN ate the berry, but doesn't increase its happiness for some reason
it's probably a simply solution i'm just overlooking
Offline