View Single Post
  #166    
Old June 25th, 2012 (8:55 AM).
Nonono Nonono is offline
     
    Join Date: Apr 2012
    Gender: Female
    Posts: 1
    Hi everyone, I'm new to scripting and was hoping someone could help me. I've got most of the scripts figured out except the pokemon battles one (i'm hacking ruby, if that helps). I'm trying to insert new legendary battles.

    So, for instance, I'm trying to put a battle with Articuno in. So i insert the sprite in advance map as a person event, no problem, and open up the script at offset $00740000. At that point, the script looks like this:

    #org 0x8740000
    '-----------------------------------
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    ...and so on.

    Then I insert the battle script from the generator, and it looks like this:
    #dyn 0x740000
    #org @start
    special 0x187
    compare LASTRESULT 2
    if == jump 0x81A7AE0
    special 0x188
    lock
    faceplayer
    checksound
    cry ARTICUNO 2
    waitcry
    pause 0x14
    playsound 0x156 0x0
    battle ARTICUNO 15 NONE
    setflag 0x807
    special 0x138
    waitspecial
    clearflag 0x807
    special2 0x800D 0xB4
    compare LASTRESULT 1
    if == jump 0x8162558
    compare LASTRESULT 4
    if == jump 0x8162561
    compare LASTRESULT 5
    if == jump 0x8162561
    setflag 0x201
    release
    end

    ...which I believe is correct, since i got it from the generator.
    I press compile, and copy the offset, which is at $00740001, into advance map. i change the person ID to $0201 as well. but then when i open the script again, it looks like this:


    #org 0x8740001
    '-----------------------------------
    special INIT_STEPCOUNT
    compare LASTRESULT 0x2
    if == jump 0x81A7AE0 ' Equal To
    special GET_STEPCOUNT
    lock
    faceplayer
    cry 0x30 0x290
    nop0 ' #raw 0x0
    waitcry
    pause 0x14
    playsound 0x156
    battle ARTICUNO 15 NONE
    setflag RS_BADGE_1
    special BATTLE_PIXELLATE
    waitspecial
    clearflag RS_BADGE_1
    special2 LASTRESULT 0xB4
    compare LASTRESULT 0x1
    if == jump 0x8162558 ' Equal To
    compare LASTRESULT 0x4
    if == jump 0x8162561 ' Equal To
    compare LASTRESULT 0x5
    if == jump 0x8162561 ' Equal To
    setflag 0x201
    release
    end

    #org 0x81A7AE0
    '-----------------------------------
    #raw 0xC9
    #raw 0xDC
    #raw 0xB8
    nop0 ' #raw 0x0
    CMD_C3 0x0
    #raw 0xE7
    #raw 0xD9
    #raw 0xD9
    setdoorclosed 0xADAD 0xCDFB
    #raw 0xE8
    #raw 0xDD
    #raw 0xE0
    #raw 0xE0
    #raw 0xB8
    nop0 ' #raw 0x0
    #raw 0xD6
    #raw 0xD9
    #raw 0xDD
    #raw 0xE2
    #raw 0xDB
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE7
    #raw 0xDD
    #raw 0xE0
    #raw 0xD9
    #raw 0xE2
    #raw 0xE8
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xED
    #raw 0xE4
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xDD
    #raw 0xE7
    nop0 ' #raw 0x0
    #raw 0xD5
    #raw 0xE0
    #raw 0xE7
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xD7
    #raw 0xE3
    #raw 0xE3
    #raw 0xE0
    #raw 0xB8
    CMD_FE 0xDD
    #raw 0xE7
    #raw 0xE2
    givetocoincase 232 ' Bear in mind, it's not in hex
    #raw 0xDD
    #raw 0xE8
    setdooropened 0xC3FB 0xDC00
    #raw 0xE3
    #raw 0xE4
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xED
    #raw 0xE3
    #raw 0xE9
    givetocoincase 57568 ' Bear in mind, it's not in hex
    nop0 ' #raw 0x0
    #raw 0xDB
    #raw 0xDD
    #raw 0xEA
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE1
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE3
    #raw 0xE4
    #raw 0xE4
    #raw 0xE3
    #raw 0xE6
    #raw 0xE8
    #raw 0xE9
    #raw 0xE2
    #raw 0xDD
    #raw 0xE8
    #raw 0xED
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xE3
    CMD_FE 0xE7
    #raw 0xDC
    #raw 0xD5
    #raw 0xE6
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xED
    #raw 0xE3
    #raw 0xE9
    #raw 0xE6
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xE3
    #raw 0xE9
    #raw 0xDB
    #raw 0xDC
    #raw 0xE8
    #raw 0xE7
    nop0 ' #raw 0x0
    #raw 0xD5
    #raw 0xDB
    #raw 0xD5
    #raw 0xDD
    #raw 0xE2
    tempspriteface 0xFF 0xC3
    givetocoincase 57568 ' Bear in mind, it's not in hex
    nop0 ' #raw 0x0
    #raw 0xD6
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE0
    #raw 0xE3
    #raw 0xE3
    #raw 0xDF
    #raw 0xDD
    #raw 0xE2
    #raw 0xDB
    nop0 ' #raw 0x0
    #raw 0xDA
    #raw 0xE3
    #raw 0xE6
    #raw 0xEB
    #raw 0xD5
    #raw 0xE6
    #raw 0xD8
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xED
    #raw 0xE3
    #raw 0xE9
    #raw 0xE6
    nop0 ' #raw 0x0
    #raw 0xE2
    #raw 0xD9
    #raw 0xEC
    #raw 0xE8
    CMD_FE 0xD6
    #raw 0xD5
    #raw 0xE8
    #raw 0xE8
    #raw 0xE0
    #raw 0xD9
    tempspriteface 0xFF 0xD3
    #raw 0xD9
    #raw 0xD5
    #raw 0xDC
    tempspriteface 0xFE 0xC3
    #raw 0xE8
    givetocoincase 231 ' Bear in mind, it's not in hex
    #raw 0xBC
    comparehiddenvar 0xBB 0xC9D0
    nop0 ' #raw 0x0
    checkobedience 0xBBCC
    CMD_C3 0xC8
    #raw 0xBF
    comparehiddenvar 0x0 0xDDE8
    #raw 0xE1
    #raw 0xD9
    tempspriteface 0xFB 0xCE
    #raw 0xE3
    #raw 0xD8
    #raw 0xD5
    #raw 0xED
    #raw 0xB8
    nop0 ' #raw 0x0
    #raw 0xEB
    #raw 0xD9
    givetocoincase 55782 ' Bear in mind, it's not in hex
    nop0 ' #raw 0x0
    #raw 0xDB
    #raw 0xE3
    #raw 0xDD
    #raw 0xE2
    #raw 0xDB
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xE4
    #raw 0xE6
    #raw 0xE3
    #raw 0xDA
    #raw 0xDD
    #raw 0xE0
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xFD
    end

    #org 0x8162558
    '-----------------------------------
    nop0 ' #raw 0x0
    setmaptile 0x6 0x11 0x252 0x0
    setmaptile 0x9 0x4 0x24A 0x1
    setmaptile 0x9 0x5 0x252 0x0
    setmaptile 0x9 0x7 0x24A 0x1
    setmaptile 0x9 0x8 0x252 0x0
    setmaptile 0xC 0xD 0x24A 0x1
    setmaptile 0xC 0xE 0x252 0x0
    setmaptile 0xC 0x10 0x24A 0x1
    setmaptile 0xC 0x11 0x252 0x0
    return

    #org 0x8162561
    '-----------------------------------
    nop0 ' #raw 0x0
    setmaptile 0x9 0x4 0x24A 0x1
    setmaptile 0x9 0x5 0x252 0x0
    setmaptile 0x9 0x7 0x24A 0x1
    setmaptile 0x9 0x8 0x252 0x0
    setmaptile 0xC 0xD 0x24A 0x1
    setmaptile 0xC 0xE 0x252 0x0
    setmaptile 0xC 0x10 0x24A 0x1
    setmaptile 0xC 0x11 0x252 0x0
    return

    .... and then, in the game, the battle obviously freezes up. I feel like i'm missing something really simple here, can anyone help? thank you so much.
    Reply With Quote