Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → [pokeyellow] Increasing the number of main char/rival name suggestions

#1 2018-07-29 18:26:34

_Q_
Member
Registered: 2018-07-20
Post 10/10

[pokeyellow] Increasing the number of main char/rival name suggestions

Hey, folks.

Pokemon R/G/B/Y give you three suggested names for the main character and your rival, but I noticed both menus leave space for a fourth name.

I opened up oak_speech2.asm and found that each list of names appears twice. I assume one list is the menu text and the other list is made up of the actual values that the names are set to when you select them. I updated all four lists, and I can now see the extra names on both lists, but I'm unable to move my cursor to these names.

I've looked looked through the ASM file, but I've been unable to determine how to change where the cursor can move. Any help would be much appreciated.

Offline

#2 2018-07-30 23:26:05

Danny-E 33
Administrator
Registered: 2012-06-09
Post 1,102/1,119

Re: [pokeyellow] Increasing the number of main char/rival name suggestions

Here is the relevant code from engine/oak_speech2.asm:

DisplayIntroNameTextBox:
    push de
    coord hl, 0, 0
    lb bc, 10, 9
    call TextBoxBorder
    coord hl, 3, 0
    ld de, .namestring
    call PlaceString
    pop de
    coord hl, 2, 2
    call PlaceString
    call UpdateSprites
    xor a                    ; value in 'a' is now 0
    ld [wCurrentMenuItem], a
    ld [wLastMenuItem], a
    inc a                    ; value in 'a' is now 1
    ld [wTopMenuItemX], a
    ld [wMenuWatchedKeys], a ; A_BUTTON
    inc a                    ; value in 'a' is now 2
    ld [wTopMenuItemY], a
    inc a                    ; value in 'a' is now 3
    ld [wMaxMenuItem], a
    jp HandleMenuInput

The important ram variable is wMaxMenuItem.

Originally there are 4 menu items; "New Name" plus the 3 default names. And since the first menu item is item 0, the last default name is item 3.

If you add a new default name, you need to increase wMaxMenuItem as well.

I added comments to the code to keep track of the current value of 'a'.
This is a little hidden since there is no point that 3 is directly written to 'a' like you might hope for.
To write 4 to wMaxMenuItem, you just need an additional 'inc a' before writing to it (or you could simply replace the last 'inc a' with 'ld a, 4').


I also want to say, the learning you are doing on your own, the research you're doing, and the questions you're asking are really good, keep at it

Offline

  • Index
  • → Help/Question
  • → [pokeyellow] Increasing the number of main char/rival name suggestions

Board footer

Powered by FluxBB