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

Leon Blade's Pokescript Tutorials

Status
Not open for further replies.
9
Posts
17
Years
    • Seen Mar 10, 2023
    Leon Blade's Pokescript Tutorials

    Hello and welcome to my tutorials!
    I've seen lots of people post their tutorials on Pokescript and I notice that they really don't go into what there doing they'll just say, type all this stuff in and you get a message. But they really don't go into explaining what there showing you how to do.

    In this tutorial I'll try to explain that to you, in the best way that I can. Somethings I'm not sure about, so don't blame me on that. But I'll try to give my best guess if needed. Please correct me if you see something wrong.

    Alright lets begin the tutorial!

    Part 1: Your First Script
    So you want to learn Pokescript to enhance your hack to the game.
    Scripting is key to making a good hack, map hacks aren't enough alone. You need to give the game new features, not just change some maps around.

    Overview:
    So lets start out with the basics. In this first section you will learn how to display a message on the screen. Simple right? Heres some of the commands you will be learning:
    Code:
    lock: Locks the NPC, or the person, you talk to so they can't move
    faceplayer: Sets the NPC to face the Player
    message: Displays a message box on the screen with the message you choose
    boxset: Specifies what type of message your showing(We'll get to that later)
    release: Gives the NPC back control so they can move again or what have you

    And some keywords and such you'll learn about:
    Code:
    Using the [b]$[/b] symbol
    Using [b]#ORG[/b] and [b]end[/b]

    Alrighty then, so lets start!

    Section 1: Setting up the Script
    Your going to want to open up Notepad or your favorite Script Editor such as Notepad++, SciTE, etc.
    Spoiler:


    Lets create a new file called FirstScript.RBC
    Now you'll notice the file extension at the end RBC which stands for Rubicon (I believe). Essentially its just a file that PokeScript is familiar with and you have to have it in this format to Compile the script once your done with it.
    Spoiler:


    Alright now that we got this setup were going to type in this:
    Code:
    #ORG
    This is a keyword I guess you could call it. It's the standard way of starting all Scripts. Think of it like this:
    Code:
    begin
    It's the beginning of our code and it's necessary to have it there.

    On the same line put in a space and type:
    Code:
    $StartScript
    Now, what does this mean?
    Well basically, if you are familiar with PHP you might already know what this is.
    The $ symbol is telling PokeScript that this is a Variable. It's an easy way for the user writing the script to refrence parts of there code without having to remember offsets. You can call this variable anything you want. It's just a temporary way of storing something for later. Instead of $StartScript you could put $ImCool or whatever you want to call it.

    Spoiler:


    Once PokeScript compiles your code, it takes those variables and replaces them with offsets. Here is an example:
    Code:
    $StartScript > 800156
    $NoRoom > 800308
    $Noobs > 812009

    It takes what you wrote as a variable, finds an offset that isn't being used, and replaces your variable with that offset.
    Spoiler:


    Alright, so far we have this:
    Code:
    #ORG $StartScript

    Section 2: Controlling the NPC
    Now in a real life situation when you goto talk to someone what normally happens. Lets say they were walking somewhere. You go up to talk to them, chances are they stop walking to talk to you right?
    Spoiler:


    So where going to go down to the next line in our code and type this command:
    Code:
    Lock
    This lock command is telling the game to stop the NPC your talking to so it can't move around while your trying to talk to it.

    Now were going to go down to the next line and type this:
    Code:
    Faceplayer
    Now when you see your friend and you go up to talk to them they stop, and they look at you right? So what this command does is, it has the NPC face the player so there face to face and it looks like they can have a conversation. If you left this out the player would be facing up at the NPC while the NPC could not be even looking at the player, which wouldn't be very realistic. So when working with NPCs and talking to people, you should use the Faceplayer command.

    So now we have this in our code:
    Code:
    #ORG $StartScript
    Lock
    Faceplayer

    Now, so far if we were to talk to someone using this code as we have it. The NPC would stop moving if they were, and look at the player.
    So were moving along now! Just a few more things left!

    Section 3: Displaying a Message
    Alright now you stop to talk to your friend, what are you going to do? Well your going to talk to them so lets type this in now:
    Code:
    message
    This message command is telling the game your going to bring up a message for the Player to read. But your going to have to tell the game what you want to say. So were going to link the message to a NEW variable. So you would type this:
    Code:
    message $Talk
    So you just add a space after message and type in $ and the variable name you want to use. I'm calling my variable talk.

    So now we want to set this variable equal to some text that will show in the message right? Alright so lets go to the next line in our code and type this:
    Code:
    $Talk
    This means we are referring to our $Talk variable. Now add this:
    Code:
    $Talk 1
    To be honest, I'm not sure what the 1 stands for. But I think it means to display the message right then. Don't quote me on this. Just know that you have to type the 1 after the variable name like that. OK, now we want to set the $Talk variable equal to a message right? So lets do this:
    Code:
    $Talk 1 =
    Now were setting our $Talk variable equal to something. Lets now write in a message we want to show:
    Code:
    $Talk 1 = Hello, this is my first script in PokeScript!  It's fun to script!
    Great! Now if we were to test the message like this, we would have a problem. The message would look like this on the screen:
    Code:
    Hello, this is my first script in PokeSc
    Or something close to that. The message will cut off. Why is this?
    Well it's because the message box can only hold so many characters (letters, numbers, symbols, etc) in one line. Your going to have to guess or ask someone. But about as much as I have written up there will show.
    So how do we advance on to the next line?
    Well we need to type a \ and then a letter either P, L, or N which will continue the message on the next line. Messages can only hold 2 lines at once.
    Read the spoiler below to figure out what letter does what specifically.

    Spoiler:


    So lets make sure our message fits now. Heres that line from the code again:
    Code:
    $Talk 1 = Hello,\lthis is my first script in PokeScript!\pIt's fun to script!
    Notice I didn't put any spaces after the \p or \l
    I'll show you what it would look like. If you add the space instead of the message looking like this "This is a message"
    It would look like this " This is a message" Note the space before the T. Thats why you shouldn't put a space afterwords. However, adding a space before the \ won't matter.

    So heres what our message will look like. NOTE: the ^ symbol will stand for when you press the A button, and if I skip a line that means its a whole new message box:
    Code:
    Hello,^
    this is my first script in PokeScript!^
    
    It's fun to script!

    Thats what it would be like when you tested it.
    Ok so now we have to choose what type of message were displaying so we type:
    Code:
    boxset
    This command tells us what message box to use. The different types are in the spoiler.

    Spoiler:


    So we just want a regular message so we'll type this:
    Code:
    boxset 6

    Alright so lets see what we have so far:
    Code:
    #ORG $StartScript
    Lock
    Faceplayer
    message $Talk
    $Talk 1 = Hello,\lthis is my first script in PokeScript!\pIt's fun to script!
    boxset 6

    Section 4: Releasing the NPC
    So when we talk to the NPC he will stop moving, look at you, and say that message.
    Once your done talking to your friend in real life, they normally walk away or continue what there doing right?
    Spoiler:

    So same with this, once were done talking to the NPC, we want to let him walk around again. So we will use this command:
    Code:
    release
    This works with the lock command.
    Lock stops the player from moving, and release lets the character move around again.

    Section 5: Ending the Script
    Alright then! This is the last line right here. In the beginning we started the script with
    Code:
    #ORG
    So now we will end it with
    Code:
    end
    Coincidently enough, yes its end.

    So lets see what we have and go over it just one last time:
    Code:
    #ORG $StartScript
    Lock
    Faceplayer
    message $Talk
    $Talk 1 = Hello,\lthis is my first script in PokeScript!\pIt's fun to script!
    boxset 6
    release
    end

    So we walk up to the NPC, he stops moving, he faces us, says a little message to us, and then goes back on walking around.

    Phew! Glad thats over huh? Yeah, that was a lot of typing for me to do lol.
    So now lets go over on how to use it in your Game!
    Yeah, were not quite done yet. Just hang in there, this is the easy part!

    Section 6: Compiling your Code
    Your going to want to use PokeScript to compile your code and use it in your ROM. To do this make sure any current work your doing on your ROM from Advance Map or whatever is saved. And just to be sure close out the program if you want.

    Now your going to want to navigate to the directory you saved your FirstScript.RBC file in. And you want to Right-Click it. A menu should appear, and if you installed PokeScript correctly you should see the option called Compile Script. Your going to want to click that

    If you don't see compile there read this spoiler
    Spoiler:


    So once you click compile, PokeScript should come up with the title (LOG) Instant
    And it should start showing you all this stuff as it compiles, you don't need to worry about that. It's just the compilers feedback. You may learn how to read this later on, but right now it's unnecessary.

    Section 7: Burning your Script
    When I say "burn" I mean writing it to the ROM. Once compiling is done a Buf Rite should come up and in the middle it should say something like this:
    Code:
    firstscript: $startscript
    firstscript: $talk

    Thats a list of all your variables that you made in your code. Buf Rite is going to convert those variables to free offsets in your ROM.
    Now there are some better tutorials on this but I'll try to explain it the best I can.

    Your going to want to click on the $startscript variable and click the little Book Icon(Assign).
    The reason you want the $startscript is because its the main variable in the script. And you want to use that. Again I don't really know how to explain it, so look somewhere else on why exactly you pick it.

    But you click that Assign button and a new window pops up asking you to "Open file ...." this is where you choose your ROM you want to burn this to.

    Now a Search Dialog box comes up. This will find Free Space in your ROM to choose an offset from. Click on the Flashlight, that will preform the search. If your starting brand new with a fresh ROM file then the first result will most likely be the offset of 800000
    Just select that offset and click Reserve at the bottom. You'll notice that the middle changed and it now looks something like this
    Code:
    firstscript: $startscript (800000)
    firstscript: $talk
    Because you Reserved that offset for the $startscript variable. Again this might not make much sense to you, so try to find a good tutorial on this.

    Now to actually burn this. Click File at the top, and choose Burn. This will "push" all the variables into offsets and write the data to the offset.
    Spoiler:

    Now there will be a whole list of things that comes up, this is all the output. Again you don't need to worry about this, but pay close attension to this:
    Code:
     - [B]Pushed firstscript.[U]$startscript [/U]to [U]800000[/U][/B]
    #PROCESS: C:\Documents and Settings\Jimmy\My Documents\Fire Red Scripts\1635 - Pokemon Fire Red (U)(Squirrels).gba F:4 for read
    Your going to want to copy that offset you see. In this case 800000 because your going to use it in your ROM on an event.

    Section 8: Making the Event
    This is going to be a basic quick and simple tutorial on how to make the event for Advance Map
    Your going to want to create a new event, if you don't know please read the tutorials on how. Select the event with your mouse, and over on the right you should see something like this:
    Code:
    Offset: $000000
    This is were your going to want to place your offset. So leave in the $ and paste in your offset you coppied so it would be
    Code:
    Offset: $800000

    Great! So now you can save and test your game!

    Thats it for todays tutorial, I'm going to goto bed now... its 2:50 AM right now and once I'm done doing some quick editing it will be around 3:00 AM

    I hope you enjoyed the tutorial as much as I had making it!
    Spoiler:

    Next time I'll work on boxset 5 and using the YES and NO.

    If you have any questions or comments, please post them here. I'll be more than happy to hear what you have to say about this, and if theres anything I should improve on for Part 2.

    Happy Scripting!
    --Leon Blade
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • Dude, This is like the 50th Pokescript tutorial!
    Its a little bit more detailed though, and It makes sure you get it.

    Hopefully everyone won't be using pokescript anymore, We'll all be using - Hackmew -'s XSE!

    What we really need is all of the commands into one tutorial, then examples for each command, I'll even help!
     
    1,104
    Posts
    16
    Years
  • Dude, This is like the 50th Pokescript tutorial!
    What we really need is all of the commands into one tutorial, then examples for each command, I'll even help!

    There's going to be 51 soon. :laugh: All the commands, is what I'm doing. So far, I've written on about 80 of them. And if you've seen Mastermind X's list, there's 194, but some of those are useless, so I guess I'm only half way through. But enough on me.

    Well, onto your tutorial. It's pretty good. You haven't covered much, but you have, it's in a lot of detail.But I found one error, you've got the boxset 4 description wrong. It's just a box that doesn't close, and remains on the screen, until you use a specific command that will allow it to close.
    Other than that, pretty good.
     
    Last edited:
    3
    Posts
    15
    Years
    • Seen Jun 27, 2008
    I can't burn the script because when i try to click burn, something pops-up like a box then it says floating pointer must be pushed like this:

    Floating pointer must be pushed
    enter offset of giveblast.$person:


    Did I do something wrong?
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • Yes, you did do something wrong.
    What you did wrong was not getting XSE. This tutorial is useless now, until - HackMew - 's comprehensive scripting guide comes out.
     
    Last edited:
    6,355
    Posts
    18
    Years
    • Seen Apr 16, 2020
    andrejoshua, please don't post in threads that are over a month old.
     
    Status
    Not open for further replies.
    Back
    Top