Quote:
Originally Posted by acetrainereddie
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
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.