The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script Help Thread (DO NOT REQUEST SCRIPTS) (https://www.pokecommunity.com/showthread.php?t=163576)

Pokepal17 November 26th, 2009 6:59 PM

Quote:

Originally Posted by Quickster (Post 5353528)
Thanks,and ill remember to ask in the simple questions if it doenst directly involve a script,i was just hoping this could be done by scripting.

It can, didn't you see my post that replied to yours on the other page?

Anyway, I'll repeat it. You can use the scripting commmand: comparefarbytetobyte.

doesn't matter November 26th, 2009 9:01 PM

Quote:

Originally Posted by Pokepal17 (Post 5353209)
Yep, I believe the command comparefarbytetobyte is what you would need. :P

That actually sounds quite interesting. How would you go about using that?

/Circa November 26th, 2009 9:39 PM

In one of my maps, as soon as I take a left or right onto the script tiles the game freezes.

Code:

'---------------
#org 0x298D2A
checkflag 0x202
if 0x1 goto 0x8298D6F
lock
faceplayer
showsprite 0x4
msgbox 0x8298D90 MSG_NORMAL '"Hold on kiddo!"
applymovement MOVE_PLAYER 0x8298D72
waitmovement 0x0
applymovement 0x4 0x8298D75
waitmovement 0x0
msgbox 0x8298DA1 MSG_NORMAL '"Where the hell did you come from?\..."
applymovement 0x4 0x8298D83
waitmovement 0x0
hidesprite 0x4
setflag 0x202
release
end

'---------------
#org 0x298D6F
release
end

'---------
' Strings
'---------
#org 0x298D90
= Hold on kiddo!

#org 0x298DA1
= Where the hell did you come from?\nI saw that statue glow,\pthen you just pop out of nowhere!\nHmph... Ill figure it out.

'-----------
' Movements
'-----------
#org 0x298D72
#raw 0x2 'Face Left
#raw 0xFE 'End of Movements

#org 0x298D75
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x55 'Jump in Place (Facing Right)
#raw 0xFE 'End of Movements

#org 0x298D83
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0xFE 'End of Movements


I don't know if it's the script or if it's my rom.

Pokepal17 November 27th, 2009 4:11 AM

Quote:

Originally Posted by Amachi (Post 5353999)
That actually sounds quite interesting. How would you go about using that?

Comparefarbytetobyte compares a byte at a certain ram address with a certain value, It's useful for seeing how much time has passed or even for seeing what the player's gender is.

It's layout is this:

comparefarbytetobyte 0xpointer to ram address with byte value to compare with. 0xbyte to compare with.

Larsie13 November 27th, 2009 6:04 AM

In FR, the location for the playtime is at 0x20245C6 in the RAM. The first two bytes you'll find there are the hours of playtime, second byte minutes, then seconds and last, but not least, the milliseconds.
In R/S, the offset is 0x2024EB2, and in Emerald 0x2024A96. And indeed, you can check them with comparefarbytetobyte. To check for at least an hour of playtime, you would use:
Code:

comparefarbytetobyte 0x20245C6 0x1
if 0x4 goto @script


(Obviously, that's for FR/LG. In R/S/E, only the offset changes. The rest remains the same.)

Sierraffinity November 27th, 2009 6:53 AM

Quote:

Originally Posted by Larsie13 (Post 5354667)
In FR, the location for the playtime is at 0x20245C6 in the RAM. The first two bytes you'll find there are the hours of playtime, second byte minutes, then seconds and last, but not least, the milliseconds.
In R/S, the offset is 0x2024EB2, and in Emerald 0x2024A96. And indeed, you can check them with comparefarbytetobyte. To check for at least an hour of playtime, you would use:
Code:

comparefarbytetobyte 0x20245C6 0x1
if 0x4 goto @script


(Obviously, that's for FR/LG. In R/S/E, only the offset changes. The rest remains the same.)

Actually, this is not the case. The play time data, along with most of the other player data, actually moves around due to DMA (Direct Memory Access). The offset of the data is determined by a pointer at 0x300500C (which is in the IRAM, in case you're wondering.
You'll have to use ASM to access it. Read HackMew's Knowledge, ASM Tutorial 1, which explains how to access the player data.

Shiny_Noctowl November 27th, 2009 7:15 AM

I edited the map for Cinnabar Island (img21.imageshack.us/img21/1884/cinnabarisland.png), and now the script to keep you out of the Gym until you have the Secret Key doesn't work. How do I fix this?

Pokepal17 November 27th, 2009 9:16 AM

Quote:

Originally Posted by Shiny_Noctowl (Post 5354746)
I edited the map for Cinnabar Island (img21.imageshack.us/img21/1884/cinnabarisland.png), and now the script to keep you out of the Gym until you have the Secret Key doesn't work. How do I fix this?

You'll need to move the script tile to in front of Cinnibar Island's gym.

NarutoActor November 27th, 2009 9:55 AM

I have a script problem(duh)
the player is in a tight hallway and professor oke is one tile above you. I want him to follow you left and right so I wrote a script.
My first attempt used flags, and it worked on paper but no in game.
I then tried a referent way of doing things. I tried comparing the players facing so if he is facing left oke will move left, and if he faces right oke will move right. But When I play the game no matter what I do oke only moves left

'---------------
#org 0x71BBE4
lock
getplayerpos 0x6000 0x6001
compare PLAYERFACING 0x3
if 0x1 goto 0x871BC3E
compare PLAYERFACING 0x4
if 0x1 goto 0x871BC63
end

'---------------
#org 0x71BC3E
applymovement 0x17 0x871BC70
waitmovement 0x0
release
end

'---------------
#org 0x71BC63
applymovement 0x17 0x871BC73
waitmovement 0x0
release
end


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

#org 0x71BC73
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

Shiny_Noctowl November 27th, 2009 10:15 AM

Quote:

Originally Posted by Pokepal17 (Post 5354983)
You'll need to move the script tile to in front of Cinnibar Island's gym.

I did. It still doesn't work.

Pokepal17 November 27th, 2009 10:40 AM

Quote:

Originally Posted by Shiny_Noctowl (Post 5355102)
I did. It still doesn't work.

Hmm, remake the script yourself. :P

Ven November 27th, 2009 12:53 PM

I'd really appreciate it if someone could help me with this.

Game: FireRed
Type: Event
Editor: XSE
Script:
Spoiler:
#dynamic 0x71A28C

#org @start
checkflag 0x102
if 0x1 goto @noez
if 0x0 goto @continue
end

#org @noez
release
end

#org @continue
playsong 0x128 0x1
msgbox @text 0x6
closeonkeypress
special 0x113
applymovement 0x7F @move
waitmovement 0x0
special 0x114
applymovement 0x6 @move2
applymovement 0x7 @move3
applymovement 0x8 @move4
waitmovement 0x0
msgbox @text2 0x6
closeonkeypress
special 0x113
applymovement 0x7F @move5
waitmovement 0x0
special 0x114
setflag 0x102
setflag 0x103
end

#org @text
= [Blue_fr]H-help me!

#org @text2
= [blue_fr]Hello! You over there!\nPlease! Help!\pNear my BAG!\nThere's a POKé BALL!

#org @move
#raw 0x0A 0x0A 0xFE

#org @move2
#raw 0x20 0x20 0x1D 0x20 0x20 0x20 0x1D 0x1D 0x1F 0x1F 0x1E 0x1E 0x20 0x20 0x1D 0x02 0xFE

#org @move3
#raw 0x20 0x20 0x20 0x1D 0x20 0x20 0x20 0x1D 0x1D 0x1F 0x1F 0x1E 0x1E 0x20 0x1D 0x03 0xFE

#org @move4
#raw 0x1E 0x20 0x20 0x20 0x1D 0x20 0x20 0x20 0x1D 0x1D 0x1F 0x1F 0x1E 0x1E 0x20 0x20 0x00 0xFE

#org @move5
#raw 0x0F 0xFE

Screenshots and/or Videos: N/A
My main problem is on move2 move3 and move 4.
Move2 Work's perfectly, but the other two don't move at all, also the waitmovement command won't work, and it just goes straight to the text.
Also, I'm trying to make all three movements happen at the same time.

Bela November 27th, 2009 1:45 PM

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:
http://i50.*.com/2z6y3kj.jpg

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:
http://i50.*.com/2ldwzp.jpg

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:

http://i47.*.com/wtfg3.jpg

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

http://i46.*.com/wa4zls.jpg

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

Ninja Caterpie November 27th, 2009 5:19 PM

Quote:

Originally Posted by Holy Star (Post 5355519)
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:
http://i50.*.com/2z6y3kj.jpg

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:
http://i50.*.com/2ldwzp.jpg

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:

http://i47.*.com/wtfg3.jpg

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

http://i46.*.com/wa4zls.jpg

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

...which is why you should use XSE to write and compile scripts.

Pokepal17 November 27th, 2009 9:05 PM

Quote:

Originally Posted by NarutoActor (Post 5355060)
I have a script problem(duh)
the player is in a tight hallway and professor oke is one tile above you. I want him to follow you left and right so I wrote a script.
My first attempt used flags, and it worked on paper but no in game.
I then tried a referent way of doing things. I tried comparing the players facing so if he is facing left oke will move left, and if he faces right oke will move right. But When I play the game no matter what I do oke only moves left

'---------------
#org 0x71BBE4
lock
getplayerpos 0x6000 0x6001
compare PLAYERFACING 0x3
if 0x1 goto 0x871BC3E
compare PLAYERFACING 0x4
if 0x1 goto 0x871BC63
end

'---------------
#org 0x71BC3E
applymovement 0x17 0x871BC70
waitmovement 0x0
release
end

'---------------
#org 0x71BC63
applymovement 0x17 0x871BC73
waitmovement 0x0
release
end


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

#org 0x71BC73
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

First of all, remove the getplayerpos, it's not necessary. Also replace the compare PLAYERFACING 0x3 and 0x4 with PLAYERFACING FACE_LEFT and FACE_RIGHT.

NarutoActor November 27th, 2009 9:19 PM

Okay, I tryed that, and now he dosen't move at all.

Bela November 28th, 2009 12:07 AM

Quote:

Originally Posted by Ninja Caterpie (Post 5356070)
...which is why you should use XSE to write and compile scripts.

Poor Poke Script.

I used XSE instead and it worked just fine. I don't know what I was missing in the previous script, but it's irrelevant if I can make it work otherwise! =)

Satoshi Ookami November 28th, 2009 12:26 AM

Quote:

Originally Posted by Holy Star (Post 5356686)
I used XSE instead and it worked just fine. I don't know what I was missing in the previous script, but it's irrelevant if I can make it work otherwise! =)

Nothing ;)
Pokescript just bugs some scripts :)

qwertyuiop1234567890 : Use trigger script ;)

Pokepal17 November 28th, 2009 6:33 AM

Quote:

Originally Posted by NarutoActor (Post 5356512)
Okay, I tryed that, and now he dosen't move at all.

Then try this.

---------------
#org 0x71BBE4
lock
compare PLAYERFACING 0x3
if 0x1 goto 0x871BC3E
compare PLAYERFACING 0x4
if 0x1 goto 0x871BC63
end

'---------------
#org 0x71BC3E
applymovement 0x11 0x871BC70
waitmovement 0x0
release
end

'---------------
#org 0x71BC63
applymovement 0x11 0x871BC73
waitmovement 0x0
release
end


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

#org 0x71BC73
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

/Circa November 28th, 2009 3:38 PM

In one of my maps, as soon as I take a left or right onto the script tiles the game freezes.

Code:

'---------------
#org 0x298D2A
checkflag 0x202
if 0x1 goto 0x8298D6F
lock
faceplayer
showsprite 0x4
msgbox 0x8298D90 MSG_NORMAL '"Hold on kiddo!"
applymovement MOVE_PLAYER 0x8298D72
waitmovement 0x0
applymovement 0x4 0x8298D75
waitmovement 0x0
msgbox 0x8298DA1 MSG_NORMAL '"Where the hell did you come from?\..."
applymovement 0x4 0x8298D83
waitmovement 0x0
hidesprite 0x4
setflag 0x202
release
end

'---------------
#org 0x298D6F
release
end

'---------
' Strings
'---------
#org 0x298D90
= Hold on kiddo!

#org 0x298DA1
= Where the hell did you come from?\nI saw that statue glow,\pthen you just pop out of nowhere!\nHmph... Ill figure it out.

'-----------
' Movements
'-----------
#org 0x298D72
#raw 0x2 'Face Left
#raw 0xFE 'End of Movements

#org 0x298D75
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x55 'Jump in Place (Facing Right)
#raw 0xFE 'End of Movements

#org 0x298D83
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0x1F 'Step Left (Fast)
#raw 0xFE 'End of Movements


I don't know if it's the script or if it's my rom.

Reposting..

NarutoActor November 28th, 2009 5:59 PM

Quote:

Originally Posted by Pokepal17 (Post 5357101)
Then try this.

---------------
#org 0x71BBE4
lock
compare PLAYERFACING 0x3
if 0x1 goto 0x871BC3E
compare PLAYERFACING 0x4
if 0x1 goto 0x871BC63
end

'---------------
#org 0x71BC3E
applymovement 0x11 0x871BC70
waitmovement 0x0
release
end

'---------------
#org 0x71BC63
applymovement 0x11 0x871BC73
waitmovement 0x0
release
end


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

#org 0x71BC73
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

I already had the persons ID converted to hex (his number in advance map is 23) and from a script before this event his movements worked. But I tried it anyway and as I thought no change. I am going to try a new person event, some new offsets or compile it with pksv. Sometimes that fixes the problem.

Satoshi Ookami November 29th, 2009 12:01 AM

Cirnos Servant : It might have something to do with showsprite command... since if OW is hidden in FR it might sometimes be very buggy.

Anyways here's my problem.
After I patched ROM with Shinyzer I wanted to make trainer battle with trainer who has shiny pokemon but nothing happens when I talk to NPC and also freeze the game.

Code:

#dynamic 0xA000000
#org @start
setvar 0x8003 0xC05 (It's same llike HackMew has in his tut)
trainerbattle 0x0 0x1 0x0 @before @in
msgbox @after
callstd 0x6
release
end



liuyanghejerry November 29th, 2009 12:58 AM

Hi,does any one know that how to make a script happens when a moving(walking around) OW see you?
And the "Green S" script won't sutable for me ,because it can't get to know whether the OW see you.
It's just like a trainerbattle script ,but I don't want to have a battle.Something like this writing to a trainer will be crash:
Code:

#org @1
message @2 0x2
warp 0x1 0x7B 0xFF 0x2d 0x1c

#org @2
= blablabla...



Pokepal17 November 29th, 2009 6:24 AM

Quote:

Originally Posted by liuyanghejerry (Post 5359299)
Hi,does any one know that how to make a script happens when a moving(walking around) OW see you?
And the "Green S" script won't sutable for me ,because it can't get to know whether the OW see you.
It's just like a trainerbattle script ,but I don't want to have a battle.Something like this writing to a trainer will be crash:
Code:

#org @1
message @2 0x2
warp 0x1 0x7B 0xFF 0x2d 0x1c

#org @2
= blablabla...



Hmm, I don't believe there is so I think you'd have to use ASM.

BlitŻ November 29th, 2009 6:51 AM

Quote:

Originally Posted by Pokepal17 (Post 5359620)
Hmm, I don't believe there is so I think you'd have to use ASM.

Actually there is no ASM involved actually. On advance map, simply check the trainer box, specify how many spaces should the trainer be able to see you, and insert your script. So whenever the trainer sees you... I'm not sure after that. I haven't tested it out yet, because just thought it up in theory. I'm going to do a lot of testing today, so I'll edit this post when I've found out..


All times are GMT -8. The time now is 2:55 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.