The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script [Fire Red] I modified a script and now some other don't occur as supposed to (https://www.pokecommunity.com/showthread.php?t=431773)

McPaul March 2nd, 2020 11:58 AM

[Fire Red] I modified a script and now some other don't occur as supposed to
 
I changed Oak's script in his lab.

Here it is:

Spoiler:
'---------------
#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x2
if 0x1 goto @snippet1
compare 0x4055 0x9
if 0x1 goto @snippet2
compare 0x4055 0x8
if 0x1 goto @snippet3
checkflag 0x828
if 0x0 goto @snippet4
checkitem 0x15D 0x1
if 0x0 goto @snippet5
compare 0x4055 0x5
if 0x0 goto @snippet5
if 0x1 goto @snippet6
compare 0x4055 0x3
if 0x1 goto @snippet7
call @snippet8
closeonkeypress
end

'---------------
#org @snippet1
msgbox @string1 MSG_KEEPOPEN '"Thank you, [player]!\nSincerely, t..."
release
end

'---------------
#org @snippet2
call @snippet8
checkflag 0x2F4
if 0x1 goto @snippet9
release
end

'---------------
#org @snippet3
msgbox @string2 MSG_KEEPOPEN '"POKéMON around the world wait for\..."
release
end

'---------------
#org @snippet4
msgbox @string3 MSG_FACE '"OAK: Now, [player].\pInside those ..."
release
end

'---------------
#org @snippet5
msgbox @string4 MSG_KEEPOPEN '"OAK: [player], raise your young\nP..."
release
end

'---------------
#org @snippet6
msgbox @string5 MSG_KEEPOPEN '"OAK: Oh, [player]!\nHow is my old ..."
textcolor 0x3
fanfare 0x105
preparemsg @string6 '"[player] delivered OAK'S PARCEL."
waitmsg
waitfanfare
removeitem 0x15D 0x1
closeonkeypress
pause 0x46
textcolor 0x0
msgbox @string7 MSG_KEEPOPEN '"Ah! \nIt's the custom POKé BALL!\p..."
closeonkeypress
pause 0x1E
textcolor 0x0
msgbox @string8 MSG_KEEPOPEN '"Ah, your timing is perfect,\n[play..."
goto @snippet10

'---------------
#org @snippet7
msgbox @string9 MSG_KEEPOPEN '"OAK: If a wild POKéMON appears,\ny..."
release
end

'---------------
#org @snippet8
special 0x187
compare LASTRESULT 0x2
if 0x1 goto @snippet11
special 0x188
checkflag 0x2F4
if 0x1 call @snippet12
checkflag 0x2F4
if 0x0 call @snippet13
call @snippet14
return

'---------------
#org @snippet9
closeonkeypress
pause 0x28
preparemsg @string10 '"Wroooooooaaaaaarrrr!"
waitmsg
compare PLAYERFACING 0x2
if 0x1 call @snippet15
compare PLAYERFACING 0x1
if 0x1 call @snippet16
compare PLAYERFACING 0x4
compare PLAYERFACING 0x3
if 0x1 call @snippet17
applymovement 0x4 @move1
waitmovement 0x0
closeonkeypress
pause 0x46
msgbox @string1 MSG_KEEPOPEN '"Thank you, [player]!\nSincerely, t..."
setflag 0x2
release
end

'---------------
#org @snippet10
msgbox @string11 MSG_KEEPOPEN '"My friend PROF. ELM just came to\n..."
closeonkeypress
compare PLAYERFACING 0x2
if 0x1 call @snippet18
compare PLAYERFACING 0x1
if 0x1 call @snippet19
compare PLAYERFACING 0x4
if 0x1 call @snippet20
compare PLAYERFACING 0x3
if 0x1 call @snippet20
textcolor 0x0
msgbox @string12 MSG_KEEPOPEN '"[rival]: Hey, I heard that!\pGramp..."
fadedefault
textcolor 0x0
msgbox @string13 MSG_KEEPOPEN '"OAK: I know, I know.\nOf course I ..."
compare PLAYERFACING 0x2
if 0x1 call @snippet21
compare PLAYERFACING 0x3
if 0x1 call @snippet22
textcolor 0x3
msgbox @string14 MSG_KEEPOPEN '"PROF. OAK took both POKéDEX\nunits..."
closeonkeypress
call @snippet23
compare PLAYERFACING 0x2
if 0x1 call @snippet24
compare PLAYERFACING 0x1
if 0x1 call @snippet25
compare PLAYERFACING 0x4
if 0x1 call @snippet26
compare PLAYERFACING 0x3
if 0x1 call @snippet27
showsprite 0x9
showsprite 0xA
pause 0x1E
msgbox @string15 MSG_KEEPOPEN '"[.] [.] [.] [.] [.] [.]\p[.] [.] [..."
closeonkeypress
hidesprite 0x9
hidesprite 0xA
pause 0x1E
compare PLAYERFACING 0x2
if 0x1 call @snippet28
compare PLAYERFACING 0x1
if 0x1 call @snippet29
compare PLAYERFACING 0x4
if 0x1 call @snippet30
compare PLAYERFACING 0x3
if 0x1 call @snippet31
textcolor 0x3
fanfare 0x13E
preparemsg @string16 '"[player]'s POKéDEX was upgraded!"
waitmsg
waitfanfare
call @snippet23
special 0x16F
textcolor 0x0
msgbox @string17 MSG_KEEPOPEN '"Oh! And have you ever heard of the..."
setvar 0x4076 0x5
additem 0x170 0x1
setflag 0x846
textcolor 0x3
fanfare 0x13E
preparemsg @string18 '"[player] recieved the RAINBOW PASS..."
waitmsg
waitfanfare
fanfare 0x13E
call @snippet32
textcolor 0x0
msgbox @string19 MSG_KEEPOPEN '"With this pass you can take a\nfer..."
textcolor 0x0
msgbox @string20 MSG_KEEPOPEN '"Now, [player] and [rival]!\pYou re..."
textcolor 0x0
msgbox @string21 MSG_KEEPOPEN '"[rival]: Gramps, calm down.\nDon't..."
closeonkeypress
playsong 0x13C 0x0
compare PLAYERFACING 0x2
if 0x1 call @snippet33
compare PLAYERFACING 0x1
if 0x1 call @snippet34
compare PLAYERFACING 0x4
if 0x1 call @snippet34
compare PLAYERFACING 0x3
if 0x1 call @snippet34
hidesprite 0x8
fadedefault
setvar 0x4055 0x8
releaseall
end

'---------------
#org @snippet11
release
end

'---------------
#org @snippet12
msgbox @string22 MSG_KEEPOPEN '"OAK: Ah, welcome!\pTell me, how is..."
return

'---------------
#org @snippet13
msgbox @string23 MSG_KEEPOPEN '"OAK: Now let's see[.]\nHow is your..."
return

'---------------
#org @snippet14
setvar 0x8004 0x1F
special 0x17E
special 0x17D
setvar 0x8004 0x0
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
copyvar 0x800A LASTRESULT
buffernumber 0x0 0x8008
buffernumber 0x1 0x8009
msgbox @string24 MSG_KEEPOPEN '"The amount of progress you've made..."
checkflag 0x2FF
if 0x0 call @snippet35
call @snippet36
compare 0x800A 0x0
if 0x1 goto @snippet37
setvar 0x8004 0x1
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
buffernumber 0x0 0x8008
buffernumber 0x1 0x8009
msgbox @string25 MSG_KEEPOPEN '"And your NATIONAL POKéDEX is:\p[bu..."
special2 LASTRESULT 0x1B0
compare LASTRESULT 0x0
if 0x1 goto @snippet38
compare LASTRESULT 0x1
if 0x1 goto @snippet39
end

'---------------
#org @snippet15
applymovement 0x4 @move2
waitmovement 0x0
return

'---------------
#org @snippet16
applymovement 0x4 @move3
waitmovement 0x0
return

'---------------
#org @snippet17
applymovement 0x4 @move4
waitmovement 0x0
return

'---------------
#org @snippet18
movesprite2 0x8 0x5 0xA
showsprite 0x8
playsong 0x13B 0x0
applymovement MOVE_PLAYER @move5
applymovement 0x8 @move6
waitmovement 0x0
return

'---------------
#org @snippet19
movesprite2 0x8 0x6 0xA
showsprite 0x8
playsong 0x13B 0x0
applymovement 0x4 @move7
applymovement 0x8 @move6
waitmovement 0x0
return

'---------------
#org @snippet20
movesprite2 0x8 0x6 0xA
showsprite 0x8
playsong 0x13B 0x0
applymovement 0x4 @move7
applymovement MOVE_PLAYER @move8
applymovement 0x8 @move6
waitmovement 0x0
return

'---------------
#org @snippet21
applymovement MOVE_PLAYER @move9
waitmovement 0x0
return

'---------------
#org @snippet22
applymovement MOVE_PLAYER @move10
waitmovement 0x0
return

'---------------
#org @snippet23
copyvar 0x8012 0x8013
return

'---------------
#org @snippet24
applymovement 0x4 @move11
waitmovement 0x0
return

'---------------
#org @snippet25
applymovement 0x4 @move12
applymovement MOVE_PLAYER @move13
applymovement 0x8 @move13
waitmovement 0x4
return

'---------------
#org @snippet26
applymovement 0x4 @move11
applymovement MOVE_PLAYER @move14
waitmovement 0x4
return

'---------------
#org @snippet27
applymovement 0x4 @move11
waitmovement 0x0
return

'---------------
#org @snippet28
applymovement 0x4 @move15
waitmovement 0x0
return

'---------------
#org @snippet29
applymovement 0x4 @move16
waitmovement 0x0
return

'---------------
#org @snippet30
applymovement 0x4 @move15
applymovement MOVE_PLAYER @move17
waitmovement 0x0
return

'---------------
#org @snippet31
applymovement 0x4 @move15
waitmovement 0x0
return

'---------------
#org @snippet32
copyvar 0x8012 0x8013
return

'---------------
#org @snippet33
applymovement MOVE_PLAYER @move8
applymovement 0x8 @move18
waitmovement 0x0
return

'---------------
#org @snippet34
applymovement 0x8 @move18
waitmovement 0x0
return

'---------------
#org @snippet35
textcolor 0x0
return

'---------------
#org @snippet36
copyvar 0x8004 0x8009
special 0xD5
waitmsg
compare LASTRESULT 0x0
if 0x1 call @snippet40
compare LASTRESULT 0x1
if 0x1 call @snippet41
waitfanfare
waitkeypress
return

'---------------
#org @snippet37
special 0x17F
return

'---------------
#org @snippet38
msgbox @string26 MSG_KEEPOPEN '"I'll be looking forward to seeing\..."
goto @snippet37

'---------------
#org @snippet39
setflag 0x2F4
msgbox @string27 MSG_KEEPOPEN '"Finally[.]\pYou've finally complet..."
goto @snippet37

'---------------
#org @snippet40
fanfare 0x13D
return

'---------------
#org @snippet41
fanfare 0x103
return


'---------
' Strings
'---------
#org @string1
= Thank you, [player]!\nSincerely, thank you!\lYou've made my dream a reality!

#org @string2
= POKéMON around the world wait for\nyou, [player]!

#org @string3
= OAK: Now, [player].\pInside those three POKé BALLS are\nPOKéMON.\pWhich one will you choose for\nyourself?

#org @string4
= OAK: [player], raise your young\nPOKéMON by making it battle.\pIt has to battle for it to grow.

#org @string5
= OAK: Oh, [player]!\nHow is my old POKéMON?\pWell, it seems to be growing more\nattached to you.\pYou must be talented as a POKéMON\nTRAINER.\pWhat's that?\nYou have something for me?

#org @string6
= [player] delivered OAK'S PARCEL.

#org @string7
= Ah! \nIt's the custom POKé BALL!\pI had it on order.\nThank you!

#org @string8
= Ah, your timing is perfect,\n[player]!\lI need you to listen closely.

#org @string9
= OAK: If a wild POKéMON appears,\nyour POKéMON can battle it.\pWith it at your side, you should be\nable to reach the next town.

#org @string10
= Wroooooooaaaaaarrrr!

#org @string11
= My friend PROF. ELM just came to\nvisit me with his pockets full of\lnew data!\pWith these your POKéDEX will be\lmore...

#org @string12
= [rival]: Hey, I heard that!\pGramps, what's with favoring\n[player] over me all the time?\pI went and collected more POKéMON,\nand faster, too.\pYou should just let me handle\neverything.

#org @string13
= OAK: I know, I know.\nOf course I need your help, too.\pNow, I need to see both your\nPOKéDEXES.

#org @string14
= PROF. OAK took both POKéDEX\nunits.

#org @string15
= [.] [.] [.] [.] [.] [.]\p[.] [.] [.] [.] [.] [.]\p[.]And that's done!\pNow these units can record data on\na lot more POKéMON.

#org @string16
= [player]'s POKéDEX was upgraded!

#org @string17
= Oh! And have you ever heard of the\nHMs?\pNowadays you don't need to teach\nthem anymore. Just fill your party\pwith different types of POKéMON\nand see what they can do.\pI will give you a RAINBOW PASS as\nwell.

#org @string18
= [player] recieved the RAINBOW PASS!

#org @string19
= With this pass you can take a\nferry in VERMILION CITY and sail\pacross the SEVII ISLANDS!\pOur POKéMON world is endless, go\nexplore it all!

#org @string20
= Now, [player] and [rival]!\pYou really must work towards\nfilling your POKéDEXES.\pI urge you to make them the best\nand the most complete of all time!\pTruly, this is a monumentally great\nundertaking in POKéMON history!

#org @string21
= [rival]: Gramps, calm down.\nDon't get so excited.\pI'll get the POKéDEX completed,\ndon't you worry about a thing.\pAnyways, I'm outta here!

#org @string22
= OAK: Ah, welcome!\pTell me, how is your POKéDEX\ncoming along?\pWahaha!\pActually, I know how it is, but I\nlove seeing it anyway!\pLet's see[.]

#org @string23
= OAK: Now let's see[.]\nHow is your POKéDEX coming along?\pHere, let me take a look.

#org @string24
= The amount of progress you've made\non your POKéDEX is:\p[buffer1] POKéMON seen and\n[buffer2] POKéMON owned.\p\c\h06ÁPROF. OAK's rating:

#org @string25
= And your NATIONAL POKéDEX is:\p[buffer1] POKéMON seen and\n[buffer2] POKéMON owned.

#org @string26
= I'll be looking forward to seeing\nyou fill the NATIONAL POKéDEX!

#org @string27
= Finally[.]\pYou've finally completed the\nPOKéDEX!\pIt's magnificent!\nTruly, this is a fantastic feat!


'-----------
' Movements
'-----------
#org @move1
#raw 0x4A 'Face Player
#raw 0xFE 'End of Movements

#org @move2
#raw 0x25 'Step on the Spot Down (Faster)
#raw 0x29 'Step on the Spot Down (Fastest)
#raw 0x25 'Step on the Spot Down (Faster)
#raw 0x25 'Step on the Spot Down (Faster)
#raw 0x29 'Step on the Spot Down (Fastest)
#raw 0x25 'Step on the Spot Down (Faster)
#raw 0xFE 'End of Movements

#org @move3
#raw 0x26 'Step on the Spot Up (Faster)
#raw 0x2A 'Step on the Spot Up (Fastest)
#raw 0x26 'Step on the Spot Up (Faster)
#raw 0x26 'Step on the Spot Up (Faster)
#raw 0x2A 'Step on the Spot Up (Fastest)
#raw 0x26 'Step on the Spot Up (Faster)
#raw 0xFE 'End of Movements

#org @move4
#raw 0x28 'Step on the Spot Right (Faster)
#raw 0x2C 'Step on the Spot Right (Fastest)
#raw 0x28 'Step on the Spot Right (Faster)
#raw 0x28 'Step on the Spot Right (Faster)
#raw 0x2C 'Step on the Spot Right (Fastest)
#raw 0x28 'Step on the Spot Right (Faster)
#raw 0xFE 'End of Movements

#org @move5
#raw 0x2D 'Face Down (Delayed)
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org @move6
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @move7
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements

#org @move8
#raw 0x1A 'Delay3
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements

#org @move9
#raw 0x2E 'Face Up (Delayed)
#raw 0xFE 'End of Movements

#org @move10
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org @move11
#raw 0x11 'Step Up (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x2E 'Face Up (Delayed)
#raw 0x1C 'Delay5
#raw 0x1A 'Delay3
#raw 0xFE 'End of Movements

#org @move12
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x1C 'Delay5
#raw 0x1A 'Delay3
#raw 0xFE 'End of Movements

#org @move13
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org @move14
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x2E 'Face Up (Delayed)
#raw 0xFE 'End of Movements

#org @move15
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @move16
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

#org @move17
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x30 'Face Right (Delayed)
#raw 0xFE 'End of Movements

#org @move18
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements


And now two things went wrong:

- Rival don't come to fight the player anymore on Route 22

- The Old Man in Viridian City stays drunk af and don't let me pass anymore even when I have the Pokédex.

I know I should change the map scripts on Route 22 and Viridian for the events to happen again but I don't know how. The best would be to check the flag 0x846 set when Oak gives me the Rainbow Pass in his lab, but I don't know exactly how.

Could someone help me? Thanks a whole lot!

EDIT: I found out! Damn I feel like I'm getting better at this shit!

McPaul March 3rd, 2020 4:03 AM

My thread is sinking.

I'm still trying to modify the scripts by myself but nothing works.


All times are GMT -8. The time now is 9:14 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.