View Single Post
  #2540    
Old November 27th, 2009, 01:45 PM
Bela's Avatar
Bela
Pokémon Rose Creator
Community Supporter
 
Join Date: Apr 2009
Location: United States
Age: 24
Gender: Male
Nature: Modest
Game: Pokémon Rose Version (Fire Red Hack)

Type: A Trigger Script (you walk over a green script tile)

Editor: I'm using PokeScript to put the script into the game, and I'm using XSE to view the script.

Script:

What I wrote and compiled with PokeScript:

Spoiler:
#org $mom1
lock
setvar 0x4001 0x0
goto $mom

#org $mom2
lock
setvar 0x4001 0x1
goto $mom

#org $mom
playsong 0x110 0x0
message $mom3
$mom3 1 = Good morning, dear!
boxset 6
compare 0x4001 0x0
if 1 goto $move1
goto $move2

#org $move1
applymovement 0xFF $move3
$move3 1 ; #binary 0x10 0x12 0x12 0x10 0xFE
pausemove 0x0
goto $mom4

#org $move2
applymovement 0xFF $move4
$move4 1 ; #binary 0x10 0x12 0x12 0x12 0x10 0xFE
pausemove 0x0
goto $mom4

#org $mom4
message $mom5
$mom5 1 = You should read the morning\nnewspaper, \v\h01.\pIt says Professor Larch has\nreturned from his trip abroad\lwhere he met Professor...\pOh! The page is torn.\nI wonder what that Professor's\lname was...
boxset 6
goto $mom6

#org $mom6
message $mom7
$mom7 1 = Hmm... Let's see...
boxset 6
goto $oak

#org $oak
message $oak1
$oak1 1 = Was it Professor Oak?
boxset 5
compare LASTRESULT 1
if 1 goto $oak2
goto $elm

#org $elm
message $elm1
$elm1 1 = Was it Professor Elm?
boxset 5
compare LASTRESULT 1
if 1 goto $elm2
goto $birch

#org $birch
message $birch1
$birch1 1 = Was it Professor Birch?
boxset 5
compare LASTRESULT 1
if 1 goto $birch2
goto $mom6

#org $oak2
message $oak3
$oak3 1 = That's right, now I remember!\pIt was Professor Oak from the\nKanto region!
boxset 6
setvar 0x6000 0x0
goto $mom8

#org $elm2
message $elm3
$elm3 1 = That's right, now I remember!\pIt was Professor Elm from the\nJohto region!
boxset 6
setvar 0x6000 0x1
goto $mom8

#org $birch2
message $birch3
$birch3 1 = That's right, now I remember!\pIt was Professor Birch from the\nHoenn region!
boxset 6
setvar 0x6000 0x2
goto $mom8

#org $mom8
message $mom9
$mom9 1 = Professor Larch should be\noutside.\pI'm sure his long trip has\nmade him miss being home!
setvar 0x6001 0x1
boxset 6
fadedefault
release
end



The script, as seen in XSE:

Spoiler:
'---------------
#org 0x801131
lock
setvar 0x4001 0x0
goto 0x8801147

'---------------
#org 0x801147
multichoice2 0x6C 0x61 0x79 0x73 0x6F
yesnobox 0x67 0x20
special2 0x3168 0x3031
comparefarbytes 0x20306826 0x1238000F
bufferitem 0x8 0x609
compare 0x4001 0x0
if 0x1 goto 0x8801172
goto 0x8801181

'---------------
#org 0x801172
applymovement MOVE_PLAYER 0x880124C
waitmovement 0x0
goto 0x8801190

'---------------
#org 0x801181
applymovement MOVE_PLAYER 0x8801251
waitmovement 0x0
goto 0x8801190

'---------------
#org 0x801190
msgbox 0x8801257 MSG_NORMAL '"You should read the morning\nnewsp..."
goto 0x880119D

'---------------
#org 0x80119D
msgbox 0x8801317 MSG_NORMAL '"Hmm... Let's see..."
goto 0x88011AA

'---------------
#org 0x8011AA
msgbox 0x880132B MSG_YESNO '"Was it Professor Oak?"
compare LASTRESULT 0x1
if 0x1 goto 0x88011F2
goto 0x88011C2

'---------------
#org 0x8011F2
msgbox 0x880136F MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x0
goto 0x8801228

'---------------
#org 0x8011C2
msgbox 0x8801341 MSG_YESNO '"Was it Professor Elm?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801204
goto 0x88011DA

'---------------
#org 0x801228
loadpointer 0x0 0x880144F '"Professor Larch should be\noutside..."
setvar 0x6001 0x1
callstd 0x6
playsong2 0x26C
hidecoins 0xE3 0xE3
'---------------
#org 0x801204
msgbox 0x88013B9 MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x1
goto 0x8801228

'---------------
#org 0x8011DA
msgbox 0x8801357 MSG_YESNO '"Was it Professor Birch?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801216
goto 0x880119D

'---------------
#org 0x801216
msgbox 0x8801403 MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x2
goto 0x8801228


'---------
' Strings
'---------
#org 0x801257
= You should read the morning\nnewspaper, [player].\pIt says Professor Larch has\nreturned from his trip abroad\lwhere he met Professor...\pOh! The page is torn.\nI wonder what that Professor's\lname was...

#org 0x801317
= Hmm... Let's see...

#org 0x80132B
= Was it Professor Oak?

#org 0x80136F
= That's right, now I remember!\pIt was Professor Oak from the\nKanto region!

#org 0x801341
= Was it Professor Elm?

#org 0x80144F
= Professor Larch should be\noutside.\pI'm sure his long trip has\nmade him miss being home!

#org 0x8013B9
= That's right, now I remember!\pIt was Professor Elm from the\nJohto region!

#org 0x801357
= Was it Professor Birch?

#org 0x801403
= That's right, now I remember!\pIt was Professor Birch from the\nHoenn region!


'-----------
' Movements
'-----------
#org 0x80124C
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org 0x801251
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements



Here's what happens:

Spoiler:


Nothing happens. The game freezes.


I previously edited the script and had this in XSE:

Spoiler:
'---------------
#org 0x800A4F
lock
setvar 0x4001 0x0
goto 0x8800A65

'---------------
#org 0x800A65
multichoice2 0x6C 0x61 0x79 0x73 0x6F
yesnobox 0x67 0x20
special2 0x3168 0x3031
comparefarbytes 0x20306826 0xB4C000F
bufferitem 0x8 0x609
compare 0x4001 0x0
if 0x1 goto 0x8800AB3
compare 0x4001 0x1
if 0x1 goto 0x8800ABE
msgbox 0x8800B60 MSG_NORMAL '"You should read the morning\nnewsp..."
goto 0x8800AC9

'---------------
#org 0x800AB3
applymovement MOVE_PLAYER 0x8800C78
waitmovement 0x0
return

'---------------
#org 0x800ABE
applymovement MOVE_PLAYER 0x8800C7D
waitmovement 0x0
return

'---------------
#org 0x800AC9
msgbox 0x8800C83 MSG_NORMAL '"Hmm... Let's see..."
goto 0x8800AD7

'---------------
#org 0x800AD7
msgbox 0x8800C97 MSG_YESNO '"Was it Professor Oak?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800B22
goto 0x8800AF0

'---------------
#org 0x800B22
msgbox 0x8800CDB MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x0
return

'---------------
#org 0x800AF0
msgbox 0x8800CAD MSG_YESNO '"Was it Professor Elm?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800B30
goto 0x8800B09

'---------------
#org 0x800B30
msgbox 0x8800D25 MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x1
return

'---------------
#org 0x800B09
msgbox 0x8800CC3 MSG_YESNO '"Was it Professor Birch?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800B3E
goto 0x8800AC9

'---------------
#org 0x800B3E
msgbox 0x8800D6F MSG_NORMAL '"That's right, now I remember!\pIt ..."
setvar 0x6000 0x2
return


'---------
' Strings
'---------
#org 0x800B60
= You should read the morning\nnewspaper, [player].\pIt says Professor Larch has\nreturned from his trip abroad\lwhere he met Professor...\pOh! The page is torn.\nI wonder what that Professor's\lname was...

#org 0x800C83
= Hmm... Let's see...

#org 0x800C97
= Was it Professor Oak?

#org 0x800CDB
= That's right, now I remember!\pIt was Professor Oak from the\nKanto region!

#org 0x800CAD
= Was it Professor Elm?

#org 0x800D25
= That's right, now I remember!\pIt was Professor Elm from the\nJohto region!

#org 0x800CC3
= Was it Professor Birch?

#org 0x800D6F
= That's right, now I remember!\pIt was Professor Birch from the\nHoenn region!


'-----------
' Movements
'-----------
#org 0x800C78
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org 0x800C7D
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements



With this result in-game:

Spoiler:


Some strange box. I assume this is what that "multichoice" refers to. Within this box I can select two options, with the second making the arrow disappear. Pressing A on the second option does nothing; pressing A on the first makes the following happen:



A Yes/No box. Selecting either "Yes" or "No" will...



...make the game crash.


So, in short, XSE shows that the messages I want to have in this dialogue do in fact appear, and the movements for the player do, in fact, appear--it's the part right after setting variable 0x4001 that is messing up.

What this script is SUPPOSED to do is:

1. Stop the player and set the appropriate variable for the movement part of the script.
2. First message from the mother
3. Movement towards the mother
4. Another message
5. Followed by another message
6. Oak question (Yes: go to 9, No: go to 7)
7. Elm question (Yes: go to 10, No: go to 8)
8. Birch question (Yes: go to 11, No: go to 5)
9: Another message from the mom, and a variable is set (go to 12)
10: Another message from the mom, and a variable is set (go to 12)
11: Another message from the mom, and a variable is set (go to 12)
12: A final message by the mom, a variable is set to prevent this script from occurring again, and the script ends.
__________________