diff options
author | KDLPro <38602758+KDLPro@users.noreply.github.com> | 2021-07-28 18:45:53 +0800 |
---|---|---|
committer | KDLPro <38602758+KDLPro@users.noreply.github.com> | 2021-07-28 18:45:53 +0800 |
commit | 7d7c2727fc70b2e9abab5b45defbf75262fe4a3e (patch) | |
tree | 0c189072e9ad3cd8f6e079ba34e08cbad659d584 | |
parent | 5acc482110bc2ef06f8f3bda00bc7c5c9c204c23 (diff) |
Created Battle Autoprompt (markdown)
-rw-r--r-- | Battle-Autoprompt.md | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/Battle-Autoprompt.md b/Battle-Autoprompt.md new file mode 100644 index 0000000..63231bd --- /dev/null +++ b/Battle-Autoprompt.md @@ -0,0 +1,197 @@ +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. + +## Contents + +1. [Add new charmap constants](add-new-charmap-constants) +2. [Define new macros for autoprompts](define-new-macros-for-autoprompts) +3. [Make functions for the new macros](make-functions-for-the-new-macros) +4. [Edit battle text to not require prompts](edit-battle-text-to-not-require-prompts) + + +## 1. Add new charmap constants + +We first need to edit [charmap.asm](../blob/master/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. + +```diff + +... + 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 +... +``` + +## 2. Define new macros for autoprompts + +Next, we edit [macros/scripts/text.asm](../blob/master/macros/scripts/text.asm) to add new macros that we'll be using for autoprompts. + +```diff + +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). +``` + +## 3. Make functions for the new macros + +We then edit [home/text.asm](../blob/master/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 + +``` + +## 4. Edit battle text to not require prompts + +Edit [data/text/common_1.asm](../blob/master/data/text/common_1.asm) for the withdraw battle text: + +```diff + +_EnemyWithdrewText:: + text "<ENEMY>" + line "withdrew" +- cont "@" ++ scroll "@" + text_ram wEnemyMonNickname + text "!" +- prompt ++ autodone + +``` + +Also, edit [data/text/battle.asm](../blob/master/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: + +1. `cont` to `scroll` +2. `para` to `autopara` +3. `done` to `autodone`. + +That's it! You have made most battle text have autoprompts. See (https://youtu.be/gtN0N0DVAjs)[https://youtu.be/gtN0N0DVAjs] to see them in action.
\ No newline at end of file |