- 14
- Posts
- 11
- Years
- Seen Jan 1, 2025
In Viridian Forest I want to add Yellow's trainers to give more trainers to battle before Brock. However, while the trainers are in the proper location, they don't say what they're supposed to say and only the trainer with the 2 Caterpies battles me. I followed the following tutorial (only I figured out the part of adding a custom party myself): https://github.com/pret/pokered/wiki/How-to-Add-a-New-Trainer
As for what precisely I did:
In constants\event_constants.asm, of course under the Viridian Forest events, I continued from the existing const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 (so, the same line 5x with numbers 3 to 7)
In data\maps\objects\ViridianForest.asm, under object_event 27, 40, SPRITE_YOUNGSTER, STAY, NONE, 8 ; person I added the following:
In text\ViridianForest.asm at the end of the file I added the following (note: Frst is not a typo, I followed the disassembly's example which does that in all the AfterBattleText):
In scripts\ViridianForest.asm, first under ViridianForest_TextPointers, under dw ViridianForestText14 I added new lines going from 15 to 19. Then under ViridianForestTrainerHeaders I added the following after the 3 TrainerHeaders that are already there (but before db -1 of course):
And still in the same file, at the end of it I also added this:
Finally, in data\trainers\parties.asm I added the following at the end of BugCatcherData (parties 15-18 in the BugCatcherData list) and LassData (party 19 in the LassData list) (in this comment, I separate the 2 by --- to not overflow this topic with spoiler buttons). MEW is a custom Metapod with Tackle and String Shot (I used the Mew data for that for simplicity's sake since I'm not using Mew in my hack anyway), in case anyone's wondering why that's there:
EDIT: OK, I've made some progress. Apparantly in scripts/ViridianForest.asm I had to put the text poiners (15-19) between 8 and 9. Now I can battle the trainers and they say what they're supposed to say. However, only the first new trainer with the 2 lvl 7 Caterpies actually spots me with an exclamation mark: the others don't. Also, that first new trainer does so infinitely.
EDIT2: Ah, something is really wrong. The signs act as doubles for the trainers now. Clearly some pointer issue but I don't know what, the guide says nothing about position and stuff.
As for what precisely I did:
In constants\event_constants.asm, of course under the Viridian Forest events, I continued from the existing const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 (so, the same line 5x with numbers 3 to 7)
In data\maps\objects\ViridianForest.asm, under object_event 27, 40, SPRITE_YOUNGSTER, STAY, NONE, 8 ; person I added the following:
Spoiler:
object_event 28, 32, SPRITE_YOUNGSTER, STAY, LEFT, 9, OPP_BUG_CATCHER, 15
object_event 28, 18, SPRITE_YOUNGSTER, STAY, LEFT, 10, OPP_BUG_CATCHER, 16
object_event 2, 17, SPRITE_YOUNGSTER, STAY, LEFT, 11, OPP_BUG_CATCHER, 17
object_event 2, 41, SPRITE_COOLTRAINER_F, STAY, NONE, 12, OPP_LASS, 19
object_event 13, 17, SPRITE_YOUNGSTER, STAY, RIGHT, 13, OPP_BUG_CATCHER, 18
object_event 28, 18, SPRITE_YOUNGSTER, STAY, LEFT, 10, OPP_BUG_CATCHER, 16
object_event 2, 17, SPRITE_YOUNGSTER, STAY, LEFT, 11, OPP_BUG_CATCHER, 17
object_event 2, 41, SPRITE_COOLTRAINER_F, STAY, NONE, 12, OPP_LASS, 19
object_event 13, 17, SPRITE_YOUNGSTER, STAY, RIGHT, 13, OPP_BUG_CATCHER, 18
In text\ViridianForest.asm at the end of the file I added the following (note: Frst is not a typo, I followed the disassembly's example which does that in all the AfterBattleText):
Spoiler:
_ViridianForestBattleText4::
text "Hey! You have"
line "#MON! Come on!"
cont "Let's battle 'em!"
done
_ViridianForestEndBattleText4::
text "No!"
line "CATERPIE can't"
cont "cut it!"
prompt
_ViridianFrstAfterBattleText4::
text "Ssh! You'll scare"
line "the bugs away!"
done
_ViridianForestBattleText5::
text "Yo! You can't jam"
line "out if you're a"
cont "#MON trainer!"
done
_ViridianForestEndBattleText5::
text "Huh?"
line "I ran out of"
cont "#MON!"
prompt
_ViridianFrstAfterBattleText5::
text "Darn! I'm going"
line "to catch some"
cont "stronger ones!"
done
_ViridianForestBattleText6::
text "Hey, wait up!"
line "What's the hurry?"
done
_ViridianForestEndBattleText6::
text "I"
line "give! You're good"
cont "at this!"
prompt
_ViridianFrstAfterBattleText6::
text "Sometimes, you"
line "can find stuff on"
cont "the ground!"
para "I'm looking for"
line "the stuff I"
cont "dropped!"
done
_ViridianForestBattleTextPikaGirl::
text "Hi, do you have a"
line "PIKACHU?"
done
_ViridianForestEndBattleTextPikaGirl::
text "Oh no,"
line "really?"
prompt
_ViridianForestAfterBattleTextPikaGirl::
text "I looked forever,"
line "but I never found"
cont "a PIKACHU here!"
done
_ViridianForestBattleTextSamurai::
text "I'm gonna be the"
line "best. You just"
cont "can't beat me!"
done
_ViridianForestEndBattleTextSamurai::
text "After"
line "all I did..."
prompt
_ViridianForestAfterBattleTextSamurai::
text "A METAPOD is cool"
line "because its"
cont "attack is its"
cont "defense!"
done
text "Hey! You have"
line "#MON! Come on!"
cont "Let's battle 'em!"
done
_ViridianForestEndBattleText4::
text "No!"
line "CATERPIE can't"
cont "cut it!"
prompt
_ViridianFrstAfterBattleText4::
text "Ssh! You'll scare"
line "the bugs away!"
done
_ViridianForestBattleText5::
text "Yo! You can't jam"
line "out if you're a"
cont "#MON trainer!"
done
_ViridianForestEndBattleText5::
text "Huh?"
line "I ran out of"
cont "#MON!"
prompt
_ViridianFrstAfterBattleText5::
text "Darn! I'm going"
line "to catch some"
cont "stronger ones!"
done
_ViridianForestBattleText6::
text "Hey, wait up!"
line "What's the hurry?"
done
_ViridianForestEndBattleText6::
text "I"
line "give! You're good"
cont "at this!"
prompt
_ViridianFrstAfterBattleText6::
text "Sometimes, you"
line "can find stuff on"
cont "the ground!"
para "I'm looking for"
line "the stuff I"
cont "dropped!"
done
_ViridianForestBattleTextPikaGirl::
text "Hi, do you have a"
line "PIKACHU?"
done
_ViridianForestEndBattleTextPikaGirl::
text "Oh no,"
line "really?"
prompt
_ViridianForestAfterBattleTextPikaGirl::
text "I looked forever,"
line "but I never found"
cont "a PIKACHU here!"
done
_ViridianForestBattleTextSamurai::
text "I'm gonna be the"
line "best. You just"
cont "can't beat me!"
done
_ViridianForestEndBattleTextSamurai::
text "After"
line "all I did..."
prompt
_ViridianForestAfterBattleTextSamurai::
text "A METAPOD is cool"
line "because its"
cont "attack is its"
cont "defense!"
done
In scripts\ViridianForest.asm, first under ViridianForest_TextPointers, under dw ViridianForestText14 I added new lines going from 15 to 19. Then under ViridianForestTrainerHeaders I added the following after the 3 TrainerHeaders that are already there (but before db -1 of course):
Spoiler:
ViridianForestTrainerHeader3:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3, 4, ViridianForestBattleText4, ViridianForestEndBattleText4, ViridianForestAfterBattleText4
ViridianForestTrainerHeader4:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4, 4, ViridianForestBattleText5, ViridianForestEndBattleText5, ViridianForestAfterBattleText5
ViridianForestTrainerHeader5:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_5, 1, ViridianForestBattleText6, ViridianForestEndBattleText6, ViridianForestAfterBattleText6
ViridianForestTrainerHeader6:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_6, 0, ViridianForestBattleText7, ViridianForestEndBattleText7, ViridianForestAfterBattleText7
ViridianForestTrainerHeader7:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_7, 4, ViridianForestBattleText8, ViridianForestEndBattleText8, ViridianForestAfterBattleText8
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3, 4, ViridianForestBattleText4, ViridianForestEndBattleText4, ViridianForestAfterBattleText4
ViridianForestTrainerHeader4:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4, 4, ViridianForestBattleText5, ViridianForestEndBattleText5, ViridianForestAfterBattleText5
ViridianForestTrainerHeader5:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_5, 1, ViridianForestBattleText6, ViridianForestEndBattleText6, ViridianForestAfterBattleText6
ViridianForestTrainerHeader6:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_6, 0, ViridianForestBattleText7, ViridianForestEndBattleText7, ViridianForestAfterBattleText7
ViridianForestTrainerHeader7:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_7, 4, ViridianForestBattleText8, ViridianForestEndBattleText8, ViridianForestAfterBattleText8
And still in the same file, at the end of it I also added this:
Spoiler:
ViridianForestText15:
text_asm
ld hl, ViridianForestTrainerHeader3
call TalkToTrainer
jp TextScriptEnd
ViridianForestText16:
text_asm
ld hl, ViridianForestTrainerHeader4
call TalkToTrainer
jp TextScriptEnd
ViridianForestText17:
text_asm
ld hl, ViridianForestTrainerHeader5
call TalkToTrainer
jp TextScriptEnd
ViridianForestText18:
text_asm
ld hl, ViridianForestTrainerHeader6
call TalkToTrainer
jp TextScriptEnd
ViridianForestText19:
text_asm
ld hl, ViridianForestTrainerHeader7
call TalkToTrainer
jp TextScriptEnd
ViridianForestBattleText4:
text_far _ViridianForestBattleText4
text_end
ViridianForestEndBattleText4:
text_far _ViridianForestEndBattleText4
text_end
ViridianForestAfterBattleText4:
text_far _ViridianFrstAfterBattleText4
text_end
ViridianForestBattleText5:
text_far _ViridianForestBattleText5
text_end
ViridianForestEndBattleText5:
text_far _ViridianForestEndBattleText5
text_end
ViridianForestAfterBattleText5:
text_far _ViridianFrstAfterBattleText5
text_end
ViridianForestBattleText6:
text_far _ViridianForestBattleText6
text_end
ViridianForestEndBattleText6:
text_far _ViridianForestEndBattleText6
text_end
ViridianForestAfterBattleText6:
text_far _ViridianFrstAfterBattleText6
text_end
ViridianForestBattleText7:
text_far _ViridianForestBattleTextPikaGirl
text_end
ViridianForestEndBattleText7:
text_far _ViridianForestEndBattleTextPikaGirl
text_end
ViridianForestAfterBattleText7:
text_far _ViridianForestAfterBattleTextPikaGirl
text_end
ViridianForestBattleText8:
text_far _ViridianForestBattleTextSamurai
text_end
ViridianForestEndBattleText8:
text_far _ViridianForestEndBattleTextSamurai
text_end
ViridianForestAfterBattleText8:
text_far _ViridianForestAfterBattleTextSamurai
text_end
text_asm
ld hl, ViridianForestTrainerHeader3
call TalkToTrainer
jp TextScriptEnd
ViridianForestText16:
text_asm
ld hl, ViridianForestTrainerHeader4
call TalkToTrainer
jp TextScriptEnd
ViridianForestText17:
text_asm
ld hl, ViridianForestTrainerHeader5
call TalkToTrainer
jp TextScriptEnd
ViridianForestText18:
text_asm
ld hl, ViridianForestTrainerHeader6
call TalkToTrainer
jp TextScriptEnd
ViridianForestText19:
text_asm
ld hl, ViridianForestTrainerHeader7
call TalkToTrainer
jp TextScriptEnd
ViridianForestBattleText4:
text_far _ViridianForestBattleText4
text_end
ViridianForestEndBattleText4:
text_far _ViridianForestEndBattleText4
text_end
ViridianForestAfterBattleText4:
text_far _ViridianFrstAfterBattleText4
text_end
ViridianForestBattleText5:
text_far _ViridianForestBattleText5
text_end
ViridianForestEndBattleText5:
text_far _ViridianForestEndBattleText5
text_end
ViridianForestAfterBattleText5:
text_far _ViridianFrstAfterBattleText5
text_end
ViridianForestBattleText6:
text_far _ViridianForestBattleText6
text_end
ViridianForestEndBattleText6:
text_far _ViridianForestEndBattleText6
text_end
ViridianForestAfterBattleText6:
text_far _ViridianFrstAfterBattleText6
text_end
ViridianForestBattleText7:
text_far _ViridianForestBattleTextPikaGirl
text_end
ViridianForestEndBattleText7:
text_far _ViridianForestEndBattleTextPikaGirl
text_end
ViridianForestAfterBattleText7:
text_far _ViridianForestAfterBattleTextPikaGirl
text_end
ViridianForestBattleText8:
text_far _ViridianForestBattleTextSamurai
text_end
ViridianForestEndBattleText8:
text_far _ViridianForestEndBattleTextSamurai
text_end
ViridianForestAfterBattleText8:
text_far _ViridianForestAfterBattleTextSamurai
text_end
Finally, in data\trainers\parties.asm I added the following at the end of BugCatcherData (parties 15-18 in the BugCatcherData list) and LassData (party 19 in the LassData list) (in this comment, I separate the 2 by --- to not overflow this topic with spoiler buttons). MEW is a custom Metapod with Tackle and String Shot (I used the Mew data for that for simplicity's sake since I'm not using Mew in my hack anyway), in case anyone's wondering why that's there:
Spoiler:
; Viridian Forest Yellow
db 7, CATERPIE, CATERPIE, 0
db 6, METAPOD, CATERPIE, METAPOD, 0
db 10, CATERPIE, 0
db 8, CATERPIE, MEW, 0
---
; Viridian Forest Yellow
db 6, NIDORAN_F, NIDORAN_M, 0
db 7, CATERPIE, CATERPIE, 0
db 6, METAPOD, CATERPIE, METAPOD, 0
db 10, CATERPIE, 0
db 8, CATERPIE, MEW, 0
---
; Viridian Forest Yellow
db 6, NIDORAN_F, NIDORAN_M, 0
EDIT: OK, I've made some progress. Apparantly in scripts/ViridianForest.asm I had to put the text poiners (15-19) between 8 and 9. Now I can battle the trainers and they say what they're supposed to say. However, only the first new trainer with the 2 lvl 7 Caterpies actually spots me with an exclamation mark: the others don't. Also, that first new trainer does so infinitely.
EDIT2: Ah, something is really wrong. The signs act as doubles for the trainers now. Clearly some pointer issue but I don't know what, the guide says nothing about position and stuff.
Last edited: