Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-01-27 02:46:23

jastolze
Member
Registered: 2013-01-13
Post 103/112

Way to remove 999 stat limit?

Hey is there a way to remove the 999 stat limit? I want to know for the (small) hack I've made where you can level to 250, and with some pokemon, it's kind of a must that this be in effect. I'd also like to know if it's possible to stop the stats from overlapping on the HP Screen? Like once it hits 4 digits it starts freaking out graphics wise.

Thanks for any info!

Offline

#2 2015-01-27 04:05:40

comet
Member
Registered: 2012-04-09
Post 514/672

Re: Way to remove 999 stat limit?

~/pokecrystal $ git grep -n "\<999\>"
battle/core.asm:7039:; Cap at 999.
battle/core.asm:7041:   sub 999 % $100
battle/core.asm:7043:   sbc 999 / $100
battle/core.asm:7046:   ld a, 999 / $100
battle/core.asm:7048:   ld a, 999 % $100
battle/core.asm:7164:; Cap at 999.
battle/core.asm:7166:   sub 999 % $100
battle/core.asm:7168:   sbc 999 / $100
battle/core.asm:7170:   ld a, 999 / $100
battle/core.asm:7172:   ld a, 999 % $100
battle/effect_commands.asm:4195:; Minimum neutral damage is 2 (bringing the cap to 999).
battle/effect_commands.asm:6154:        sub 999 % $100
battle/effect_commands.asm:6157:        sbc 999 / $100
battle/effect_commands.asm:6890:        cp 999 % $100
battle/effect_commands.asm:6892:        sbc 999 / $100
battle/effect_commands.asm:6895:        ld a, 999 % $100
battle/effect_commands.asm:6897:        ld a, 999 / $100

Stats are printed in Function50b7b (main.asm). You'll want to change the following:

ld bc, $0203

This is passed into PrintNum for each stat. The top half ($02) is how many bytes are in a stat. The bottom ($03) is how many digits to print. Change this to 4 if you want to max it out at 9999, and so on.

ld bc, $0014

This determines where the stats are printed. It's 3 tiles away from the edge of the screen, so printing 4 digits will push the last digit off the screen. Subtract 1 to shift it to the left.

Offline

#3 2015-01-27 12:41:59

jastolze
Member
Registered: 2013-01-13
Post 104/112

Re: Way to remove 999 stat limit?

Wow, thanks Comet. I  was beginning to think this wasn't possible. But this really helps :P

Offline

#4 2015-02-20 23:31:35

jastolze
Member
Registered: 2013-01-13
Post 105/112

Re: Way to remove 999 stat limit?

So to be clear, Just replace all the 999's with the stat I want to? What about the 100? Does that represent level or something?

For the ld bc, $0203 part, it should look like $0304 if I wanted to accomplish this?

For the last part, should it be ld bc, $0011 or ld bc, $0013?

Thanks!

Offline

#5 2015-02-20 23:49:32

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 247/411
Website

Re: Way to remove 999 stat limit?

999 / 0x100 equals the higest byte of 999 (0x03) while 999 % 0x100 equals the lowest byte of 999 (0xE7). It's just a cleaner way to represent the otherwise  less meaningful values of 0x03 or 0xE7.

For the ld bc, $0203 part, it should look like $0304 if I wanted to accomplish this?

I don't know the context of that instruction, but telling by comet's reply, it would be $0204. You can fit any value between 0 and 65535 (0xFFFF) in two bytes.

For the last part, should it be ld bc, $0011 or ld bc, $0013?

$0013 to keep the stats aligned to the left of the screen.

Offline

#6 2015-06-06 01:30:19

jastolze
Member
Registered: 2013-01-13
Post 106/112

Re: Way to remove 999 stat limit?

Okay so believe it or not, I'm still trying to figure this out. I got all the way down to that last part, where Comet told me to look for this: ld bc, $0014

Well, my problem is, which one in Main.asm do I change? There are a few and I don't want to screw the game up by changing the wrong one. Could someone maybe just edit those files he said to edit (Battle/core.asm, effect_commands.asm, and Main.asm) and reupload here? I'm having some seriouss difficulty with this. :/

Offline

#7 2015-06-08 13:28:24

comet
Member
Registered: 2012-04-09
Post 581/672

Re: Way to remove 999 stat limit?

comet wrote:

Stats are printed in Function50b7b (main.asm). You'll want to change the following:

Offline

Board footer

Powered by FluxBB