• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

thethethethe's Scripting Tutorial

There would be some setvars and copyvars in most 'green' scripts.
You still haven't said what you don't understand about them.

let me say it this way...

what is the purpose of variables in a rom???
or can you give some examples of the different ways on how to use it...
 
let me say it this way...

what is the purpose of variables in a rom???
or can you give some examples of the different ways on how to use it...

In some cases, variables could be used to get your position. (st. anne, script tile for rival battle) If you stepped on the left, a variable is set to 0, and when its compared to 0, the rival moves to the left... If on the middle, the variable is 1, so the rival moves to the middle and so on...

In other cases, like the one when you choose your starting pokemon, a variable is set so that your rival will know what pokemon he will use..

There are a lot of other uses.. can't name them all XD
 
for some reason I get a message that says

"run-time error '13'
type mismatch"
can anyone help?
 
grammar mistake maybe?
it would be helpful if you could post your script, otherwise we can't tell you what's wrong ^^
 
ok here it is. its really big so sorry

#org $getmew
countpokemon
compare LASTRESULT 0x1
if b_>= goto $done
#raw 0x55 0x03 0x00
clearflag 0x247
applymovement 0x03 $movealder
pausemove 0
applymovement 0x03 $jumpalder
applymovement 0xFF $jumpme
pausemove 0
applymovement 0x03 $givealder
pausemove 0
message $sorry
boxset 6
givepokemon 251 5 0
fanfare 0x13E
message $gotcelebi
boxset 4
waitfanfare
setflag 0x828
#raw 0x68
message $nickname
boxset 5
compare LASTRESULT 0x1
if b_true gosub $celebiname
message $got2go
boxset 6
applymovement 0xFF $outofway
pausemove 0
applymovement 0x03 $todoor
pausemove 0
#raw 0xAC 0x05 0x00 0x03 0x00
#raw 0xAE
applymovement 0x03 $goin
pausemove 0
#raw 0xAD 0x05 0x00 0x03 0x00
#raw 0xAE
#raw 0x53 0x03 0x00
setflag 0x247
#raw 0x55 0x05 0x00
clearflag 0x200
message $getprof
boxset 6
applymovement 0x05 $tome
pausemove 0
trainerbattle 1 0x146 $go $after $continue
end
#org $done
release
end
#org $movealder
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0xFE
#org $jumpalder
#raw 0x17 0xFE
#org $jumpme
#raw 0x16 0x03 0xFE
#org $givealder
#raw 0x1F 0x1F 0x1F 0x1F 0xFE
#org $sorry
$sorry 1 =Prof. Alder:Oh! \pI'm sorry for running into \nyou I'm just in a hurry \lhere just take this.
#org $gotcelebi
$gotmew 1 =You got a pokèmon!
#org $nickname
$nickname 1 =Would you like to nickname \nyour pokèmon?
#org $celebiname
call 0x1A74EB
return
#org $got2go
$got2go 1 =Now I need to go! \nsee me at my lab later.
#org $outofway
#raw 0x11 0x00 0xFE
#org $todoor
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0xFE
#org $goin
#raw 0x11 0xFE
#org $getprof
$getprof 1 =(What is going on!?!) \p???:Come back here!
#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE
#org $go
$go 1 =Oh no a witness, \nlooks like I'll have to \ltake care of you.
#org $after
$after 1 =The boss isn't going to \nlike this.
#org $continue
message $beatrival
boxset 6
applymovement 0x05 $rivalleave1
pausemove 0
#raw 0x53 0x05 0x00
setflag 0x200
#raw 0xAC 0x05 0x00 0x03 0x00
#raw 0xAE
#raw 0x55
clearflag 0x247
applymovement 0x03 $alderout
pausemove 0
#raw 0xAD 0x05 0x00 0x03 0x00
#raw 0xAE
applymovement 0x03 $alderwarp
pausemove 0
message $warp2lab
boxset 6
fadescreen 0x1
setflag 0x20A
warp 0x4 0x3 0x0
fadescreen 0x0
release
end
#org $beatrival
$beatrival 1 =I'll be back and beat you!
#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE
#org $alderout
#raw 0x10 0xFE
#org $alderwarp
#raw 0x13 0x13 0x13 0x13 0x13 0x01 0xFE
#org $warp2lab
$warp2lab 1 =Well it seems you beat \nhim. \pSorry I put you in that \nsituation ,but I knew \lyou could handle it. \lFor helping me I have \la present for you \lback at the lab \lcom'on.

in some of the lines although it looks like I used enter but I didn't
 
#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE
#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE

Try writing each in two lines:

Code:
#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE
 
#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20 
#raw 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE
 
In some cases, variables could be used to get your position. (st. anne, script tile for rival battle) If you stepped on the left, a variable is set to 0, and when its compared to 0, the rival moves to the left... If on the middle, the variable is 1, so the rival moves to the middle and so on...

In other cases, like the one when you choose your starting pokemon, a variable is set so that your rival will know what pokemon he will use..

There are a lot of other uses.. can't name them all XD

thnx alot...
now i understand what is their uses....
 
twi1ight:
your script seems okay, but listen to adiktus and write it in two lines ;)
Also, sometimes #binary works better, it's written like this:
#org $move
$move 1 ; #binary 0x13 0x13 0x13 0x13 0xFE

the movement codes are just the same ;)
( I said it SOMETIMES works better, normally it doesn't really matter if u use #raw or #binary).

Btw nice to see somebody using the doorcommands :D

And one suggestion: I'm not sure if #raw 0x55 will work allright if clearflag is written afterwards, write it before (then it will work for sure, I always do it like this).
clearflag 0x200
#raw 0x55 0x01 0x00

That's all, I think.
And to get a better structure in your script to overview everything:
Maka a free line after each script, like
#org $begin
lock
faceplayer
message $a
$a 1 = Yes or no?
boxset 5
compare 0x800D 0x1
if 1 goto $yes
message $no
$no 1 = You chose no.
release
end

#org $yes
..........................................don't want to write more, just wanted to show ^^
 
I can't see anything wrong in this script.
Which Advance Map are you using?
I am using 1.90, and there the fields "unknown" and "variable number" looks like this:
Unknown: 0003
Var.Number:4051

And it works!
Hope that's the problem.


Is it,

unknown 0003
var number 4050
in all games or just fr/lg because my script (which convieniently had the unknown and var number problem) works fine in fr/lg
below is th script I used

'-----------------------
#org 0x800345
msgbox 0x8800362 '"Koo: hey he's over there\n[player]:..."
callstd 0x6
applymovement MOVE_PLAYER 0x880039B
pause 0x40
warp 0x0 0x2 0x1 0xE 0x11
releaseall
end

'-----------
' Movements
'-----------
#org 0x80039B
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements

'---------
' Strings
'---------
#org 0x800362
= Koo: hey he's over there\n[player]: oh boy better bail.
 
Uhmm.. I hate to bother.. but how can I make the Pokemon speak with you before the cry and battle?
 
Uhmm.. I hate to bother.. but how can I make the Pokemon speak with you before the cry and battle?
That has nothing to do with the topic. Stay on topic next time, as you can see, this is a scripting thread. Not a ask any Rom hacking questions thread. For that, you should click on ROM hacking, then scroll down to "Simple questions".

Anyways, in order to do that, you have to insert the music over the cry. And please, just because I answered you, that doesn't mean I know how to do it. So Don't PM ME.
 
I'd say what he meant is just using a message before writing cry O.o
so
message $1
$1 1 = Pikachu: Pika-pika!
boxset 6
cry 0xA1 etc....

Though cooley is right, this is a tutorial, question into the simple question thread of if it's a more complicated script problem into the scrap box- script help thread.
 
That has nothing to do with the topic. Stay on topic next time, as you can see, this is a scripting thread. Not a ask any Rom hacking questions thread. For that, you should click on ROM hacking, then scroll down to "Simple questions".


I thought it did.. I was asking how to do in in the same script.

And please, just because I answered you, that doesn't mean I know how to do it. So Don't PM ME.

I wasn't going to.

I'd say what he meant is just using a message before writing cry O.o

Yes, that's what I meant, thank you.


Though cooley is right, this is a tutorial, question into the simple question thread of if it's a more complicated script problem into the scrap box- script help thread.

Okay, I will next time, like I said, "Sorry to bother."
 
Last edited by a moderator:
thnx guys srry im not thanking you earlier but ive been busy more trouble :(
but I have a question how do you use pokescript for a-map if its in the wrong place im srry but wat r the settings and do you use bufrite or pokescript? thanx.
 
Do you know abot "buffer" (bufferpokemon, bufferitem...)?
Can I explain me?
 
thnx guys srry im not thanking you earlier but ive been busy more trouble :(
but I have a question how do you use pokescript for a-map if its in the wrong place im srry but wat r the settings and do you use bufrite or pokescript? thanx.
What? I don't understand what you're asking.

Do you know abot "buffer" (bufferpokemon, bufferitem...)?
Can I explain me?
I have those in the tutorial. Except those are XSE commands. I never game a command name to them in the tutorial. These commands begin at the top of the third post.
Like I explained it with "display Pokemon Name". In XSE terms this command is bufferpokemon.
Also "Display Item Name", in XSE terms is buffer item.
 
I am trying to get a give Eevee script, but the options are $60 and $55. Here is the script:

Code:
#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 70 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =The Ranger Union has found\nThis Eevee.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received an Eevee!

#org $4
$4 1 =\c\h01\h02Would you like to rename Eevee?

#org $5
$5 1 =Take Care of Eevee.

#org $6
$6 1 =I hope you're taking good care of\nEevee.

What am I doing wrong??
 
Now I'm gonna answer before you Jason... How does that fell? HAHA!
yes i mean the open script option
Then use HM's XSE. It contain a Decompiller... Chose the file of it, and that's all...

I am trying to get a give Eevee script, but the options are $60 and $55. Here is the script:

Code:
#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 70 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =The Ranger Union has found\nThis Eevee.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received an Eevee!

#org $4
$4 1 =\c\h01\h02Would you like to rename Eevee?

#org $5
$5 1 =Take Care of Eevee.

#org $6
$6 1 =I hope you're taking good care of\nEevee.

What am I doing wrong??
You'll need to write the numbers in hex I would say... Try put 85
(If 133 is eevee) (70 to hex is about 45... But you'll better calcolate that to be sure...)
 
Back
Top