Advertiser Content

Script Script Not Working

Started by JerdTheBird72 June 23rd, 2019 6:02 PM
  • 886 views
  • 1 replies
Seen June 24th, 2019
Posted June 23rd, 2019
2 posts
1 Years
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]?

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 1 Hour Ago
Posted 1 Day Ago
1,605 posts
10 Years
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~
Advertiser Content