DC Forums

We have moved our forums:
http://www.dcforums.co.cc/forum/

Please re-register there, thank you.
GKS
There are many new features available. Some of them include: the advanced profile, reputation system, and the point system. Thank you for waiting patiently, enjoy the update. Plus we are still working on fixing a lot of bugs and stuff that are wrong with the theme.

    XSE Scripting Tutorial - By: Darthatron

    Share

    G.K.S.
    Founder
    Founder

    Male Number of posts: 1718
    Age: 20
    Location: Calfornia, United States
    Status: Updating the forum.
    Warning:
    90 / 10090 / 100

    Reputation: 0
    Points: 25
    Registration date: 2008-09-19

    default XSE Scripting Tutorial - By: Darthatron

    Post by G.K.S. on Wed Dec 31, 2008 4:21 pm

    XSE Scripting Tutorial







    Hello, welcome to my XSE Tutorial, I hope some people ind it helpful.
    XSE is the revolutionary Script Editing Tool by - HackMew -. Please
    leave comments on how helpful this was to you. Here is a quick OverVeiw of XSE:


    XSE will be available for download in the ToolBox shortly, I have the
    Release Candidate version and it is simply fantastic. When you all have
    the chance to download XSE I'm sure you'll fall in love with it as much
    as I did. Look in the spoiler for the very basics of scripting in XSE.

    Content hidden:
    Click here to view.
    XSE
    has a new Automatic Offset Location system, not unlike PokeScript. But
    instead of using the "$" sign it uses the "@" sign, in my eyes it makes
    more sense to use the "@" sign because it is "at" the location. Anyway,
    it is farely simple to use and I will just give you a brief description
    on it.

    Basically, if you used PokeScript you will get the gist of this system. At the start of your script put something like this:
    Code:

    #Dynamic 0xOffset

    but replace the word "Offset" with the Hexadecimal offset with
    free space (FF for FireRed and LeafGreen, 00 for Ruby and Sapphire).

    Example: In FSF (Free Space Finder) you have to find a certain amount
    of "Free Space", depending on how large your script is. For simplicity
    just search for a large number, something between 100 and 300 should be
    plenty. Next click the "Search" button in the ListBox you should see
    something like this:

    Click the "Copy" button and replace the word "Offset", in our script above, with that Value.

    So far our script should look something like this:
    Code:

    #Dynamic 0x3B4D84

    Ok, next we are going to get to the actual scripting! Ho-rah!

    Ok, to start a script you must put the following line of code, no matter what kind of script you are doing:
    Code:

    #ORG @Start

    Feel free to replace the word "Start" with any other word, it
    really doesn't matter what word you use, it is just for reference.
    Anyway, so far the script should look something like this:
    Code:

    #Dynamic 0x3B4D84

    #ORG @Start

    It doesn't have to look exactly like that, but it should look similar.





    Presuming you already know the basics I will start explaining how the
    actual scripting works, it is nearly completely the same as ScriptEd
    and PokeScript but with some differences that you will find out during
    this tutorial.

    1. A basic talking script!
    ________________________


    Ok, as usual we will start with the Important parts, the begining. So, your script should look something like this:
    Code:

    #Dynamic 0x800000

    #ORG @Main

    In talking scripts, and in some others, you must have these 2 lines.
    Code:

    Lock
    FacePlayer

    I'll now explain what these lines of code do...
    Content hidden:
    Click here to view.
    "Lock" = Makes it so the Player can't move and the NPC you are talking to also won't be able to move.
    "FacePlayer" = This code makes it so the NPC you are talking to looks at the Player.






    So now your script should look something like this:
    Code:

    #Dynamic 0x800000

    #ORG @Main
    Lock
    FacePlayer

    Next we will be adding the "Offset" where the text is "Saved". So
    add these 2 lines of code and then I will explain them shortly:
    Code:

    Message @Speak
    BoxSet 0x6

    Once again, you may replace the word "Speak" with any other word
    as it is just for reference. Now to explain to you what these lines of
    code mean...
    Content hidden:
    Click here to view.
    "Message"
    = This is just a simple word that allows you to incert a message, this
    would have to be one of the most used functions in Pokemon Scripting.
    "@Speak" = This is the offset at which the "Message" will be saved, of
    course you can use any word instead of "Speak" as it is just for
    reference.
    "BoxSet 0x6" = This is merely a function used to show you how the
    message is shown in the game. The "0x6" means it is just a normal
    TextBox, you can also use "0x5" which is a "Yes/No" Box, I will go into
    more detail for that at a later time.






    So now your script should look similar to this:
    Code:

    #Dynamic 0x800000

    #ORG @Main
    Lock
    FacePlayer
    Message @Speak
    BoxSet 0x6

    Rightio, next we are going to add 2 more new lines, get ready:
    Code:

    Release
    End

    Now these 2 lines are very important, especially the later. Now, once more I will explain what these lines mean!
    Content hidden:
    Click here to view.
    "Release"
    = This function give your Player the ability to move again, it also
    allows the NPC you are talking to the ability to walk around as well.
    "End" = This simply means that it is the End of the script and makes it so the Game doesn't continue to read the data.




    Don't worry, we are almost finished, just 2 more lines of code.

    Your Script should look something like this now:
    Code:

    #Dynamic 0x800000

    #ORG @Main
    Lock
    FacePlayer
    Message @Speak
    BoxSet 0x6
    Release
    End

    Now we are going to put what the actual Message is, this is the
    part we have all been waiting for! Put these 2 lines of code at the
    bottom of your script:
    Code:

    #ORG @Speak
    = This is a message!

    And for the last time today I will explain what there lines of code mean!
    Content hidden:
    Click here to view.
    "#ORG
    @Speak" = This is merely the place that you pointed to earlier in the
    script, if you didn't use the word "Speak" before, you must change this
    "Speak" to the same word.
    "= This is a message!" = This the message that will be displayed
    in-game. Feel free to change the "This is a message!" text to whatever
    you want the person you are talking to, to say.






    Well, that's all I have time for today, but I will edit this post and
    add some more tutorials in the future. Until then, I'll be programming.


    2. Compiling the script!
    ________________________


    To compile a script into a ROM you just have to follow 3 simple steps.

    1. Make sure the script you want to compile is open in XSE.
    2. Go into the "File" menu and click "Open...", select the ROM you want to compile the script into.
    3. Then click the Compile button , and that's it. Your script is comiled into your ROM.


    _________________
    http://www.cramster.com/?referral_id=509296
    For help on homework and for studying.

      Current date/time is Thu Apr 17, 2014 4:12 pm