’Cause all games were better on the GBC

You are not logged in.

#1 2013-05-03 15:11:13

From: Philippines
Registered: 2013-04-28
Post 41/51

hex value of berry trees??

do anyone here knows what was the hex values of berry trees?., your help will be very much appreciated..


#2 2013-05-03 16:05:17

Registered: 2010-10-16
Post 1,649/2,348

Re: hex value of berry trees??

9A Fruit tree code:

Creates a typical fruit tree monologue. There is a maximum of 32 fruit trees in the game. After this code the script ends.

[9A][Fruit tree number]

Fruit tree number + 11:4091 is the offset where the item no of the berry is defined.

Items ("berries") obtainable from fruit trees are stored in 11:4091 as a table, one byte for each berry tree.
And 11:4091 as a rom address is 0x44091.

Last edited by Miksy91 (2013-05-03 16:06:15)


#3 2013-05-03 16:29:02

From: Philippines
Registered: 2013-04-28
Post 42/51

Re: hex value of berry trees??

I'm sorry miksy, but can you please explain more further that to me?.. And what was the fruit tree codes?..


#4 2013-05-03 16:34:14

Registered: 2010-10-16
Post 1,650/2,348

Re: hex value of berry trees??

Open your rom with a hex editor and use "Go to" function to go to address 0x44091 (or just possibly 44091, depending on the hex editor in usage).
There, you see bytes that describe items that are given from certain berry trees in the game, there are 32 of them in total.

That "9A" fruit tree code is a scripting command that is used as script data for all fruit trees in the game. You don't have to worry about that.

Last edited by Miksy91 (2013-05-03 16:35:34)


#5 2013-05-03 16:37:16

Registered: 2009-11-25
Post 2,476/3,665

Re: hex value of berry trees??

A berry tree's script just points to x9A 0x?? where ?? is the number of the entry in that table.
In PKSV, it would look like this:

fruittree 0x1

PKSV will also try keep loading some nonsense codes after that, because it doesn't stop after the Berry Tree script like the game does. You can just delete those from the script box so it looks cleaner and is less likely to throw errors when you change it and recompile.

The table Miksy mentioned is just a list of bytes that determines which item each berry tree gives in order. So if the first item in the table is xAD then Berry tree 0x01 would give a normal berry. You can make it any item, though. You could make a berry tree that gave Master Balls or anything if you put its item number in the list.

Last edited by Luna (2013-05-03 16:38:14)

I am not very active on this forum. I only pop in from time to time.


#6 2013-05-03 19:36:25

Registered: 2012-04-09
Post 229/679

Re: hex value of berry trees??

there are actually only 30 trees:

maps/Route29.asm:228:    fruittree $1  ; BERRY
maps/Route30.asm:313:    fruittree $2  ; BERRY
maps/Route38.asm:455:    fruittree $3  ; BERRY
maps/Route46.asm:232:    fruittree $4  ; BERRY
maps/Route30.asm:317:    fruittree $5  ; PSNCUREBERRY
maps/Route33.asm:175:    fruittree $6  ; PSNCUREBERRY
maps/Route31.asm:309:    fruittree $7  ; BITTER_BERRY
maps/Route43.asm:458:    fruittree $8  ; BITTER_BERRY
maps/VioletCity.asm:108: fruittree $9  ; PRZCUREBERRY
maps/Route46.asm:236:    fruittree $a  ; PRZCUREBERRY
maps/Route35.asm:429:    fruittree $b  ; MYSTERYBERRY
maps/Route45.asm:438:    fruittree $c  ; MYSTERYBERRY
maps/Route36.asm:436:    fruittree $d  ; ICE_BERRY
maps/Route26.asm:374:    fruittree $e  ; ICE_BERRY
maps/Route39.asm:260:    fruittree $f  ; MINT_BERRY
maps/Route44.asm:450:    fruittree $10 ; BURNT_BERRY
maps/Route37.asm:165:    fruittree $11 ; RED_APRICORN
maps/Route37.asm:169:    fruittree $12 ; BLU_APRICORN
maps/Route37.asm:173:    fruittree $13 ; BLK_APRICORN
maps/AzaleaTown.asm:229: fruittree $14 ; WHT_APRICORN
maps/Route42.asm:277:    fruittree $15 ; PNK_APRICORN
maps/Route42.asm:281:    fruittree $16 ; GRN_APRICORN
maps/Route42.asm:285:    fruittree $17 ; YLW_APRICORN
maps/Route11.asm:130:    fruittree $18 ; BERRY
maps/Route2.asm:121:     fruittree $19 ; PSNCUREBERRY
maps/Route1.asm:72:      fruittree $1a ; BITTER_BERRY
maps/Route8.asm:163:     fruittree $1b ; PRZCUREBERRY
maps/PewterCity.asm:75:  fruittree $1c ; ICE_BERRY
maps/PewterCity.asm:79:  fruittree $1d ; MINT_BERRY
maps/FuchsiaCity.asm:63: fruittree $1e ; BURNT_BERRY

Last edited by comet (2013-05-03 19:39:46)


Board footer

Powered by FluxBB