Thread: [Tutorial] Basics of Scripting
View Single Post
  #17    
Old October 9th, 2011 (5:22 AM). Edited October 9th, 2011 by SupahNinja.
SupahNinja's Avatar
SupahNinja SupahNinja is offline
Scripting Ninja
     
    Join Date: Mar 2011
    Gender: Male
    Posts: 34
    Quote:
    Originally Posted by mihir View Post
    okay this seems like a wrong question,but i need something REALLY simple. One script.I tried this, but I keep on messing up. All I want is for an old man to talk like "Hi!" or something. My first script; failed
    Something like this should work:

    Code:
    #dynamic 0x800000
    
    #org @start
    msgbox @text 0x6
    end
    
    #org @text
    = Hi!
    When you compile it (the little gear button in XSE), It should give you an offset for @start (something after 800000, because that was the start of our dynamic offset).
    Copy that offset, and in Advance Map select the old man as a person event and put your copied offset in his Script Offset box.

    -----

    Quote:
    Originally Posted by Sephirothxxx View Post
    Can you help me? I want to learn how to make one of those scripts that activate battles in Pokemon Ruby. (Like starting a battle with Regice by pressing a in front of him.)
    You need the wildbattle command.
    The syntax is
    Code:
    wildbattle [national dex number] [level] [held item]
    All three variables need to be in hex.
    For the sake of example, let's say you want to battle a level 30 Raichu, holding a Potion.
    Raichu's National Dex number is 26, which in hex is 1A.
    30 (the level) in hex is 1E.
    The Potion's item number is 13, which in hex is D.
    So our code would be
    Code:
    wildbattle 0x1A 0x1E 0xD
    A full example script would look like
    Code:
    #dynamic 0x800000
    
    #org @start
    msgbox @raichu 0x6
    cry 0x1A
    wildbattle 0x1A 0x1E 0xD
    end
    
    #org @raichu
    = Raaiiiichuuuu!
    -----

    Quote:
    Originally Posted by DaleH771 View Post
    What is the code for your Rivals name? As its only [RIVAL] in advanced text..
    In XSE, it can be either
    Code:
    \v\h06
    or
    Code:
    [rival]
    .


    I just wrote all that from memory, but I can't see any errors in it right now.


    If yo need more help, check out the Script Help Thread.
    __________________
    SupahNinja

    My feelings on
    ROM hacking:

    -I like scripting a lot.
    -Mapping is almost as fun.
    -Hex editing isn't bad at all.
    -I do NOT enjoy spriting.
    -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

    Favorites:

    -My favorite color is green.
    -My favorite type is fire.
    -My favorite Pokémon are:
    Growlithe, Charizard, Mew,
    Giratina, Haxorus, and Aggron.
    SupahNinja
    Reply With Quote