• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Script help.

16
Posts
5
Years
    • Seen May 1, 2021
    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?
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • 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:
    [COLOR="Red"]#dynamic 0x800000[/COLOR] // Always put the #dynamic preprocessing directive at the beginning of your script
    
    [COLOR="Red"]#org @start[/COLOR] // 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 [COLOR="Red"]0x1[/COLOR] 0x255 0x0 @before @after [COLOR="Red"]@later[/COLOR] // 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, [URL="https://www.pokecommunity.com/showthread.php?t=302347"]check this thread[/URL] to learn which ones are safe to use in FR as 0x1200 is absolutely not safe,
    msgbox @checkup [COLOR="Red"]0x2[/COLOR] // 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 [COLOR="Red"]0x2[/COLOR] //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 [COLOR="Red"]@great[/COLOR] // 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.

    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.
     
    Back
    Top