The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Script Not Working

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old June 23rd, 2019 (6:02 PM).
JerdTheBird72 JerdTheBird72 is offline
 
Join Date: Aug 2018
Posts: 2
I have tried changing this script in many ways; however, every time, the game freezes upon activation. If you have any ideas to help me fix it, that would be greatly appreciated.

Script:
#dynamic 0x800000
#org @start
checkflag 0x201
if 0x0 goto @movement
end

#org @movement
lock
applymovement 0x6 @m1
waitmovement 0x6
msgbox @t1 0x6
waitkeypress
goto @continue

#org @continue
msgbox @t2 0x6
showpokepic 0x392 0x0A 0x03
waitkeypress
hidepokepic
givepokemon 0x392 0x5 0x0 0x0 0x0 0x0
setflag 0x828
fanfare 0x13E
msgbox @t2 0x4
waitfanfare
closeonkeypress
msgbox @t3 0x5
compare 0x800D 0x1
if 0x1 call @name
fadescreen 0x1
hidesprite 0x06
fadescreen 0x0
setvar 0x4011 0x1
setflag 0x201
release
end

#org @m1
#raw 0x6
#raw 0x29
#raw 0x2C
#raw 0x29
#raw 0x29
#raw 0x2C
#raw 0x2C
#raw 0x2C
#raw 0x2C
#raw 0x29
#raw 0x62
#raw 0xFE

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1
special 0x9E
waitstate
return

#org @t1
= [blue_fr]WAAAAAAAAAAAAAAAIT!!!

#org @t4
= [blue_fr]It is dangerous out there without\la Pok\h1Bmon! Good thing I have an\lextra to spare. Here take this\l[red_fr]Ralts[blue_fr].

#org @t2
= [blue_fr][player] recieved a [red_fr]Ralts[blue_fr]!

#org @t3
= [blue_fr]Would you like to name that\n[red_fr]Ralts[blue_fr]?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 24th, 2019 (3:26 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Since this appears to be a tile script and you're experiencing freezing issues, make sure your script tile has a 'Var number' attached. As for the script itself, here are a few errors/ issues that I found:

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x201
if 0x0 goto @movement
release // The game automatically locks when you step on a script so you need to release the player
end

#org @movement
lock Not needed
applymovement 0x6 @m1
waitmovement 0x0
msgbox @t1 0x6
waitkeypress // Not needed as it is already included in msgbox type 0x6
goto @continue

#org @continue
msgbox @t2 0x6 // Should be @t4
showpokepic 0x188 0x0A 0x03 // Convert Ralts' ID into hexadecimal
waitkeypress
hidepokepic
givepokemon 0x188 0x5 0x0 0x0 0x0 0x0 // Convert Ralts' ID into hexadecimal
setflag 0x828
fanfare 0x13E
msgbox @t2 0x4
waitfanfare
closeonkeypress // Not needed
msgbox @t3 0x5
compare 0x800D 0x1
if 0x1 call @name
fadescreen 0x1
hidesprite 0x6
fadescreen 0x0
setvar 0x4011 0x1
setflag 0x201 // Unnecessary, you're already setting flag 0x828 so its unlikely you need to use this one as well. Just set OW 0x6's ID to 828 and they'll disappear for good
release
end

#org @m1 // The majority of these movements don't make any sense in either FR or Emerald
#raw 0x6
#raw 0x29
#raw 0x2C
#raw 0x29
#raw 0x29
#raw 0x2C
#raw 0x2C
#raw 0x2C
#raw 0x2C
#raw 0x29
#raw 0x62
#raw 0xFE

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1
special 0x9E
waitstate
return

#org @t1
= [blue_fr]WAAAAAAAAAAAAAAAIT!!!

#org @t4
= [blue_fr]It is dangerous out there without\la Pok\h1Bmon! Good thing I have an\lextra to spare. Here take this\l[red_fr]Ralts[blue_fr].

#org @t2
= [blue_fr][player] recieved a [red_fr]Ralts[blue_fr]!

#org @t3
= [blue_fr]Would you like to name that\n[red_fr]Ralts[blue_fr]?


While the above script should work for what you want to do right now, you should consider running the script based upon a variable rather than a flag. Tile scripts that check for flags instead of variables have issues such as interrupting the town/ route name in the top-left corner if they're near the entrance of a map and grinding the player's speed down to zero (this is very noticeable when you're at full speed on a bike). You'll avoid those glitches and even be able to remove the '@start' segment of your script, saving you more space. Check out this thread if you want to learn more about how to have scripts activate based upon a variable~
__________________
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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