Teh Blazer
Divider of Zero
- 779
- Posts
- 16
- Years
- 'MERICA
- Seen today
I am attempting to make a script that makes Oak give you the national dex after you fight your rival before you leave his lab. I have the movement working that brings you front and center to Oak but nothing continues after that. Thanks for any help.
Spoiler:#org 0x877021F
'-----------------------------------
lockall
setvar 0x4002 0x1
jump 0x877022A
#org 0x877022A
'-----------------------------------
textcolor BLUE
playsound 0x1 0x1
msgbox 0x87703FE ' OAK: Wait \v\h01!
callstd MSG_NOCLOSE ' Non-closing message
closemsg
compare 0x4002 0x1
if == jump 0x877040C ' Equal To
compare 0x4002 0x2
if == jump 0x8770417 ' Equal To
compare 0x4002 0x3
if == jump 0x8770422 ' Equal To
textcolor BLUE
playsound 0x1 0x22
msgbox 0x87703E2 ' OAK: \v\h01 take thi...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
pauseevent 0x0
disappear 0x9
disappear 0x10
disappear 0x12
pause 0xA
textcolor GRAY
fanfare 0x13E
message 0x87703BA ' \v\h01 received the ...
showmsg
waitfanfare
call 0x87703B4
special FR_NATIONAL_DEX
msgbox 0x87702AF ' To make a complete g...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
playsound 0x22 0x22
fadedefault
setvar 0x4055 0x6
setvar 0x4057 0x2
setvar 0x4051 0x1
setvar 0x4058 0x1
setvar 0x4054 0x1
release
end
#org 0x877040C
'-----------------------------------
applymovement PLAYER 0x877042D ' walk_up walk_up walk...
pauseevent 0x0
return
#org 0x8770417
'-----------------------------------
applymovement PLAYER 0x8770434 ' walk_left walk_up wa...
pauseevent 0x0
return
#org 0x8770422
'-----------------------------------
applymovement PLAYER 0x877043D ' walk_right walk_up w...
pauseevent 0x0
return
#org 0x87703B4
'-----------------------------------
copyvar 0x8012 0x8013
return
#org 0x87703FE
= OAK: Wait \v\h01!
#org 0x87703E2
= OAK: \v\h01 take this with you.
#org 0x87703BA
= \v\h01 received the POK\eDEX\nfrom PROF. OAK.
#org 0x87702AF
= To make a complete guide on all\nthe POK\eMON in the world[.]\pThat was my dream!\pBut, I'm too old.\nI can't get the job done.\pSo, I want you to fulfill my\ndream for me.\pGet moving.\pThis is a great undertaking in\nPOK\eMON history!\nI will give \v\h06 and \v\h07 theirs later.
#org 0x877042D
M walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x8770434
M walk_left walk_up walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x877043D
M walk_right walk_up walk_up walk_up walk_up walk_up walk_up walk_up end
I'm not well versed in pksv (at least, I think that is) but where you compare the variable 4002, is the jumpcommand after that the one that allows you to return to your previous script? Like in xse, there is "call" and "goto". "Goto" means to go to the next part while "call" means to to the next part but you can return back to the original script at the spot you called it. Did you use the correct command that lets you use return with it?
When editing a very long script in a game, would it be viable to add any stuff that you want to implement and leave the rest as is? For example, I would like to have Wallace's dialogue and team change in Emerald after the first Hall of Fame; (similar to the newer games) however, it turns out that the script for the champ battle is over 300 lines long and would take ages to replicate, unlike the E4 scripts. Here's the dump from the ROM
Spoiler:'---------------
#org 0x228A1E
lockall
applymovement MOVE_PLAYER 0x82725C1
waitmovement 0x0
pause 0x28
applymovement MOVE_PLAYER 0x8228A42
waitmovement 0x0
setvar 0x4001 0x1
goto 0x8228A45
'---------------
#org 0x228A45
playsong 0x1C6 0x0
msgbox 0x8228C4C MSG_KEEPOPEN '"Wallace: Welcome, [player]\v\h05.\..."
trainerbattle 0x3 0x14F 0x0 0x8228EAC
goto 0x8228A61
'---------------
#org 0x228A61
sound 0x8
setmaptile 0x6 0x1 0x346 0x0
setmaptile 0x6 0x2 0x347 0x0
special 0x91
msgbox 0x8228F66 MSG_KEEPOPEN '"Wallace: The Pokémon you sent into..."
closeonkeypress
sound 0x8
checkgender
compare LASTRESULT 0x0
if 0x1 call 0x8228ABC
compare LASTRESULT 0x1
if 0x1 call 0x8228AC1
showsprite 0x2
call 0x8228BFD
checkgender
compare LASTRESULT 0x0
if 0x1 goto 0x8228AC6
compare LASTRESULT 0x1
if 0x1 goto 0x8228AFB
end
'---------------
#org 0x228ABC
playsong 0x19F 0x0
return
'---------------
#org 0x228AC1
playsong 0x1A5 0x0
return
'---------------
#org 0x228BFD
applymovement 0x2 0x8228C26
waitmovement 0x0
applymovement MOVE_PLAYER 0x82725A4
waitmovement 0x0
return
'---------------
#org 0x228AC6
msgbox 0x82290CA MSG_KEEPOPEN '"May: [player]\v\h05!\pHere's some ..."
pause 0x28
sound 0x15
applymovement 0x2 0x8272598
waitmovement 0x0
applymovement 0x2 0x827259A
waitmovement 0x0
call 0x8228C12
msgbox 0x822910B MSG_KEEPOPEN '"May: Huh?\nWhat, what, what?\p[pla..."
goto 0x8228B30
'---------------
#org 0x228AFB
msgbox 0x8229152 MSG_KEEPOPEN '"Brendan: [player]!\pHow would you ..."
pause 0x28
sound 0x15
applymovement 0x2 0x8272598
waitmovement 0x0
applymovement 0x2 0x827259A
waitmovement 0x0
call 0x8228C12
msgbox 0x82291A2 MSG_KEEPOPEN '"Brendan: [player][.]\pAre you tryi..."
goto 0x8228B30
'---------------
#org 0x228C12
applymovement 0x2 0x8228C2F
waitmovement 0x0
return
'---------------
#org 0x228B30
closeonkeypress
showsprite 0x3
applymovement 0x3 0x8228C43
waitmovement 0x0
applymovement MOVE_PLAYER 0x82725A8
waitmovement 0x0
msgbox 0x82291E6 MSG_KEEPOPEN '"Prof. Birch: See?\nWhat did I tell..."
call 0x8272184
msgbox 0x822934D MSG_KEEPOPEN '"Prof. Birch: Anyways,\ncongratulat..."
applymovement 0x1 0x82725A6
waitmovement 0x0
pause 0x14
applymovement 0x1 0x82725AA
waitmovement 0x0
msgbox 0x8229399 MSG_KEEPOPEN '"Wallace: [player]\v\h05[.]\pNo, le..."
closeonkeypress
pause 0x1E
applymovement 0x1 0x8228C3B
applymovement MOVE_PLAYER 0x8228C1D
applymovement 0x3 0x82725A6
applymovement 0x2 0x8228C38
waitmovement 0x0
pause 0x14
applymovement MOVE_PLAYER 0x82725AA
waitmovement 0x0
msgbox 0x82293EB MSG_KEEPOPEN '"Wallace: I'm sorry, but[.]\pFrom h..."
checkgender
compare LASTRESULT 0x0
if 0x1 call 0x8228BEB
compare LASTRESULT 0x1
if 0x1 call 0x8228BF4
closeonkeypress
applymovement 0x1 0x8228C3F
applymovement MOVE_PLAYER 0x8228C20
waitmovement 0x0
setflag 0x30D
warp 0x10 0xB 0xFF 0x7 0x10
waitstate
releaseall
end
'---------------
#org 0x272184
setvar 0x8004 0x0
special2 LASTRESULT 0xD7
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
copyvar 0x800A LASTRESULT
buffernumber 0x0 0x8008
buffernumber 0x1 0x8009
msgbox 0x82A5D2C MSG_KEEPOPEN '"Hmhm[.]\pSo, you've seen [buffer1]..."
call 0x8272179
compare 0x800A 0x0
if 0x1 goto 0x827374E
setvar 0x8004 0x1
special2 LASTRESULT 0xD7
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
buffernumber 0x0 0x8008
buffernumber 0x1 0x8009
msgbox 0x82A633D MSG_KEEPOPEN '"Hmhm[.]\nOn a nationwide basis[.]\..."
return
'---------------
#org 0x228BEB
msgbox 0x8229479 MSG_KEEPOPEN '"May: Groan[.]\p[.] [.] [.] [.] [.]..."
return
'---------------
#org 0x228BF4
msgbox 0x82294F5 MSG_KEEPOPEN '"Brendan: Whaaaat?! [.] [.] [.] [.]..."
return
'---------------
#org 0x272179
copyvar 0x8004 0x8009
special 0xD8
waitmsg
waitkeypress
return
'---------------
#org 0x27374E
return
'---------
' Strings
'---------
#org 0x228C4C
= Wallace: Welcome, [player]\v\h05.\pThat incident in Sootopolis City[.]\nThat was superb work, putting an end\lto that crisis all by yourself.\pOops!\pIt wouldn't be fair to say that you\nalone ended the crisis.\pYou overcame that difficult situation\nby working as one with your Pokémon.\pWe trainers raise Pokémon by giving\nthem items and by teaching them new\ltechniques for battle.\pBut we ourselves also learn many\nthings from Pokémon.\pAnd this is where your achievements\nare put to the test against what\lothers like you have achieved.\pNow!\pWho can most elegantly dance with\ntheir Pokémon in Hoenn?\pShow me right here and now!
#org 0x228EAC
= I, the Champion, fall in defeat[.]\pThat was wonderful work.\nYou were elegant, infuriatingly so.\lAnd yet it was utterly glorious!\pKudos to you, [player]\v\h05!\pYou are a truly noble Pokémon\nTrainer!
#org 0x228F66
= Wallace: The Pokémon you sent into\nbattle[.]\pAt times they danced like a spring\nbreeze, and at times they struck\llike lightning.\pIt was with light, yet surefooted,\nelegance that you led your Pokémon.\pEven I felt bedazzled by your\nmasterful performance!\pYou now stand at the glorious peak\nof the Pokémon League.\pI now proclaim you to be the new\nHoenn region[.]
#org 0x2290CA
= May: [player]\v\h05!\pHere's some advice before you challenge\nthe Champion[.]
#org 0x22910B
= May: Huh?\nWhat, what, what?\p[player]\v\h05[.]\nCould it be that[.]\lIt's already over?
#org 0x229152
= Brendan: [player]!\pHow would you like some advice before\nyou challenge the Champion?[.]
#org 0x2291A2
= Brendan: [player][.]\pAre you trying to tell me[.]\nYou've beaten the Champion?
#org 0x2291E6
= Prof. Birch: See?\nWhat did I tell you, [rival]?\pDidn't I tell you that you don't need\nto worry about [player]\v\h05?\p[.] [.] [.] [.] [.] [.] [.] [.]\n[player]\v\h05, you've finally done it.\pWhen I heard that you defeated your\nown father at the Petalburg Gym,\lI thought perhaps you had a chance[.]\pBut to think you've actually become\nthe Champion!\pAh, yes!\pWhat became of your Pokédex?\nHere, let me see.
#org 0x22934D
= Prof. Birch: Anyways,\ncongratulations!\pNow, go proudly into the final room!
#org 0x229399
= Wallace: [player]\v\h05[.]\pNo, let me rephrase that properly.\pThe new Champion!\pCome with me.
#org 0x2293EB
= Wallace: I'm sorry, but[.]\pFrom here on, only those trainers who\nhave become Champions may enter.\pYou'll have to wait outside with\nProf. Birch.
#org 0x2A5D2C
= Hmhm[.]\pSo, you've seen [buffer1] Pokémon,\nand you've caught [buffer2] Pokémon[.]
#org 0x2A633D
= Hmhm[.]\nOn a nationwide basis[.]\pYou've seen [buffer1] Pokémon,\nand you've caught [buffer2] Pokémon[.]
#org 0x229479
= May: Groan[.]\p[.] [.] [.] [.] [.] [.] [.] [.]\n[.] [.] [.] [.] [.] [.] [.] [.]\pI'm just joking! That's okay!\nThat's the rule!\p[player]\v\h05!\nHonestly, congratulations!
#org 0x2294F5
= Brendan: Whaaaat?! [.] [.] [.] [.] [.]\n[.] [.] [.] [.] [.] [.] [.] [.]\pIt can't be helped if that's the rule.\p[player], way to go!\nCongratulations!
'-----------
' Movements
'-----------
#org 0x2725C1
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
#org 0x228A42
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
#org 0x228C26
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xA 'Step Left (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725A4
#raw 0x27 'Step on the Spot Left (Fastest)
#raw 0xFE 'End of Movements
#org 0x272598
#raw 0x56 'Exclamation Mark (!)
#raw 0xFE 'End of Movements
#org 0x27259A
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#org 0x228C2F
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0x14 'Delay5
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0x14 'Delay5
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0x13 'Delay4
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#org 0x228C43
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x27 'Step on the Spot Left (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725A8
#raw 0x28 'Step on the Spot Right (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725A6
#raw 0x26 'Step on the Spot Up (Fastest)
#raw 0xFE 'End of Movements
#org 0x2725AA
#raw 0x25 'Step on the Spot Down (Fastest)
#raw 0xFE 'End of Movements
#org 0x228C3B
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x25 'Step on the Spot Down (Fastest)
#raw 0xFE 'End of Movements
#org 0x228C1D
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
#org 0x228C38
#raw 0xB 'Step Right (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
#org 0x228C3F
#raw 0x9 'Step Up (Normal)
#raw 0x13 'Delay4
#raw 0x54 'Hide
#raw 0xFE 'End of Movements
#org 0x228C20
#raw 0x9 'Step Up (Normal)
#raw 0x14 'Delay5
#raw 0x9 'Step Up (Normal)
#raw 0x13 'Delay4
#raw 0x54 'Hide
#raw 0xFE 'End of Movements
My plan is to insert a check for 0x87F (the HoF flag), redirect to the new "before battle" msgbox and team, then go back to the regular script events. Everything else will be kept untouched. Of course, dynamic and freespace will be put on top to prevent overwriting or corrupting anything. And as usual, help is greatly appreciated!
If you repoint the part of the script that you wanted to change to a free space and left everything else untouched, I'd imagine there'd be no problem.
Last edited: