-
Notifications
You must be signed in to change notification settings - Fork 825
Battle Autoprompts
In Generation 3 onwards, most battle text don't require the player to click A. That's not the case in Generation 2, as most battle text require prompts which the player must click A. Thus, players tend to spam A after clicking a move. This tutorial aims to remove prompts for most battle text by making the game scroll through text by itself.
- Add new charmap constants
- Define new macros for autoprompts
- Make functions for the new macros
- Edit battle text to not require prompts
We first need to edit charmap.asm as they will be needed to make the autoprompts possible. Each control character is assigned to a 2 hex digit. There are a lot of unassigned hex digits, thus we can use some of them.
...
charmap "<_CONT>", $4b ; implements "<CONT>"
+ ; While "<SCROLL>" this is used in sharply rose or sharply fell stat texts, this will be
+ ; adjusted to give the player time to read. You may not apply Step 3 for this character.
+ ; You may also not include this comment in editing charmap.asm.
charmap "<SCROLL>", $4c
charmap "<NEXT>", $4e
charmap "<LINE>", $4f
charmap "@", $50 ; string terminator
charmap "<PARA>", $51
charmap "<PLAYER>", $52 ; wPlayerName
charmap "<RIVAL>", $53 ; wRivalName
charmap "#", $54 ; "POKé"
charmap "<CONT>", $55
charmap "<……>", $56 ; "……"
charmap "<DONE>", $57
charmap "<PROMPT>", $58
charmap "<TARGET>", $59
charmap "<USER>", $5a
charmap "<PC>", $5b ; "PC"
charmap "<TM>", $5c ; "TM"
charmap "<TRAINER>", $5d ; "TRAINER"
charmap "<ROCKET>", $5e ; "ROCKET"
charmap "<DEXEND>", $5f
+ charmap "<ATPRA>", $60
+ charmap "<ATDNE>", $61
...
Next, we edit macros/scripts/text.asm to add new macros that we'll be using for autoprompts.
text EQUS "db TX_START," ; Start writing text.
next EQUS "db \"<NEXT>\"," ; Move a line down.
line EQUS "db \"<LINE>\"," ; Start writing at the bottom line.
page EQUS "db \"@\"," ; Start a new Pokédex page.
para EQUS "db \"<PARA>\"," ; Start a new paragraph.
+ autopara EQUS "db \"<ATPRA>\"," ; Automatically start a new paragraph.
cont EQUS "db \"<CONT>\"," ; Scroll to the next line.
+ scroll EQUS "db \"<SCROLL>\"," ; Scroll to the next line, pausing shortly.
done EQUS "db \"<DONE>\"" ; End a text box.
+ autodone EQUS "db \"<ATDNE>\"" ; Automatically ends a text box.
prompt EQUS "db \"<PROMPT>\"" ; Prompt the player to end a text box (initiating some other event).
We then edit home/text.asm and make functions for the new constants.
diff
dict "<MOBILE>", MobileScriptChar
dict "<LINE>", LineChar
dict "<NEXT>", NextLineChar
dict "<CR>", CarriageReturnChar
dict "<NULL>", NullChar
+ ; You may not apply this step for "<SCROLL>". See Step 1 for details.
+ ; You may also not write this comment when editing text.asm.
- dict "<SCROLL>", _ContTextNoPause
+ dict "<SCROLL>", _ContTextPauseShort
dict "<_CONT>", _ContText
dict "<PARA>", Paragraph
+ dict "<ATPRA>", AutoParagraph
dict "<MOM>", PrintMomsName
...
dict "<LF>", LineFeedChar
dict "<CONT>", ContText
dict "<……>", SixDotsChar
dict "<DONE>", DoneText
+ dict "<ATDNE>", AutoDoneText
dict "<PROMPT>", PromptText
dict "<PKMN>", PlacePKMN
dict "<POKE>", PlacePOKE
...
_ContTextNoPause::
push de
call TextScroll
call TextScroll
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
pop de
jp NextChar
+_ContTextPauseShort::
+ push de
+ call TextScroll
+ call TextScroll
+ hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
+ ld c, 5
+ call DelayFrames
+ pop de
+ jp NextChar
...
Paragraph::
push de
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .linkbattle
cp LINK_MOBILE
jr z, .linkbattle
call LoadBlinkingCursor
.linkbattle
call Text_WaitBGMap
call PromptButton
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
call ClearBox
call UnloadBlinkingCursor
ld c, 20
call DelayFrames
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
pop de
jp NextChar
+AutoParagraph::
+ push de
+ call Text_WaitBGMap
+ ld c, 10
+ call DelayFrames
+ hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
+ lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
+ call ClearBox
+ ld c, 20
+ call DelayFrames
+ hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
+ pop de
+ jp NextChar
...
DoneText::
pop hl
ld de, .stop
dec de
ret
.stop:
text_end
+AutoDoneText::
+ call Text_WaitBGMap
+ ld c, 20
+ call DelayFrames
+ jr DoneText
Edit data/text/common_1.asm for the withdraw battle text:
_EnemyWithdrewText::
text "<ENEMY>"
line "withdrew"
- cont "@"
+ scroll "@"
text_ram wEnemyMonNickname
text "!"
- prompt
+ autodone
Also, edit data/text/battle.asm. Since the text is disorganized, just remember to edit the text related to type effectiveness, residual damage, item use, weather status, and more. Make sure to avoid editing fainting and EXP prompts. Feel free to edit the file by replacing the following macros:
-
cont
toscroll
-
para
toautopara
-
done
toautodone
.
That's it! You have made most battle text have autoprompts. See https://youtu.be/gtN0N0DVAjs to see them in action.