diff options
| author | mimi <65136112+mimi-m@users.noreply.github.com> | 2021-09-04 17:24:45 +0800 |
|---|---|---|
| committer | mimi <65136112+mimi-m@users.noreply.github.com> | 2021-09-04 17:24:45 +0800 |
| commit | e9061e0429aaa7b601b37c6d1b12b4a10ed57270 (patch) | |
| tree | e8c0481479c264c44d1fa163413181d91675b2a4 | |
| parent | e08ed881c59cd0c19c8aa04ddfeb4659967b26c8 (diff) | |
Updated Add a new phone contact (markdown)
| -rw-r--r-- | Add-a-new-phone-contact.md | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/Add-a-new-phone-contact.md b/Add-a-new-phone-contact.md index 2909b45..427cbeb 100644 --- a/Add-a-new-phone-contact.md +++ b/Add-a-new-phone-contact.md @@ -6,9 +6,10 @@ This tutorial is for how to add a new phone contact in the Pokégear. As an exam 1. [Define the phone contact's constant](#1-define-the-phone-contacts-constant) 2. [Giving them a custom name](#2-giving-them-a-custom-name) 3. [Define the contact's essential data](#3-define-the-contacts-essential-data) -4. [Create the files for when you call them](#4-create-the-files-for-when-you-call-them) -5. [Create the files for when they call you](#5-create-the-files-for-when-they-call-you) -6. [Include the new files in the ROM](#6-include-the-new-files-in-the-rom) +4. [Make the number permanent](#4-make-the-number-permanent) +5. [Create the files for when you call them](#5-create-the-files-for-when-you-call-them) +6. [Create the files for when they call you](#6-create-the-files-for-when-they-call-you) +7. [Include the new files in the ROM](#7-include-the-new-files-in-the-rom) ## 1. Define the phone contact's constant @@ -28,7 +29,6 @@ Edit [constants/phone_constants.asm](../blob/master/constants/phone_constants.as const PHONE_COOLTRAINERM_GAVEN ``` - ## 2. Giving them a custom name Generic trainers like Youngster Joey or Lass Dana don't need another constant for their name in the phone, since the constant for one of their parties is used instead. It also makes it so that their trainer class also appears below their name. In this case, we'll add a new constant under the trainer class `TRAINER_NONE` so that no trainer class shows up below the person's name, like how it looks like for `MOM` or `ELM`. However, Buena has a title below her called `DISC JOCKEY`. This is actually not a trainer class, but just part of her name. You can skip this step if want the character's trainer class to appear. @@ -73,6 +73,7 @@ Edit [data/phone/non_trainer_names.asm](../blob/master/data/phone/non_trainer_na We put `PHONECONTACT_RIVAL` below `PHONECONTACT_BUENA` earlier, so it should be right below `dw .buena` as well. Otherwise, the wrong name would be shown! To add a custom title, simply add `<LF>` and three spaces after the name and a semicolon `:`, then write the title. + ## 3. Define the contact's essential data Edit [data/phone/phone_contacts.asm](../blob/master/data/phone/phone_contacts.asm): @@ -120,8 +121,43 @@ phone: MACRO - **Caller Script**: This is the script that the game refers to when they call you. Later, we'll also be making a script for this, so let's enter `RivalCallerScript` for now. - If you noticed earlier, Mom has `UnusedPhoneScript` set for her. She actually calls you sometimes to tell you that she spent your money in the bank. These are scripted by the game, and are rarer than the NPC trainer calls that occur more commonly. +## 4. Make the number permanent + +This step is optional, but perfect if you'd like to make the player be unable to delete the character's number. + +Edit [data/phone/permanent_numbers.asm](../blob/master/data/phone/permanent_numbers.asm): + +```diff +PermanentNumbers: + db PHONECONTACT_MOM + db PHONECONTACT_ELM ++ db PHONECONTACT_RIVAL + db -1 ; end +``` + +Edit [engine/phone/phone.asm](../blob/master/engine/phone/phone.asm#L607): + +```diff +CheckCanDeletePhoneNumber: + ld a, c + call GetCallerTrainerClass + ld a, c + ; and a + ret nz + ld a, b + cp PHONECONTACT_MOM + ret z + cp PHONECONTACT_ELM + ret z ++ cp PHONECONTACT_RIVAL ++ ret z + ld c, $1 + ret +``` + +This makes it so that the `DELETE` option when you select the number is absent. -## 4. Create the files for when you call them +## 5. Create the files for when you call them Now, let's make a file for `RivalPhoneCalleeScript` and the text it uses. You can use another file as a guide, like Buena's ([buena.asm](../blob/master/engine/phone/scripts/buena.asm)) or Bill's ([bill.asm](../blob/master/engine/phone/scripts/bill.asm))! @@ -214,7 +250,7 @@ Create **data/phone/text/rival_callee.asm**. You can be creative with how you want the call to play out, depending on the character! You can make them say different text depending on the time of day, or randomized with the use of a table. You could also have them say one time things, with the use of an event flag. You can even incorporate the calls to scenes in the game if you use the event flags! -## 5. Create the files for when they call you +## 6. Create the files for when they call you This time, the rival would say three randomly chosen text whenever he calls you. We'll be using the `random` command and a table for it. In the post-game after beating the Pokémon League, we learn that Silver becomes more kind to his Pokémon. This is evident in the rematches in Indigo Plateau, in which his Golbat has evolved into Crobat. We can make him say randomly chosen text for this as well, which are now used instead after beating the elite four. @@ -341,7 +377,7 @@ Create **data/phone/text/rival_caller.asm**. + done ``` -## 6. Include the new files in the ROM +## 7. Include the new files in the ROM Edit [main.asm](../blob/master/main.asm): |
