• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
5,256
Posts
16
Years
Edits in bold.

Code:
#dynamic 0x[B]800000[/B]

#org @start
checkflag 0x828
if 0x1 goto @end
[B]lock
faceplayer[/B]
[B]showpokepic 0xE4 0x10 0x3[/B]
msgbox @poke [B]0x5[/B]
[B]compare LASTRESULT 0x1[/B]
if 0x1 goto @give
hidepokepic
release
end

#org @end
[B]release[/B]
end

#org @give
hidepokepic
givepokemon 0xE4 0x6 0x0 0x0 0x0 0x0
fanfare 0x13E
[B]preparemsg @given[/B]
[B]waitmsg[/B]
waitfanfare
setflag 0x828
[B]release
end[/B]

#org @poke
= Would you like HOUNDOUR, the\nDARK and FIRE-type POKéMON?

#org @given
= [B][PLAYER][/B] recieved HOUNDOUR!
Okay, so it's best to just put 0x800000 at the beginning of scripts and let XSE give you the offset. This is a person event, I assume, so I've added in a lock and faceplayer. It would probably be best to show the Pokémon before the player has chosen to help influence them/remind them what Pokémon it is, etc.

If you're using the most recent version of XSE, then the boxset command is useless - just add 0x5, 0x2, 0x6, whatever after "msgbox @string1". As it's 0x5, you need to check whether the player said yes or no, so that's what the compare line is for - 0x1 means the player chose yes, 0x0 means the player chose no. The next line then sends the script to @give if the player did choose yes.

When using fanfares, it's probably best to use the format I've addded in, and finally, I've added a release end as it's needed.

All you need to do now is load your ROM in XSE, paste the script in, hit the blue gears (compile) button, copy the offset given for @start, and paste it in the Script offset input box of the person event you want the script to be assigned to, and hit save.

Hope I've helped.
 
79
Posts
13
Years
  • Seen Aug 27, 2014
Edits in bold.

Code:
#dynamic 0x[B]800000[/B]

#org @start
checkflag 0x828
if 0x1 goto @end
[B]lock
faceplayer[/B]
[B]showpokepic 0xE4 0x10 0x3[/B]
msgbox @poke [B]0x5[/B]
[B]compare LASTRESULT 0x1[/B]
if 0x1 goto @give
hidepokepic
release
end

#org @end
[B]release[/B]
end

#org @give
hidepokepic
givepokemon 0xE4 0x6 0x0 0x0 0x0 0x0
fanfare 0x13E
[B]preparemsg @given[/B]
[B]waitmsg[/B]
waitfanfare
setflag 0x828
[B]release
end[/B]

#org @poke
= Would you like HOUNDOUR, the\nDARK and FIRE-type POKéMON?

#org @given
= [B][PLAYER][/B] recieved HOUNDOUR!
Okay, so it's best to just put 0x800000 at the beginning of scripts and let XSE give you the offset. This is a person event, I assume, so I've added in a lock and faceplayer. It would probably be best to show the Pokémon before the player has chosen to help influence them/remind them what Pokémon it is, etc.

If you're using the most recent version of XSE, then the boxset command is useless - just add 0x5, 0x2, 0x6, whatever after "msgbox @string1". As it's 0x5, you need to check whether the player said yes or no, so that's what the compare line is for - 0x1 means the player chose yes, 0x0 means the player chose no. The next line then sends the script to @give if the player did choose yes.

When using fanfares, it's probably best to use the format I've addded in, and finally, I've added a release end as it's needed.

All you need to do now is load your ROM in XSE, paste the script in, hit the blue gears (compile) button, copy the offset given for @start, and paste it in the Script offset input box of the person event you want the script to be assigned to, and hit save.

Hope I've helped.

when i try to compile it says unkown keyword perparemsg
 

Complans

Trainer
98
Posts
14
Years
  • Seen Aug 27, 2015
I need help with this. It's meant to, if the player has the Pokedex and hasn't activated the flag (which is activated by finishing this script) Oak gives the player the National Dex. I don't see anything wrong with it..

Spoiler:
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
I need help with this. It's meant to, if the player has the Pokedex and hasn't activated the flag (which is activated by finishing this script) Oak gives the player the National Dex. I don't see anything wrong with it..

Spoiler:

The changes are in red...
 
1
Posts
13
Years
  • Seen Jun 13, 2011
I have a question.In Battle Tower, multi battles are using front sprites for player and tag team partner. I'm trying to change that to use backsprites. Since there are no backsprites for regular trainers, i want to switch tag team partners to characters that has backsprites. I should change trainers in the sallon that we choose partner too, they should be switched to Steven,Brendan,Red and other trainers that has backsprites.

But despite that i tried to change scripts of battle tower regular ways with the Advance Map, I didn't find the scripts that i need to change. I clicked on the players but the "Open Script" button was still unable to click. I changed the world sprites easily but i still don't have any idea about switching front sprites to backsprites. In the other hand i need to have codes for backsprites to reveal them in the Tilemolester somehow. It is possible to switch them?
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Doesn't work, nothing happens.

Then maybe you should use a different flag.

Anyway, I tried fixing your script once again.
Code:
#dynamic 0x805000

#org @begin
checkflag 0x829
if 0x0 goto @done
checkflag 0x1872
if 0x0 goto @hek
release
end

#org @done
release
end

#org @hek
lock
msgbox @wait 0x6
applymovement 0x5 @toplayer
waitmovement 0x0
msgbox @forgot 0x6
special 0x16F
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
msgbox @cya 0x6
applymovement 0x5 @back
waitmovement 0x0
setflag 0x1872
release
end

#org @wait
= Oak: Wait a second!

#org @forgot
= I almost forgot. I need to give\nyou this National Pokedex, there\lhave been reports of Roaming\lPokemon from Hoenn lately.\pThe National Pokedex allows you to\nrecord data about Pokemon from\lother regions.\pHere you go!

#org @yay
= [black_fr][player] obtained the National Pokedex!

#org @cya
= Oak: Take care now!

#org @toplayer
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @back
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x0
#raw 0xFE
edit:
Here's a video for you to see that the script I posted is working properly.


But if your script is a trigger-type of script, then write 0003 on the 'Unknown' field and 4050 on the 'Var number' field...
mappy2.png
 
Last edited:

Complans

Trainer
98
Posts
14
Years
  • Seen Aug 27, 2015


Then maybe you should use a different flag.

Anyway, I tried fixing your script once again.
Code:
#dynamic 0x805000

#org @begin
checkflag 0x829
if 0x0 goto @done
checkflag 0x1872
if 0x0 goto @hek
release
end

#org @done
release
end

#org @hek
lock
msgbox @wait 0x6
applymovement 0x5 @toplayer
waitmovement 0x0
msgbox @forgot 0x6
special 0x16F
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
msgbox @cya 0x6
applymovement 0x5 @back
waitmovement 0x0
setflag 0x1872
release
end

#org @wait
= Oak: Wait a second!

#org @forgot
= I almost forgot. I need to give\nyou this National Pokedex, there\lhave been reports of Roaming\lPokemon from Hoenn lately.\pThe National Pokedex allows you to\nrecord data about Pokemon from\lother regions.\pHere you go!

#org @yay
= [black_fr][player] obtained the National Pokedex!

#org @cya
= Oak: Take care now!

#org @toplayer
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @back
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x0
#raw 0xFE
edit:
Here's a video for you to see that the script I posted is working properly.


But if your script is a trigger-type of script, then write 0003 on the 'Unknown' field and 4050 on the 'Var number' field...
mappy2.png

Ohh, I always used 0300 and 4050 for those values. Thank you so much :)
 

deoxys121

White Kyurem Cometh
1,254
Posts
13
Years
Help Editing Trade

Hi, I'm trying to edit the script for the Slakoth-for-Makuhita trade in Rustboro City in my Ruby hack. I want to make it so that you are giving a Wurmple for a Caterpie. Looking at the script.... I'm clueless. Here's the script for it. Any help would be greatly appreciated. Thanks!

Code:
#org 0x8157C7D
'-----------------------------------
lock
faceplayer
checkflag 0x99
if true jump 0x8157D13 ' Flag is set
setvar 0x8008 0x0
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x8184EBA ' Do you nickname your...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x8157CFB ' Equal To
special 0x9F
waitspecial
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if == jump 0x8157CFB ' Equal To
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if != jump 0x8157D05 ' Not Equal To
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitspecial
msgbox 0x8184F6B ' Eheheheh, ooh, this ...
callstd MSG_NOCLOSE ' Non-closing message
setflag 0x99
release
end

#org 0x8157D13
'-----------------------------------
msgbox 0x8184FDD ' Don't you get curiou...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end

#org 0x8157CFB
'-----------------------------------
msgbox 0x8184FC1 ' Aww, it's a good POK...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end

#org 0x8157D05
'-----------------------------------
storepokemon 0x0 0x8009
msgbox 0x8184F8F ' But that's no \v\h02...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end


#org 0x8184EBA
= Do you nickname your POK\eMON?\nI gave a cool name to mine.\pBut when I call my POK\eMON by that\nname, people laugh at me...\pIf it's okay with you, want to trade\nyour \v\h02 for my \v\h03?

#org 0x8184F6B
= Eheheheh, ooh, this is so exciting!

#org 0x8184FDD
= Don't you get curious about what other\npeople named their POK\eMON?

#org 0x8184FC1
= Aww, it's a good POK\eMON...

#org 0x8184F8F
= But that's no \v\h02.\nTch, that's so disappointing...
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Hi, I'm trying to edit the script for the Slakoth-for-Makuhita trade in Rustboro City in my Ruby hack. I want to make it so that you are giving a Wurmple for a Caterpie. Looking at the script.... I'm clueless. Here's the script for it. Any help would be greatly appreciated. Thanks!

Code:
#org 0x8157C7D
'-----------------------------------
lock
faceplayer
checkflag 0x99
if true jump 0x8157D13 ' Flag is set
setvar 0x8008 0x0
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x8184EBA ' Do you nickname your...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x8157CFB ' Equal To
special 0x9F
waitspecial
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if == jump 0x8157CFB ' Equal To
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if != jump 0x8157D05 ' Not Equal To
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitspecial
msgbox 0x8184F6B ' Eheheheh, ooh, this ...
callstd MSG_NOCLOSE ' Non-closing message
setflag 0x99
release
end
 
#org 0x8157D13
'-----------------------------------
msgbox 0x8184FDD ' Don't you get curiou...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
#org 0x8157CFB
'-----------------------------------
msgbox 0x8184FC1 ' Aww, it's a good POK...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
#org 0x8157D05
'-----------------------------------
storepokemon 0x0 0x8009
msgbox 0x8184F8F ' But that's no \v\h02...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
 
#org 0x8184EBA
= Do you nickname your POK\eMON?\nI gave a cool name to mine.\pBut when I call my POK\eMON by that\nname, people laugh at me...\pIf it's okay with you, want to trade\nyour \v\h02 for my \v\h03?
 
#org 0x8184F6B
= Eheheheh, ooh, this is so exciting!
 
#org 0x8184FDD
= Don't you get curious about what other\npeople named their POK\eMON?
 
#org 0x8184FC1
= Aww, it's a good POK\eMON...
 
#org 0x8184F8F
= But that's no \v\h02.\nTch, that's so disappointing...

You can't individually determine what Pokemon you trade/ recieve in a script like this (barring ASM of course). Each game has a series preset trades which are determined through the line 'setvar 0x8008 0xZZ' where ZZ tells the game which trade number will be occuring - trade 0 in this case. There is a tool that can change the Pokemon involved, but sadly it only works for BPRE FR.
 

DeepKickSavior

is readin' up on his XSE :3
10
Posts
13
Years
  • Age 29
  • USA
  • Seen Feb 28, 2013
#org $Trisha
lock
message $...
$... 1 = ... ...\nHmm...
boxset 6
applymovement 5 $down
$down 1 ; #binary 0x4A 0x62 0xFE
pause 0x20
message $oh
$oh 1 = Oh! Hi \v\h01! \nI can't get past here... \lThis tree needs to be CUT. \pI tried asking some of \nthe kids around here, \lbut they're all so rude. \pCould you help? \nPlease, follow me.
boxset 2
applymovement 5 $1st
$1st 1 ; #binary 0x13 0x14 0x02 0xFE
pausemove 0x0000
message $way
$way 1 = C'mon, this way!
boxset 2
applymovement 5 $2nd
$2nd 1 ; #binary 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x10 0x13 0x10 0x10 0x10 0x10 0x01 0xFE
pausemove 0x0000
setflag 0x1251
release
end



I can't get this script to work, I keep getting an error message "Run-Time Error 13 - Type Mismatch" when I try to compile it. I want the sprite to (starting from facing away from the player) say some stuff and then face the player, say more stuff, then walk right and jump down a ledge, stop, say more stuff, and walk offscreen where she waits to be talked to again (and where more movement will start) So far, the script works if I take out the last set of movements, thus ending the script with $way 1 = "...", boxset 2, release, and end (except at the end of the 2nd movement, the sprite faces left like I want her to, but them faces down when the messagebox comes up)

Please help D: also, I want to be able to move while the other sprite is moving, but I'm not too worried about that right now
 

Complans

Trainer
98
Posts
14
Years
  • Seen Aug 27, 2015
#org $Trisha
lock
message $...
$... 1 = ... ...\nHmm...
boxset 6
applymovement 5 $down
$down 1 ; #binary 0x4A 0x62 0xFE
pause 0x20
message $oh
$oh 1 = Oh! Hi \v\h01! \nI can't get past here... \lThis tree needs to be CUT. \pI tried asking some of \nthe kids around here, \lbut they're all so rude. \pCould you help? \nPlease, follow me.
boxset 2
applymovement 5 $1st
$1st 1 ; #binary 0x13 0x14 0x02 0xFE
pausemove 0x0000
message $way
$way 1 = C'mon, this way!
boxset 2
applymovement 5 $2nd
$2nd 1 ; #binary 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x10 0x13 0x10 0x10 0x10 0x10 0x01 0xFE
pausemove 0x0000
setflag 0x1251
release
end



I can't get this script to work, I keep getting an error message "Run-Time Error 13 - Type Mismatch" when I try to compile it. I want the sprite to (starting from facing away from the player) say some stuff and then face the player, say more stuff, then walk right and jump down a ledge, stop, say more stuff, and walk offscreen where she waits to be talked to again (and where more movement will start) So far, the script works if I take out the last set of movements, thus ending the script with $way 1 = "...", boxset 2, release, and end (except at the end of the 2nd movement, the sprite faces left like I want her to, but them faces down when the messagebox comes up)

Please help D: also, I want to be able to move while the other sprite is moving, but I'm not too worried about that right now

What script editor are you using?

And to make two sprites move at once, use two (or more) applymovements (one for each sprite) and then end the movements with one waitmovement pausemove.
 
Last edited:

DeepKickSavior

is readin' up on his XSE :3
10
Posts
13
Years
  • Age 29
  • USA
  • Seen Feb 28, 2013
What script editor are you using?

And to make two sprites move at once, use two (or more) applymovements (one for each sprite) and then end the movements with one waitmovement pausemove.

I'm using PoketScript since I started learning with it, and I can't seem to make the switch to XSE :P and I figured that, but what would the sprite # be for the hero? I'm pretty sure I saw a foullump video explaining that, so again, I'm not worried about that right now. I just want the one sprite to work :P
 

Complans

Trainer
98
Posts
14
Years
  • Seen Aug 27, 2015
I'm using PoketScript since I started learning with it, and I can't seem to make the switch to XSE :P and I figured that, but what would the sprite # be for the hero? I'm pretty sure I saw a foullump video explaining that, so again, I'm not worried about that right now. I just want the one sprite to work :P

The sprite # for the hero is FF, so 0xFF.
 
Status
Not open for further replies.
Back
Top