• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

smellybellysrock

Legend Of Band Camp: You ready
76
Posts
15
Years
  • Seen Aug 8, 2011
Well, you see, I want this script to activate when the player steps on it, but I just can't seem to get it right. Can somebody correct it?
Spoiler:


(I use PKSV)
 

Saitou

 
118
Posts
13
Years
  • Seen Aug 18, 2014
I have been having this 'problem' for a while now, and my attempts to understand it failed, so I want to ask for help here. Okay, so I am using XSE, and have been for a couple of days now, after trying PokeScript, which has a very rough, raw syntax.

My question is about the '#dynamic' call. Suppose you made a small or even large script, does the '#dynamic' command check how many bytes needed to modify the free space in the ROM first, and then assigns an available offset that can hold those bytes? Or does something else check how many bytes this script will take in the ROM's memory?

And about the built-in commands, is there a place to know how much bytes each will use, as in it's raw form?
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Well, you see, I want this script to activate when the player steps on it, but I just can't seem to get it right. Can somebody correct it?
Spoiler:


(I use PKSV)

Try changing the second unknown byte to 03. I've seen it a lot in nintendo scripts. If that doesn't work, change the script to another script such as this:

Code:
#org 0xoffset
goto 0xoffset

I have been having this 'problem' for a while now, and my attempts to understand it failed, so I want to ask for help here. Okay, so I am using XSE, and have been for a couple of days now, after trying PokeScript, which has a very rough, raw syntax.

My question is about the '#dynamic' call. Suppose you made a small or even large script, does the '#dynamic' command check how many bytes needed to modify the free space in the ROM first, and then assigns an available offset that can hold those bytes? Or does something else check how many bytes this script will take in the ROM's memory?

And about the built-in commands, is there a place to know how much bytes each will use, as in it's raw form?

Basically, imagine #dynamic as free-space finder. All it does is tells it where to start, and the number of free space to look for is the scripts byte length. Simple.

So
#dynamic 0x800000
would search from free space with enough room for the script ;)

For your second question:One byte for the command, and the arguments follow it. (Flipped)
For example:
Code:
callasm 0x800000
would be:
Code:
23 00 00 80 08
Does this help?
 
40
Posts
14
Years
  • Seen Jun 10, 2023
Hey can anyone help me? Im trying to find a give pokemon menu script like for example you have to chose one pokemon betwen 3 pokemon

I tried this script but it doesnt work:

#org $StartChik
checkflag 0x800
if B_True goto $NoBall
message $Chick
$Chick 1 = Chikorita!\lThe Fire Bird.\pTake the Chikorita?
boxset 5
compare LASTRESULT 1
if B_False goto $PutBack
givepokemon 152 5 0
jingle
message $GotChick
$GotChick 1 = You Recieved a Chikorita
boxset 6
message $NameChick
$NameChick 1 = Would You like to give Chikorita a name?
boxset 5
compare LASTRESULT 1
if b_False goto $GiveDex
Namepokemon
setflag 0x203
goto $GiveDex

#org $StartShrew
checkflag 0x800
if B_True goto $NoBall
message $Shrew
$Shrew 1 = SandShrew!\lDesert Mole.\pTake the Sandshrew?
boxset 5
compare LASTRESULT 1
if B_False goto $PutBack
givepokemon 27 5 0
jingle
message $GotChick
$GotShrew 1 = You Recieved a Sandshrew
boxset 6
message $NameShrew
$NameShrew 1 = Would You like to give Sandshrew a name?
boxset 5
compare LASTRESULT 1
if b_False goto $GiveDex
Namepokemon
setflag 0x204
goto $GiveDex

#org $StartWing
checkflag 0x800
if B_True goto $NoBall
message $Chick
$Wing 1 = Wingull!\lThe Ocean Bird.\pTake the Wingull?
boxset 5
compare LASTRESULT 1
if B_False goto $PutBack
givepokemon 152 5 0
jingle
message $GotGull
$GotGull 1 = You Recieved a Wingull
boxset 6
message $NameGull
$NameGull 1 = Would You like to give Wingull a name?
boxset 5
compare LASTRESULT 1
if b_False goto $GiveDex
Namepokemon
setflag 0x205
goto $GiveDex

#org $GiveDex
setflag 0x800
setflag 0x801
message $Pokedex
$Pokedex 1 = I hope You like your new pokemon.\pWhile your on your journeys I have\la favour to ask you.\pProf OAK and I are trying to make an\lindex of everything pokemon.\pTake this pokedex with you and it\lwill log all the pokemon you see and catch.\pIt would greatly help our studies!
boxset 6
jingle
message $GotDex
$Gotdex 1 = You got the Pokedex!
boxset 6
end

#org $PutBack
message $PutBack
$PutBack 1 = You put the pokeball back.
boxset 6
end

#org $NoBall
message $Lastball
$Lastball 1 = You already have your pokemon.\nDont be so greedy!
boxset 6
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Having troubles with a level scrip D:
Alright so after the second movements 'left' and 'right' the script just stops... And you return to playing... So if someone could help out with this it would be great as I need to get it up to the warp

Script
Code:
'---------------
#org 0x730000
lock
setvar 0x4033 0x1
playsong 0x133 0x0
applymovement 0x1 0x8730041
applymovement MOVE_PLAYER 0x8730041
waitmovement 0x0
waitmovement 0x0
msgbox 0x873004A MSG_SIGN '"Filler"
applymovement MOVE_PLAYER 0x8730044
applymovement 0x1 0x8730047
waitmovement 0x0
waitmovement 0x0
fadedefault
msgbox 0x8730253 MSG_NORMAL "'Filler"
warp 0x4 0x3 0x0 0x0 0x0
release
end


'---------
' Strings
'---------
#org 0x73004A
= Filler

#org 0x730253
= Filler

'-----------
' Movements
'-----------
#org 0x730041
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

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

#org 0x730047
#raw 0x3 'Face Right
#raw 0xFE 'End of Movements
 

Alignment

Revered with the stars
308
Posts
14
Years
  • Seen Dec 25, 2016
Code:
#dyn 0x740000
#org @start
lock
setvar 0x4033 0x1
playsong 0x133
applymovement 0x1 0x8730041
applymovement PLAYER 0x8730041
pauseevent 0x0
msgbox 0x873004A
callstd MSG_NORMAL
applymovement PLAYER 0x8730044
applymovement 0x1 0x8730047
pauseevent 0x0
fadedefault
msgbox 0x8730253
callstd MSG_NORMAL
warp 0x4 0x3 0x0 0x0
release
end


#org 0x73004A
= Filler

#org 0x730253
= Filler

#org 0x730041
m Look_up end

#org 0x730044
m look_left end

#org 0x730047
m look_right end

I converted it into PKSV, it should be fine. I'm not sure how to fix it in XSE (though I don't think you need 2 waitmovements? )
 
119
Posts
14
Years
I made this level script. Everything runs fine, but at the end there appears a msgbox with random symbols. This is the script:
Code:
#dynamic 0x162CDD

#org @start
setvar 0x7003 0x1
applymovement 0xFF @move1
waitmovement 0x0
applymovement 0x4 @move2
waitmovement 0x0
msgbox @talk 0x6
pause 0x20
applymovement 0x4 @move5
waitmovement 0x0
applymovement 0x3 @move3
applymovement 0x2 @move3
applymovement 0x1 @move3
waitmovement 0x0
end

#org @move1
#raw 0x1
#raw 0xFE

#org @move2
#raw 0x3
#raw 0xFE

#org @move3
#raw 0x21
#raw 0xFE

#org @move5
#raw 0x1
#raw 0x62
#raw 0xFE

#org @talk
= Blah!

What went wrong?
 
5,256
Posts
16
Years
I made this level script. Everything runs fine, but at the end there appears a msgbox with random symbols. This is the script:
Code:
#dynamic 0x162CDD

#org @start
setvar 0x7003 0x1
applymovement 0xFF @move1
waitmovement 0x0
applymovement 0x4 @move2
waitmovement 0x0
msgbox @talk 0x6
pause 0x20
applymovement 0x4 @move5
waitmovement 0x0
applymovement 0x3 @move3
applymovement 0x2 @move3
applymovement 0x1 @move3
waitmovement 0x0
end

#org @move1
#raw 0x1
#raw 0xFE

#org @move2
#raw 0x3
#raw 0xFE

#org @move3
#raw 0x21
#raw 0xFE

#org @move5
#raw 0x1
#raw 0x62
#raw 0xFE

#org @talk
= Blah!
What went wrong?
In Advance Map, go to Professional View (CTRL+H), then go to "Map Script offset:", copy the offset there, open up XSE, load your ROM, paste the offset in the box next to "Offset", and then click the spanner at the far right, then the Spanner and Screwdriver icon next to it, twice. On the script will be a section like this:

#org @start
#raw 0x2
#raw pointer 0xoffset
#raw 0x0

#org 0xoffset
#raw word 0x7000
#raw word 0x0
#raw pointer @offset1
#raw word 0xFFFF


If the last #raw word isn't 0x0, change it to that. So, in my example, #raw word 0xFFFF will become #raw word 0x0.
Recompile the script, and paste the offset in the space you previously got the offset from, and then hit the Save changes and reload map button.

Code:
#dyn 0x740000
#org @start
lock
setvar 0x4033 0x1
playsong 0x133
applymovement 0x1 0x8730041
applymovement PLAYER 0x8730041
pauseevent 0x0
msgbox 0x873004A
callstd MSG_NORMAL
applymovement PLAYER 0x8730044
applymovement 0x1 0x8730047
pauseevent 0x0
fadedefault
msgbox 0x8730253
callstd MSG_NORMAL
warp 0x4 0x3 0x0 0x0
release
end


#org 0x73004A
= Filler

#org 0x730253
= Filler

#org 0x730041
m Look_up end

#org 0x730044
m look_left end

#org 0x730047
m look_right end
I converted it into PKSV, it should be fine. I'm not sure how to fix it in XSE (though I don't think you need 2 waitmovements? )

Code:
[B]#dynamic[/B] 0x740000

#org @start
lock
setvar 0x4033 0x1
playsong 0x133 [B]0x0[/B]
applymovement 0x1 0x8730041
applymovement [B]0xFF[/B] 0x8730041
[B]waitmovement 0x1
waitmovement 0xFF[/B] [B]// I feel safer using waitmovement then pauses.[/B]
msgbox 0x873004A [B]MSG_NORMAL[/B]
applymovement [B]0xFF[/B] 0x8730044
applymovement 0x1 0x8730047
[B]waitmovement 0xFF
waitmovement 0x1[/B]
fadedefault
msgbox 0x8730253 MSG_NORMAL
warp 0x4 0x3 0x0 0x0
release
end
 
#org 0x73004A
= Filler
 
#org 0x730253
= Filler
 
#org 0x730041
[B]#raw 0x1
#raw 0xFE[/B]
 
#org 0x730044
[B]#raw 0x2
#raw 0xFE
[/B] 
#org 0x730047
[B]#raw 0x3
#raw 0xFE[/B]
Ammendments in bold.
 
Last edited:
119
Posts
14
Years
In Advance Map, go to Professional View (CTRL+H), then go to "Map Script offset:", copy the offset there, open up XSE, load your ROM, paste the offset in the box next to "Offset", and then click the spanner at the far right, then the Spanner and Screwdriver icon next to it, twice. On the script will be a section like this:

#org @start
#raw 0x2
#raw pointer 0xoffset
#raw 0x0

#org 0xoffset
#raw word 0x7000
#raw word 0x0
#raw pointer @offset1
#raw word 0xFFFF


If the last #raw word isn't 0x0, change it to that. So, in my example, #raw word 0xFFFF will become #raw word 0x0.
Recompile the script, and paste the offset in the space you previously got the offset from, and then hit the Save changes and reload map button.
Thank you!!! It worked ^_^
 
5,256
Posts
16
Years
You're welcome. In the future, an easier, space- and time-saving method is to just add this before the actual script in your level scripts:

#org @setup
#raw 0x2
#raw pointer @setup1
#raw 0x0

#org @setup1
#raw word 0x7000 'This is the variable you set later on in your script.
#raw word 0x0
#raw pointer @start
#raw word 0x0

#org @start 'actual script goes here
...
release
end

And then pasting the offset straight into the Map Script offset box in the Professional View.
 
14
Posts
13
Years
  • Seen Mar 29, 2011
Okay, I have a relatively big problem with May. I'm working on making my own script, but for some reason, my own May was messed up. I'm really terrible with scripts, so I borrowed my base script for Ruby Destiny Reign of Legends. Here's the script

Spoiler:



... My character, which is using this script, is on a different map. Here is her information.

Person event
No: 1
Person even number: 1
Picture number: 240
Unknown: 00 00
Pos(X/Y): 0010,0007
Unknown: 03
Movement: 00
Unknown: 00
Trainer: No.
Unknown: 00
View radius:0000
Offset:14EB92
Person ID: 02D3
Unknown: 00 00

The script works for the most part, right about untill the end. At the end, May(Or Tamashii in this case) doesn't walk away and set the flag, allowing for the hero to get the pokedex and continue on his/her quest.

Another error is you can battle Tamashii over and over and over again.

Could someone please help me see what's wrong?
 
Last edited:
5,256
Posts
16
Years
I'm guessing this is the most fitting place to ask; Hm, the spriteinvisible command (and I'm also guessing the spritevisible command, but because the former isn't working, I can't tell) isn't working.
Here's the fragment of the script containing the command:
applymovement 0x4 @walk1
spriteinvisible 0x2 0x4 0x0
spriteinvisible 0x3 0x4 0x0
spriteinvisible 0x4 0x4 0x0
pause 0x10
setvar 0x7001 0x0


Perhaps there are extra parameters I am omitting? What I am trying to do is make the sprites 0x2, 0x3 and 0x4 in the downstairs of the Player's house (i.e Bank 4, Map 0) disappear, however nothing seems to happen. The rest of the script works perfectly.
(Yes, there is meant to be no waitmovement.)
 
119
Posts
14
Years
^ Don't you think it isn't working because there is no waitmovement?

My problem:
This script isn't working. It is a step-on-tile script. An other, similar script doesn't work either, so I must be doing something wrong.
Code:
#dynamic 0x16A617

#org @start
applymovement 0x2 @move1
waitmovement 0x0
msgbox @talk 0x6
end

#org @move1
#raw 0x62
#raw 0x02
#raw 0xFE

#org @talk
= Blahblah
 
5,256
Posts
16
Years
Uh, no, because the movement works perfectly. The sprite I'm tring to make invisible is not related to the movement at all.

Are you sure the scripts settings look like this?
Spoiler:

If not, do so.
 
40
Posts
14
Years
  • Seen Jun 10, 2023
Shiny quagsire the problem is i need to know in how to make give pokemon menu script like for example you have to chose betwen 3 pokemon

I tried this script but it doesnt work:

Spoiler:
 
Last edited by a moderator:
29
Posts
13
Years
  • Seen Mar 14, 2011
Hey. I've started scripting other things than just signposts :) This is a simple script I made, and it's not quite working. I only want this script to run once, and to prevent it from running more than one time I have checkflag and setflag in it. But by simply leaving and entering the house, it can run again :/

'---------------
#org 0x800143
checkflag 0x7
if 0x1 goto 0x880016C
msgbox 0x880016F MSG_FACE '"Â\n[player]! Wait!"
applymovement 0x1 0x880019B
waitmovement 0x0
msgbox 0x880017D MSG_FACE '"Omg does this really work?!"
setflag 0x7
release
end

'---------------
#org 0x80016C
release
end


'---------
' Strings
'---------
#org 0x80016F
= Â\n[player]! Wait!

#org 0x80017D
= Omg does this really work?!


'-----------
' Movements
'-----------
#org 0x80019B
#raw 0xF 'Step Right (Slow)
#raw 0xF 'Step Right (Slow)
#raw 0xD 'Step Up (Slow)
#raw 0xFE 'End of Movements
 
Status
Not open for further replies.
Back
Top