The PokéCommunity Forums  

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

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 January 3rd, 2020 (11:25 AM).
acetrainereddie acetrainereddie is offline
 
Join Date: Jan 2019
Posts: 16
Could somebody check over my script and let me know all the errors? I'm new to scripting and to give a Pokémon after this battle, but I keep getting errors. Thanks.


Code:
'---------------
#org 0x163ACB
trainerbattle 0x0 0x255 0x0 0x817AC55 0x817AC82
msgbox 0x817ACA2 MSG_NORMAL '"When lava at the surface of magma\..."
end


'---------
' Strings
'---------
#org 0x17AC55
= Hi! I'm Brendan!

#org 0x17AC82
= Atchah!\nYou're shockingly good!

#dynamic 0x800554


#org 0x17ACA2
= You're great!\nHere, take this!
checkflag 0x1200
if 0x1200 goto @done
if 0x1 goto @givepokemon





#org @done
msgbox @checkup 0x6
release
end

#org @givepokemon
givepokemon 0x196 0x4B 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
setflag 0x1200
msgbox @thanks2 0x6
release

#org @recieved
= \v\h01 recieved a RAYQUAZA!

#org @thanks2
= Great! I think it will have\nmore fun with you than with me.

#org @checkup
= How's Rayquaza doing?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old January 3rd, 2020 (9:44 PM).
Qmer Kaça's Avatar
Qmer Kaça Qmer Kaça is offline
¯\_(ツ)_/¯
 
Join Date: May 2017
Location: The Most Beautiful City in Europe
Gender: Male
Posts: 23
You used trainerbattle 0x0. You need to change it to 0x9(not sure if its the right value, I haven't been hacking for a long time) if you want the script to continue after battle.
__________________
I woke up on the moon.
I saw that beauty.
I cried till it's noon.
Nobody saw me lonely.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old January 4th, 2020 (1:46 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
Quote:
Originally Posted by acetrainereddie View Post
Could somebody check over my script and let me know all the errors? I'm new to scripting and to give a Pokémon after this battle, but I keep getting errors. Thanks.
Here's a working version, with major changes in red with explanations. You didn't say which ROM this is for, but I assume it is for FR:

Code:
#dynamic 0x800000 // Always put the #dynamic preprocessing directive at the beginning of your script

#org @start // Unless you know what you're doing, always use dynamic pointers (beginning with @) instead of static pointers (starting with 0x8). You're liable to overwrite data in the ROM otherwise
trainerbattle 0x1 0x255 0x0 @before @after @later // In this script, it would be best to use a 0x1 type trainer battle. If the player wins, the script goes on to continue at @later. It also avoids the need for flag checking. Speaking of flags, check this thread to learn which ones are safe to use in FR as 0x1200 is absolutely not safe,
msgbox @checkup 0x2 // When you're scripting an NPC, it good to use msgbox type 0x2 as it will make the NPC stop moving and face the player without the need for extra commands
release
end

#org @later
msgbox @great 0x2 //same as above
givepokemon 0x196 0x4B 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @recieved 0x6
waitfanfare
msgbox @thanks2 0x6
release
end

#org @before
= Hi! I'm Brendan!

#org @after
= Atchah!\nYou're shockingly good!

#org @great // In your original script, you had this text pointer flow on into other scripting commands which is impossible to do and will result in errors/ garbage data
= You're great!\nHere, take this!

#org @recieved
= [black_em]\v\h01 recieved a RAYQUAZA!

#org @thanks2
= Great! I think it will have\nmore fun with you than with me.

#org @checkup
= How's Rayquaza doing?
Due to the number of errors in this script/ it layout, I'd suggest taking it a bit slower and taking each command one step at a time. Pay close attention to your pointers and keep everything dynamic where possible.

Quote:
Originally Posted by Qmer Kaça View Post
You used trainerbattle 0x0. You need to change it to 0x9(not sure if its the right value, I haven't been hacking for a long time) if you want the script to continue after battle.
trainerbattle 0x9 is for Oak's Tutorial battle with your rival at the beginning of FRLG.
__________________
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old January 4th, 2020 (7:12 AM).
acetrainereddie acetrainereddie is offline
 
Join Date: Jan 2019
Posts: 16
Thanks!
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:15 AM.