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

Spenceroone3's Scripting Tutorial

Status
Not open for further replies.

spenceroone3

<he eats lots of burgers.
215
Posts
16
Years
  • Intro: This is all done on Pokescript, my favorite working compiler!! I thought of making this tut to help people. Yes, I know that Irish Witch, Foullump, and Semele have all made their tutorials, and I thought of making my own. I wrote this up all in my spare time, it is time I put it to good use!

    Table of Contents
    1. Simple talking script
    Compiling
    2. Yes/No script
    3. Movement scripts
    4. Giveitem scripts
    5. Givepokemon scripts
    6. Flags
    7. Warps
    8. Randomization
    9. Text colour
    10. Weather
    11. Wildbattles
    12. Gender/Sex

    Tutorial One: Simple talking script!
    First open note pad and write this down:
    Code:
    #org $Showtext
    That will start the script. the $ sign goes in front off all offsets.
    Then do this:
    Code:
    lock
    faceplayer
    That makes the person who you are talking to turn to face you. If they are the type that looks around, or walks around, lock keeps them in place.
    Now onto the message:
    Code:
    message $Hello
    $Hello 1 = How ya going?\pGood? That's awesome!!
    boxset 6
    Remember the $ sign goes in front of all offsets. You can make any type of talking script just by editing the talking part. /p means new paragraph, /n means next line, and /l is a new paragraph but with a different effect to the /p one. Boxset 6 is the type of Message box it is in. Boxset 6 is the normal text box. Boxset 5 is the Yes/No textbox.
    Now we better end this script:
    Code:
    release
    end
    Release is the opposite of lock and faceplayer, and end MUST be used to end the script, or else.
    Here is the complete script:
    Code:
    #org $Showtext
    lock
    faceplayer
    message $Hello
    $Hello 1 = How ya going?\pGood? That's awesome!!
    boxset 6
    release
    end
    Compiling
    Save your script in notepad as an rbc. . Then right click it and you should see a "Compile script" option. If you don't then go to Piemans tutorial. Now, after pressing compile, pokescript will come up, but just close it after it has finished. Now bufrite will come up, so you press the book and select your ROM. A box will come up, press the torch icon and offsets will come up. Select one and press "Assign" and then go to "file" in bufrite and press "Burn" now remember that offset by clicking on "Offsets" tab. Remember the first offset and put it into "offset" in A-map.
    Now it should work. If you have any questions, don't PM me, just ask in this thread.

    Tutorial Two:Yes/No script!
    Open notepad and do all of what I told you in the last tut.
    Make three things a person could say, maybe these(This is not how you put them into a script):
    Code:
    Are you dumb??
    If Yes,: Hahaha!
    If No, : Yes you are!!
    Now, to put them into a talking script, write all this up:
    Code:
    #org $Sillyquestion
    lock
    faceplayer
    message $Aredumb
    $Aredumb 1 = Are you dumb??
    boxset 5
    compare LASTRESULT B_TRUE
    if B_False goto $Yesuare
    message $Laugh
    $Laugh 1 = Hahaha!
    Boxset 6
    release
    end
    
    #org $Yesuare
    lock
    faceplayer
    message $Yesuare2
    $Yesuare2 1 = Oh yes you are!!
    boxset 6
    release
    end
    Notice how I used Boxset 5 instead of Boxset 6 at the question?

    For the next tut, you will need to have this
    by your side...

    Tutorial Three: Movement Scripts
    Yes yes, I suck at these. They probably won't even work :(
    but I'll have a try at them.
    The following script will make your player walk up three steps.
    Customize it a bit. I'll explain a bit more at the end.

    Code:
    #org $Move1
    checkflag 0x200
    if B_TRUE goto $Done
    applymovement 0xFF $move
    pause 0x30
    setflag 0x200
    end
    
    #org $Done
    end
    
    #org $move
    $move 1; #Binary 0x11 0x11 0x11 0xFE
    The pause 0x30 is the number of steps taken x10, making 30. 0xFE MUST go at the end of every list of movements. Refer to the page I posted before this tut to customize this. Remember this: Applymovement 0xFF

    The 0xFF makes the main character move. For someone else to move, put their map number in instead, for example, if it was this:
    Code:
    applymovement 0x01 $Whogivesthe
    Then the person with map number 0x01 would move.
    Also, to make these things move, you must place a script. When you stand on it, it is supposed to move you forward 3 steps. To make them work, you will notice something like this in A-Map:
    Code:
    Unknown: 00 00
    Var Number: 00 00
    Change that to this:
    Code:
    Unknown: 03 00
    Var Number: 50 40
    And so ends yet another tut!!

    Tutorial Four: Giveitem scripts
    These are pretty easy, but before you go, you'll need a list of items.
    Spoiler:
    Say we wanted to make a person give you a free potion.
    This is a Yes/No script to give you one.
    Code:
    #org $Sillyquestion
    lock
    faceplayer
    checkflag 0x200
    If B_TRUE goto $Done
    message $Freepo
    $Freepo 1 = Would you like a free POTION?
    boxset 5
    compare LASTRESUILT B_TRUE
    if B_False goto $Nothanks1
    message $Hereitis
    $Hereitis 1 = Here ya go!
    Boxset 6
    giveitem 0xD 0x1
    setflag 0x200
    release
    end
    
    #org $Nothanks1
    lock
    faceplayer
    message $Nothanks
    $Nothanks 1 = Oh yes you are!!
    boxset 6
    release
    end
    
    #org $Done
    lock
    faceplayer
    message $Noneleft
    $Noneleft 1 = I'm sorry, I don't have\nany POTIONS left.
    release
    end
    The last bit at the end shows what happens if you already have the potion. The giveitem 0xD 0x1 part is, obviously, you get 1 potion. Changing that will give you a different item or a different number of them. You don't have to write in "[PLAYER] has recieved POTION" because giveitem does that automatically. The checkflag at the start makes sure you don't get x999 potions :lol:. And so I have ended another great tut! Next up in line: Give Pokemon Scripts!

    Tutorial Five: Give Pokemon Scripts!
    First you will need a list of Pokemon. Lucky for you, I have one.
    Spoiler:
    Now that you have that, you must create the small script. I want a Charmander, so I shall make this:
    Code:
    givepokemon 4 5 0
    That gives me a Charmander level 5 not holding anything. The first number is the number of the Pokemon, the second number is the Lv, and the third number is the number of the item!!! Oh, and it won't show anything like "You recieved the CHARMANDER" you actually have to put that in! Here is the script in action, taken from Pokemon PinkMew:
    Code:
    #org $begin
    lock
    faceplayer
    checkflag 0x232
    if B_true goto $gotit
    message $q
    boxset 6
    message $mygod
    boxset 6
    givepokemon 4 5 0
    message $NameCharm
    boxset 5
    setflag 0x232
    setflag 0x828
    release
    end
    
    #org $gotit
    message $hi
    boxset 6
    release
    end
    
    #org $hi
    $hi 1 = How's my old CHARMANDER?
    
    #org $q
    $q 1 = To get past here, you'll\nneed a pokemon.\pTake this CHARMANDER.
    
    #org $mygod
    $mygod 1 = You received the CHARMANDER!
    
    message $NameCharm
    $NameCharm 1 = Would You like to give \nCHARMANDER a name?
    boxset 5
    compare LASTRESULT 1
    if b_False goto $seeya
    Namepokemon
    setflag 0x203
    
    message $seeya
    $seeya 1 = Thanks!
    release
    end
    Tutorial Six: Flags!
    This will be short since it is only about flags!!
    Okay, the effect of flags:
    Setflag~ Sets the flag.
    Checkflag~ Checks the flag.
    removeflagflag~ Opposite of Setflag.

    Make sure for every different flag you use a different flag.
    So in every script you make don't have 0x200 as your flag.

    Tutorial Seven: Warps
    You will need this for scripts like movement scripts leading to a house.
    Here is a good base for one of these:
    Code:
    warp 0x[map bank] 0x[map] 0x[warp]
    Now, here is it leading to PALLET TOWN:
    Code:
    warp 0x30 0x0 0x1
    You can put that in ANY of your scripts.

    Tutorial Eight: Randomization!

    As of my latest sucess on the Script/Discussion/Sharing thread, I credit Dabomstew for helping me peronally with this one.

    You're probably wondering were you would need this. The slowbro in Cerulean. Stuff like that. First, do this:
    Code:
    #org $Begin
    lock
    faceplayer
    #raw 0x8F
    #raw 0x04 0x00
    copyvar 0x8008 0x800D
    That extra part will begin the randomziation. But you then need to add this:
    Code:
    compare 0x8008 0x0
    if 0x1 call $Yes
    compare 0x8008 0x1
    if 0x1 call $No
    release
    end
    
    $org $Yes
    $Yes 1 = Yes! Yes! Yes!
    boxset 6
    release
    end
    
    #org $No
    $No 1 = No! No! No!
    boxset 6
    release
    end[/code
    [SIZE=5][U]Tutorial Nine: Text Colour![/U][/SIZE]
    First write up the beginninng of the script:
    [code]#org $Hello
    lock
    faceplayer
    message $Color
    $Color 1 = ??
    boxset 6
    release
    end
    Well that is the start, I better show you how to add colouring. First get this command:
    Code:
    \c\h01\hXX
    Put it in this part of our script:
    Code:
    $Color 1 = \c\h01\h09How are you going?
    Notice how I put that 09 after the 'H'? That is the colour's number. Here is some more:
    Spoiler:
    Another tut done! What next? Weather!

    Tutorial Ten: Weather!
    This is pretty simple really. First, you need to knwo these hex numbers:
    0 = Normal
    3 = Rain
    4 = Snowflakes
    5 = Thunderstorm
    6 = Fog
    7 = Ash
    8 = Sandstorm
    9 = Fog 2
    A = Fog
    B = Dark
    C = Hot sun
    D = Thunderstorm 2
    E = Underwater
    Okay, now you need to put it into it's script.
    Code:
    setweather 0xB
    doweather
    It is even possible (If you can script that well :P )
    to use this code in R/S/E to make a Day/Night system. To make the weather stop, make another part of the script go to 'Normal' weather.
    Whats next?
    Wildbattles?
    Okay...

    Tutorial Eleven: Wildbattles!
    Back in a sec... K, I'm back! Yeah, I'm gonna try to teach you some wildbattle scripts. Let's go!!!
    First you need to know the Pokemon's cry.
    Code:
    cry [Pokemon's Number]
    Pretty long script, isn't it? Yes, I better show you what it looks like if there was sometihng there.
    Code:
    cry 151
    That will make my fave pokemon, Mew, cry. Now for the rest of the script...
    We need to make the wildbattle. You can refer back to tutorial siz to get the Pokemon's numbers to make the cry script and the wildbattle script. Here is your wildbattle script:
    Code:
    wildbattle [Pokemon's Number] [Pokemon's Level] [Terrain]
    Wait? Terrain? Oh, I see I need to give you a list of terrains.
    Code:
    0 = grass
    1 = water
    2 = rock
    3 = sand
    So here is the script I want for it....
    Code:
    wildbattle 151 30 0
    That will make me battle a level 30 Mew in some grass. Now here is the whole script:
    Code:
    #org $Wildbattle
    lock
    faceplayer
    cry 5
    message $mewcry
    $mewcry 1 = Mew: Lalalala!
    boxset 6
    checkflag 0x500
    if 0x1 goto $Wildbattle
    release
    end
    
    #org $Wildbattle
    lock
    wildbattle 151 30 0
    release
    setflag 0x500
    #raw 53
    fadescreen 0
    end
    It doesn't work, but I'm about to fix it ;)

    That is another tut finished! Next up: Gender/Sex

    Tutorial Twelve: Gender/Sex!
    To do this, you must put this in your script:
    Code:
    checkgender
    compare LASTRESULT [B]0x1[/B]
    if [I]0x1[/I] goto $Male
    The 0x1 in bold means "Check for male" And then the next 0x1 (In italics) "if yes"
    so now we can use it all:
    Code:
    #org $Gender
    lock
    faceplayer
    checkgender
    compare LASTRESULT 0x1
    if 0x1 goto $Male
    message $Female
    $Female 1 = You're a beautiful little girl.
    boxset 6
    release
    end
    
    #org $Male
    $Male 1 = You're a handsome little boy.
    boxset 6
    release
    end
    Compile that into your game, and it shall work. If it doesn't...
    Next tutorial... Money and coins!
    Things to expect in future updates:
    -Money Commands
    -Coin Case Commands
    -Field moves
     
    Last edited:

    Geeked

    Pokemon Crimson Version
    352
    Posts
    16
    Years
    • Seen Oct 9, 2012
    *First reply* Good luck with this tutorial spencer its seems quite easy for noobiez
     
    170
    Posts
    16
    Years
  • This is a nice tutorial for new beginners..
    btw, where is step 4? it jumps from step 3 to step 5..
    and hope you will add more commands..;)
     

    Binary

    え?
    3,977
    Posts
    16
    Years
    • Seen Apr 7, 2014
    Yes very handy tutorial spencercoone,
    hope you add some more commands
     

    Swampert 22

    Is making tools for you...
    393
    Posts
    18
    Years
  • Hey good tut clearly outlining the simple steps! I'm looking forward to those other thing to expect, I've been wanting to know how to do field commands for some time! Keep it up! oh and whats a GIANT SCRIPT?
     

    spenceroone3

    <he eats lots of burgers.
    215
    Posts
    16
    Years
  • Yes! It's finally up! I'm quickly gonna edit it! A giant script is a very big script made up of lots of different commands, such as my stealitem script, or the evil magikarp. Thank you every body, I'm going to have to repair my tut a bit.
     
    Last edited:
    18
    Posts
    16
    Years
    • Seen Nov 11, 2007
    whene i add a script to a man on the oldale town on my game, i add a giving pokemon script, when i go to talk to the man, nothing happenend, and thet not talking!
    help !
     

    ♠εx

    Working on my hack, busy also.
    299
    Posts
    16
    Years
    • Seen Aug 15, 2008
    It is helpfull, but most of this is found off PHO x].
    Also, I think you should explain what the flags do a bit more.
    What if someone wants to disable a script when you do another? Or change it completely. ;)
     

    spenceroone3

    <he eats lots of burgers.
    215
    Posts
    16
    Years
  • I have removeflag? And I'm haven't actually finished that tut, I'm going to use all the flags in Kike-Scotts tut, with some of my own.
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • This is great for beginners(not the ones that don't know how to compile, or save a .rbc)
    But How many Scripting tutorials do we need? This one is great!
     

    spenceroone3

    <he eats lots of burgers.
    215
    Posts
    16
    Years
  • Okay guys, I'm going to add a bit more onto this, namely these:
    ~Compiling~
    ~Checkgender~
    I'm going to do Compiling first, it is too important to keep back.
     

    Juan

    Brazilian with a bad English
    92
    Posts
    16
    Years
  • In the Weather Script, it has that to place some value in the fields "Unknown and
    Var Number" of a-map?
    I left thus and he did not function:
    Unknown: 00 00
    Var Number: 00 00
     
    150
    Posts
    17
    Years
  • Can you explain the randomization script a bit more? For example, can you tell which command does what, and how it works?

    Thanks in advance =D
     

    EVIL DARK MEW

    Advanced Pokemaniac
    37
    Posts
    16
    Years
  • Some Errors

    Code:
     [COLOR=Red]LASTRESUILT B_TRUE[/COLOR]
    if B_False goto $Yesuare
    message $Laugh
    $Laugh 1 = Hahaha!
    Boxset 6
    release
    end
    [/quote]
    correct me if i am wrong but this script is a bit incorrect
    *first of all it should be compare last [B]result 1
    
    [/B][QUOTE="spenceroone3, post: 3036893, member: 58580"]
    #org $Wildbattle
    [COLOR=Red][B]lock[/B][/COLOR]
    faceplayer
    cry 5
    message $mewcry
    $mewcry 1 = Mew: Lalalala!
    boxset 6
    checkflag 0x500
    if 0x1 goto $Wildbattle
    release
    end [/quote]
    
    Don't call for a lock here or the script will not work
     
    1,104
    Posts
    16
    Years
  • correct me if i am wrong but this script is a bit incorrect
    *first of all it should be compare last result 1



    Don't call for a lock here or the script will not work
    Sorry, you're wrong.
    b_true = 1
    They mean the same thing.

    and the Lock makes no difference here, he just doesn't need the second lock in $Wildbattle but it does look like the cry won't work.
     
    Status
    Not open for further replies.
    Back
    Top