Cataclyptic
Everything I say is a lie
- 199
- Posts
- 10
- Years
- United States of America
- Seen today
I am trying to make Ronald, the final version of his deck, rebattleable at Ishihara's house. I have already made a quick and dirty code which does allow for this to happen, but there is a problem: the game doesn't know what to do if the PC wins or loses, so after the duel ends, nothing further happens and the game resumes like normal.
I'd like to improve this by copying and editing the dueling battle codes found in the various lobbies, which goes like this:
GrassClubLobbyAfterDuel:
ld hl, .after_duel_table
call FindEndOfDuelScript
ret
... and then in the .after_duel_table it lists a bunch of new scripts designed to figure out what happens if the PC loses or wins. However, Ishihara's house notably does not have this after duel script, so when I try to put one in, it gives me this:
error: src/main.asm(26) -> src/engine/overworld/scripting.asm(2049) -> src/scripts/ishiharas_house.asm(198): Unknown symbol "IshiharasHouseAfterDuel.after_duel_table"
Inserting the "ld hl..." script into various other premade scripts/symbols does nothing.
So basically, I need to create a new symbol, "Ishiharashouseafterduel .after_duel_table", and have the game recognize it, then the rest of the code should follow. How would I do this?
EDIT: Code no longer gives an error, but it doesn't do anything after battle.
=================================================================
EDIT: My code is this so far:
This is all at the very end of the script. Insewrting it all at the beginning also does nothing. The error code is no longer present, but the new script doesn't do anything after the result of the battle.
Preload_Ronald1InIshiharasHouse: (Official from the base game)
get_event_value EVENT_RECEIVED_LEGENDARY_CARDS
cp TRUE
ccf
ret
IshiharasHouseAfterDuel: (New)
ld hl, .after_duel_table
call FindEndOfDuelScript
ret
.after_duel_table (New)
db NPC_RONALD1
db NPC_RONALD1
dw Script_BeatRonald1
dw Script_LostToRonald1
db $00
Script_Ronald: (Old but text has been edited)
start_script
jump_if_event_true EVENT_RONALD_TALKED, .ows_dc55
max_out_event_value EVENT_RONALD_TALKED
print_text_quit_fully Text073f
.ows_dc55
print_npc_text Text0740
ask_question_jump Text0741, .ows_dc60 (Asks if player wants to duel)
print_text_quit_fully Text0742
.ows_dc60
set_dialog_npc NPC_RONALD1
start_duel PRIZES_6, LEGENDARY_RONALD_DECK_ID, MUSIC_DUEL_THEME_3 (This part is new)
print_text_quit_fully Text0743
Script_BeatRonald1: (new)
start_script
print_npc_text Text0658
give_booster_packs BOOSTER_EVOLUTION_PSYCHIC, BOOSTER_EVOLUTION_PSYCHIC, NO_BOOSTER
print_npc_text Text0659
quit_script_fully
Script_LostToRonald1: (new)
start_script
print_text_quit_fully Text065a
I'd like to improve this by copying and editing the dueling battle codes found in the various lobbies, which goes like this:
GrassClubLobbyAfterDuel:
ld hl, .after_duel_table
call FindEndOfDuelScript
ret
... and then in the .after_duel_table it lists a bunch of new scripts designed to figure out what happens if the PC loses or wins. However, Ishihara's house notably does not have this after duel script, so when I try to put one in, it gives me this:
error: src/main.asm(26) -> src/engine/overworld/scripting.asm(2049) -> src/scripts/ishiharas_house.asm(198): Unknown symbol "IshiharasHouseAfterDuel.after_duel_table"
Inserting the "ld hl..." script into various other premade scripts/symbols does nothing.
So basically, I need to create a new symbol, "Ishiharashouseafterduel .after_duel_table", and have the game recognize it, then the rest of the code should follow. How would I do this?
EDIT: Code no longer gives an error, but it doesn't do anything after battle.
=================================================================
EDIT: My code is this so far:
This is all at the very end of the script. Insewrting it all at the beginning also does nothing. The error code is no longer present, but the new script doesn't do anything after the result of the battle.
Preload_Ronald1InIshiharasHouse: (Official from the base game)
get_event_value EVENT_RECEIVED_LEGENDARY_CARDS
cp TRUE
ccf
ret
IshiharasHouseAfterDuel: (New)
ld hl, .after_duel_table
call FindEndOfDuelScript
ret
.after_duel_table (New)
db NPC_RONALD1
db NPC_RONALD1
dw Script_BeatRonald1
dw Script_LostToRonald1
db $00
Script_Ronald: (Old but text has been edited)
start_script
jump_if_event_true EVENT_RONALD_TALKED, .ows_dc55
max_out_event_value EVENT_RONALD_TALKED
print_text_quit_fully Text073f
.ows_dc55
print_npc_text Text0740
ask_question_jump Text0741, .ows_dc60 (Asks if player wants to duel)
print_text_quit_fully Text0742
.ows_dc60
set_dialog_npc NPC_RONALD1
start_duel PRIZES_6, LEGENDARY_RONALD_DECK_ID, MUSIC_DUEL_THEME_3 (This part is new)
print_text_quit_fully Text0743
Script_BeatRonald1: (new)
start_script
print_npc_text Text0658
give_booster_packs BOOSTER_EVOLUTION_PSYCHIC, BOOSTER_EVOLUTION_PSYCHIC, NO_BOOSTER
print_npc_text Text0659
quit_script_fully
Script_LostToRonald1: (new)
start_script
print_text_quit_fully Text065a
Last edited: