• 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.

[Archive] Script help thread

Status
Not open for further replies.

linkandzelda

Ex-rom hacker turned indie game developer
777
Posts
17
Years
  • It works now, but there are 2 more problems.

    1. You still can't nickname your pokemon. Actually you can but the script ends.

    2. the clearflag doesn't work.

    if your talking about the clearflag that makes the sprite reapear then add this were you want it to reapear:

    clearflag 0x(people id)
    #raw 0x55
    #raw 0x(people no.)
    #raw 0x00

    i'm not to sure about the nickname bit.

    hope it works now
    link
     

    /Circa

    a face in the clouds.
    881
    Posts
    16
    Years
  • Well, I don't have my PokeScript here because i'm holidays.
    Could someone check if this script is right?

    I'm trying to expand my scripting knowledge.

    Code:
    #org beginscript
    lock
    setflag 0x200
    applymovement 0x1 0x800000
    message 0x800100
    boxset 0x6
    applymovement 0x1 0x800200
    end
    
    #org 0x800100 
    lock
    faceplayer
    message 0x800100 = Hi \v\h01!\pYou might need a Pokemon before\lgoing on your journey!
    givepokemon 0x25 0x5 0x0
    release
    
    #org 0x800000
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x0B
    #raw 0x0B
    #raw 0xFE
    release
    
    #org 0x800200
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x03
    #raw 0xFE
    release
    end
     
    1,104
    Posts
    16
    Years
  • Well, I don't have my PokeScript here because i'm holidays.
    Could someone check if this script is right?

    I'm trying to expand my scripting knowledge.

    Code:
    #org beginscript
    lock
    setflag 0x200
    applymovement 0x1 0x800000
    message 0x800100
    boxset 0x6
    applymovement 0x1 0x800200
    end
    
    #org 0x800100 
    lock
    faceplayer
    message 0x800100 = Hi \v\h01!\pYou might need a Pokemon before\lgoing on your journey!
    givepokemon 0x25 0x5 0x0
    release
    
    #org 0x800000
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x0B
    #raw 0x0B
    #raw 0xFE
    release
    
    #org 0x800200
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x03
    #raw 0xFE
    release
    end

    No that's got quite a few mistakes. I think you should re-read through some tutorials.
    NOTE: This event will repeat, and people no. 0x1, won't be dissapearing, so that the OW, will remain on the screen.

    Code:
    #org (0x??????)    'Since all the others are in a pointer format, this one is wrong.
    lock
    setflag 0x200    '??? What's the point of this? but since there's nothing wrong with it there's no point removing it. 
    applymovement 0x1 0x800000
    pausemove 0      'There needs to be some kind of pause otherwise the movements won't run.
    message 0x800100       'Does not point to another script. It's just pointing to a message.
    boxset 0x6
    givepokemon 0x25 0x5 0x0
    message 0x800010      'I thought you should add something acknowledging the recieving of the Pokemon.
    boxset 0x6
    applymovement 0x1 0x800200
    pausemove 0    'There needs to be some kind of pause otherwise the movements won't run.
    release
    end
    
    #org 0x800100 
    = Hi \v\h01!\pYou might need a Pokemon before\lgoing on your journey!
    
    #org 0x800010
    =\c\h01\h02You recieved a VULPIX
    
    #org 0x800000
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x0B
    #raw 0x0B
    #raw 0xFE   'No need for release, 0xFE marks the end of the movements
    
    #org 0x800200
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x03
    #raw 0xFE    'No need for release, 0xFE marks the end of the movements



    akash said:
    Hey Crashink here is the script-
    This is the first script which I typed in a notepad and then loaded it into script Ed and compiled it etc..
    #org 0x800000
    lock
    faceplayer
    message 0x800100
    boxset 0x02
    end
    #org 0x800100
    = Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
    release
    end

    And here is the second script which I typed in another notepad and loaded it into another script Ed and then compiled it and here it is-
    #org 0x800101
    message 0x800200
    boxset 0x02
    end
    #org 0x800200
    = Beware of pokemon.

    Well the problem is the guy instead of could I get your autograph he says Could I get your beware of pokemon.

    Here's the problem, you're offsets overlap. I fixed so that they'll run properly.

    Code:
    #org 0x800000
    lock
    faceplayer
    message 0x800010
    boxset 0x02
    release
    end
    #org 0x800010
    = Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.

    Code:
    #org 0x800150
    message 0x800160
    boxset 0x02
    release
    end
    #org 0x800160
    = Beware of pokemon.
     
    Last edited:

    Frostbite

    Ace Trainer
    723
    Posts
    19
    Years
  • Need some help.

    The script won't continue and freezes after the trainerbattle is finished.

    HTML:
    #org $start
    checkflag 0x200
    if B_TRUE goto $done
    goto $continue
    
    #org $continue
    applymovement 0x08 $walk1
    pause 0x7
    goto $fight
    
    #org $fight
    trainerbattle 1 0x146 $before $after
    message $angry
    $angry 1 = [RIVAL]: \c\h01\h08ugh[...]\pI still have alot to learn before I\nbattle you again.\pUp ahead is the next town[...]\pI'll always be one step ahead of you,\n[PLAYER]!
    boxset 6
    applymovement 0x08 $run
    pause 0x07
    #raw 53
    #raw 200
    #raw 00
    setflag 0x200
    release
    end
    
    #org $done
    release
    end
    
    #org $before
    $before 1 = [RIVAL]: \c\h01\h08So, [PLAYER].\pI'm guessing that you just finished\ngetting your starter, right?\pWell, talk is cheap!\nLet's battle!
    
    #org $after
    $after 1 = H-how did I loose?!\nI had the upper hand!
    
    #org $walk1
    $walk1 1 ; #binary 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0xFE
    
    #org $run
    $run 1 ; #binary 0x20 0x20 0x20 0x20 0x20 0x20 0xFE

    *Ignore the things in the brackets, those are just some things that will be edited using A-Text.
     

    Roddy

    Absent Scripter
    10
    Posts
    16
    Years
    • Seen May 5, 2008
    This code works, perfectly, but, after the end of the battle, it does not continues the script.

    #org 0x800000
    lock
    faceplayer
    applymovement 0x1 0x800400
    pause 0x50
    message 0x800600
    boxset 0x6
    trainerbattle 0 001 0x800100 0x800200 0x800500
    release
    end

    #org 0x800600
    =Don't even dare to touch it!\pThey are all mine!

    #org 0x800100
    =Prepare!

    #org 0x800200
    =Gah..!

    #org 0x800400
    #raw 0x62
    #raw 0xFE

    #org 0x800700
    #raw 0x01
    #raw 0x01
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0xFE

    #org 0x800500
    message 0x800900
    boxset 0x6
    setflag 0x200
    giveitem 0x3F 1
    applymovement 0x1 0x800700
    release
    end

    #org 0x800900
    =I did not expected this.\1You're indeed a talented person.\pI shall give you this, \nbut I'll face you again.

    Anyone any idea why?



    Thanks for any further help!
     
    Last edited:
    92
    Posts
    16
    Years
  • Does anyone know, how to make a "battle script", but when you lose, the rival says good game and you don't have battle again. Like in FireRed, first battle with Rival.
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Age 33
    • Seen Dec 23, 2023
    Hello pipz. I have a script that cannot be compiled. Wonder what's wrong with it. Please check and thanks in advance... ;)
    Code:
    #org $start
    lock
    faceplayer
    message $sign
    boxset 6
    checkflag 0x249
    if b_true goto $done
    release
    end
    
    #org $done
    message $sign2
    boxset 6
    release
    end
    
    #org $sign
    $sign 1 = CINNABAR ISLAND POKéMON GYM
    
    #org $sign2
    $sign2 1 = BLAINE'S CERTIFIED TRAINERS:\nASH\lGARY\l\v\h01
     

    /Circa

    a face in the clouds.
    881
    Posts
    16
    Years
  • Thanks thethethethe, though I want the OW to remain, just the script not to happen again, what would I do?

    Though I think i'm starting to get these sought of scripts and how they're set out.

    edit:
    I finished redoing the script, it should have people number 1 come to them, say they need a Pokemon, get the pokemon and walk back.
    I've changed it so it only happens once.
    In offset $finished, does it need an end after the release?

    Code:
    #org $startscript
    lock
    applymovement 0x1 $walkingto
    pause 0x10
    message $beforegetting
    boxset 0x6
    givepokemon 0x25 0x5 0x0
    compare LASTRESULT 1
    if B_true goto $finished
    message $gettingpoke
    boxset 0x6
    applymovement 0x1 $gotpoke
    pause 0x10
    release
    end
    
    #org $beforegetting
    = Hi \v\h01!\pYou might need a Pokemon\lbefore going on your journey.
    
    #org $gettingpoke
    =\c\h01\h02You received a Pikachu!
    
    #org $finished
    pause 0x10
    release
    
    #org $walkingto
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x0B
    #raw 0x0B
    #raw 0xFE
    
    #org $gotpoke
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x03
    #raw 0xFE
     
    Last edited:
    1,104
    Posts
    16
    Years
  • Hello pipz. I have a script that cannot be compiled. Wonder what's wrong with it. Please check and thanks in advance... ;)
    Code:
    #org $start
    lock
    faceplayer
    message $sign
    boxset 6
    checkflag 0x249
    if b_true goto $done
    release
    end
    
    #org $done
    message $sign2
    boxset 6
    release
    end
    
    #org $sign
    $sign 1 = CINNABAR ISLAND POKéMON GYM
    
    #org $sign2
    $sign2 1 = BLAINE'S CERTIFIED TRAINERS:\nASH\lGARY\l\v\h01

    It compiled fine for me. Maybe it's a problem in the file name. The name of the rbc can't contain, symbols like ";", ":", "'", "?", "/"....etc. I think you get the point. This also applies to the folder that the script is in.
    So for example this wouldn't work.
    Dragon's den.rbc
    but this would
    Dragons den.rbc

    Need some help.

    The script won't continue and freezes after the trainerbattle is finished.

    Code:
    #org $start
    checkflag 0x200
    if B_TRUE goto $done
    goto $continue
    
    #org $continue
    applymovement 0x08 $walk1
    pause 0x7
    goto $fight
    
    #org $fight
    trainerbattle 1 0x146 $before $after[B] $further[/B]
    end
    
    [B]#org $further[/B]
    message $angry
    $angry 1 = [RIVAL]: \c\h01\h08ugh[...]\pI still have alot to learn before I\nbattle you again.\pUp ahead is the next town[...]\pI'll always be one step ahead of you,\n[PLAYER]!
    boxset 6
    applymovement 0x08 $run
    pause 0x07
    #raw 53
    #raw 200      '[b](People number 200?)[/b]
    #raw 00
    setflag 0x200
    release
    end
    
    #org $done
    release
    end
    
    #org $before
    $before 1 = [RIVAL]: \c\h01\h08So, [PLAYER].\pI'm guessing that you just finished\ngetting your starter, right?\pWell, talk is cheap!\nLet's battle!
    
    #org $after
    $after 1 = H-how did I loose?!\nI had the upper hand!
    
    #org $walk1
    $walk1 1 ; #binary 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0xFE
    
    #org $run
    $run 1 ; #binary 0x20 0x20 0x20 0x20 0x20 0x20 0xFE

    *Ignore the things in the brackets, those are just some things that will be edited using A-Text.

    The problem, is that the trainerbattle continue only after a third pointer. It doesn't actually continue with the script. I guess you can just see in the edited script above.

    Does anyone have the offset for the Running Shoes?
    They're flags. Here they are.
    FR/LG = setflag 0x82F
    R/S = setflag 0x860

    Anyone can help me? It appears to do not work.
    It does work, in fact, but it only appears some strange text.

    Code:
    #org 0x800000
    lock
    faceplayer
    checkflag 0x10A
    if 0x1 goto 0x800500
    message 0x800100
    boxset 0x5
    compare LASTRESULT 0x1
    if 0x1 goto 0x800200
    message 0x800300
    boxset 0x6
    release
    end
    
    #org 0x800100
    =Pick the Pokemon?
    
    #org 0x800200
    message 0x800400
    boxset 0x6
    givepokemon 0x4 0x5 0x2
    setflag 0x10A
    release
    end
    
    #org 0x800400
    =You picked the Pokemon!
    
    #org 0x800500
    message 0x800600
    boxset 6
    release
    end
    
    #org 0x800600
    =Leave it there.

    There were a few mistakes that I fixed. It should run properly now.

    Thanks thethethethe, though I want the OW to remain, just the script not to happen again, what would I do?

    Though I think i'm starting to get these sought of scripts and how they're set out.

    edit:
    I finished redoing the script, it should have people number 1 come to them, say they need a Pokemon, get the pokemon and walk back.
    I've changed it so it only happens once.
    In offset $finished, does it need an end after the release?

    Code:
    #org $startscript
    lock
    checkflag 0x200
    if b_true goto $finished	'Checks if flag 0x200 has been set.
    applymovement 0x1 $walkingto
    pausemove 0       'or [b]pause 0x70[/b], it should have enough pauses for the movements. Or use [b]pausemove 0[/b], That just waits for the movements to end.
    message $beforegetting
    boxset 0x6
    givepokemon [b]0x19[/b] 0x5 0x0         '0x25 = No. 37 = Vulpix.   0x19 = No. 25 = Pikachu
    message $gettingpoke
    boxset 0x6
    applymovement 0x1 $gotpoke
    pausemove 0
    setflag 0x200	'Sets flag 0x200
    release
    end
    
    #org $beforegetting
    = Hi \v\h01!\pYou might need a Pokemon\[b]n[/b]before going on your journey.
    
    #org $gettingpoke
    =\c\h01\h02You received a Pikachu!
    
    #org $finished
    release
    end
    
    #org $walkingto
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x0B
    #raw 0x0B
    #raw 0xFE
    
    #org $gotpoke
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x03
    #raw 0xFE

    A couple of problems still, but not as many.
    I don't think you understand how to prevent things from occuring over and over. It's usually done with flags. Take a look at foullumps tutorial. I think that one explains it the best at the moment (I think Martin's might be clearer when he does it). I've put most of the changes in bold, and explained why I did it.

    Think that helps most of the problems.
     

    /Circa

    a face in the clouds.
    881
    Posts
    16
    Years
  • Oh, so I use setflag for making it not repeat, but I need to make sure I don't clear it.
    I have another script here.

    Code:
    #org $startscript
    lock
    checkflag 0x201
    if B_true goto $endscript
    applymovement 0x5 $theif
    pause 0x10
    applymovement 0x6 $policemen
    pause 0x50
    message $policetalk
    boxset 0x6
    applymovement ox6 $goaway
    pause 0x10
    setflag 0x201
    release
    end
    
    #org $policetalk
    = Argh!\lWhy didn't you stop him?
    
    #org $theif
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org $policemen
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0xFE
    
    #org $goaway
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org $endscript
    pause 0x10
    release
    end
     
    1,104
    Posts
    16
    Years
  • Oh, so I use setflag for making it not repeat, but I need to make sure I don't clear it.
    I have another script here.

    Code:
    #org $startscript
    lock
    checkflag 0x201
    if B_true goto $endscript
    applymovement 0x5 $theif
    pause 0x10
    applymovement 0x6 $policemen
    pause 0x50
    message $policetalk
    boxset 0x6
    applymovement 0x6 $goaway
    pause 0x10
    setflag 0x201
    release
    end
    
    #org $policetalk
    = Argh!\nWhy didn't you stop him?
    
    #org $theif
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x0A
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org $policemen
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0x0A
    #raw 0xFE
    
    #org $goaway
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org $endscript
    release
    end


    Okay everything should run smoothly except for a couple of typos, I'll fix them.

    In $endscript, if you keep the pause 0x10, everytime you walk over the tile after the script is complete, it would pause 0x10 everytime you walked over it. I just removed it.
     

    BlackRainbow*

    Pokemon Coralo Version ?
    519
    Posts
    17
    Years
  • Can anyone Help me with this script?:

    Code:
    #org 0x7B2B00
    checkflag 0x10B
    compare LASTRESULT 0x1
    if 0x1 goto 0x7B2600
    applymovement 0x1 0x7B2C00
    pause 0x30
    message 0x7B2D00
    boxset 0x6
    applymovement 0x1 0x7B2E00
    pause 0x30
    setflag 0x10B
    release 
    end
    
    #org 0x7B2600
    release
    end
    
    #org 0x7B2C00
    #raw 0x62
    #raw 0x13
    #raw 0x13
    #raw 0x01
    #raw 0xFE
    
    #org 0x7B2D00
    = Hello\h01p. Prof.Roman just called me and he said that\nyou have to vist his\nlab. He have a present for you.
    
    #org 0x7B2E00
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE
    It freez when i step on it.
     
    860
    Posts
    17
    Years
  • Can anyone Help me with this script?:

    Code:
    #org 0x7B2B00
    checkflag 0x10B
    compare LASTRESULT 0x1
    if 0x1 goto 0x7B2600
    applymovement 0x1 0x7B2C00
    pause 0x30
    message 0x7B2D00
    boxset 0x6
    applymovement 0x1 0x7B2E00
    pause 0x30
    setflag 0x10B
    release 
    end
    
    #org 0x7B2600
    release
    end
    
    #org 0x7B2C00
    #raw 0x62
    #raw 0x13
    #raw 0x13
    #raw 0x01
    #raw 0xFE
    
    #org 0x7B2D00
    = Hello\h01p. Prof.Roman just called me and he said that\nyou have to vist his\nlab. He have a present for you.
    
    #org 0x7B2E00
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE
    It freez when i step on it.

    Do you got the right numbers on the tile it self?
    I usally use
    Unkown 03 00
    var. Number 6C 40
    var. Value 00 00
    unkown 00 00
     

    Blitzballer

    Sarcasm: now GMO-free.
    215
    Posts
    17
    Years
  • I just started scripting and now I'm addicted!!! can anyone tell me what's wrong with this script?:

    Code:
    #org $StarHop
    lock
    faceplayer
    checkflag 0x829
    if 0 goto $NeedDex
    checkflag 0x828
    if 1 goto $TakeCare
    message $GetHop
    $GetHop 1 = Ow, my back!\pExcuse me.\pWould you take care of Hoppip for me\lme?
    callstd 5
    compare LASTRESULT 1
    if 0 goto $DontHop
    givepokemon 187 5 0
    jingle
    message $GotHop
    $GotHop 1 = You recieved a Hoppip!
    setflag 0x828
    message $NamePoke
    $NamePoke 1 = Well of course you want to name it.
    namepokemon
    message $BeGood
    $BeGood 1 = Be good to Hoppip now, ya here!
    
    #org $NeedDex
    message $NeedDex
    $NeedDex 1 = Did you know that a friend of mine\lhas an old Pokedex that he doesn't\nneed anymore?\lYou should pay him a visit.
    callstd 6
    release
    end
    
    #org $DontHop
    message $DontHop
    $DontHop 1 = Fine, don't help an old man in need.\lHumph!
    callstd 6
    release
    end
    
    #org $TakeCare
    message $TakeCare
    $TakeCare 1 = Take care of your Pokemon, and\lyourself!
    callstd 6
    release
    end

    By the way, I'm using Firered.
    Any Help is appreciated, THANKS!
     

    Kingdra

    *-_Pokémon Larimar_-*
    20
    Posts
    16
    Years
  • Can someone tell me what's wrong with this script (I'm using Fire Red):

    Spoiler:
     
    Status
    Not open for further replies.
    Back
    Top