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

[Archive] Script help thread

Status
Not open for further replies.
Okay i found the Emerald National Dex offset, applied it and got this

Code:
'-----------------------
#org 0xE3D07E
lock
faceplayer
msgbox 0x8E3D08D '"Here you may need this on your\njou..."
callstd 0x6
special 0x1F3
release
end
 
'---------
' Strings
'---------
#org 0xE3D08D
= Here you may need this on your\njourney. The Prof. is so\lscatter-brained he forgot to\limplement this feature in your dex.\lIt's the National Dex, use it to\lkeep a record of all your pokemon\lecounters.

It works, but i need some help with some movements...there is a lab assistant in Birch's lab...i need him to walk up to you AFTER you beat May and get the Hoenn Dex and pokeballs then give you the national dex...currently he is there and you have to go up to him and talk to him to get the ND

BTW i am using XSE
 
How to enable the National Dex in Ruby?
Ican't make a script for it.
 
How to enable the National Dex in Ruby?
Ican't make a script for it.

As i read above there is no specific offset for the ND in Ruby/Saph...you have to trade a Kanto/Jhoto pokemon from FR/LG to activate it.
 
I have a script:
Code:
'-----------------------
#org 0x15429E
lock
faceplayer
checkflag 0x9A
if 0x1 goto 0x8154338
setvar 0x8008 0x2
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x817940E '"Hello, TRAINER. Would you do me a f..."
callstd 0x5
compare LASTRESULT 0x0
if 0x1 goto 0x8154320
special 0x9F
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto 0x8154320
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if 0x5 goto 0x815432A
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitstate
bufferpokemon 0x0 0x8009
msgbox 0x81794C4 '"Wow!\nThis [buffer1] is so fluffy!"
callstd 0x4
setflag 0x9A
release
end

'-----------------------
#org 0x154338
msgbox 0x817950A '"Since we traded, you and me,\nwe're..."
callstd 0x4
release
end

'-----------------------
#org 0x154320
msgbox 0x81794ED '"I'm a little disappointed..."
callstd 0x4
release
end

'-----------------------
#org 0x15432A
bufferpokemon 0x0 0x8009
msgbox 0x81794DF '"That's no [buffer1]."
callstd 0x4
release
end


'---------
' Strings
'---------
#org 0x17940E
= Hello, TRAINER. Would you do me a favor\nand trade POKéMON with me?\pLiving in PACIFIDLOG, I can only catch\ncertain kinds of POKéMON.\p[buffer1]? Do you have one?\nI'll trade you my [buffer2] for it.

#org 0x1794C4
= Wow!\nThis [buffer1] is so fluffy!

#org 0x17950A
= Since we traded, you and me,\nwe're friends, aren't we?

#org 0x1794ED
= I'm a little disappointed...

#org 0x1794DF
= That's no [buffer1].

Can you explain it for me?
Thanks
 
The Script freezes after the first Earthquake. Does anyone know what's the problem?

Code:
#Dynamic 0x800000

#ORG @Main
checkflag 0x1001
if 1 goto @klaar
lock
#raw 0x55 0x02 0x00
applymovement 0x2 @move
waitmovement 0
applymovement 0xFF @wow
waitmovement 0
message @1
boxset 0x6
applymovement 0x2 @weg
waitmovement 0
applymovement 0xFF @uit
waitmovement 0
#raw 0x2F
#raw 0x4B
nop
setvar 0x8004 0x0
setvar 0x8005 0x9
setvar 0x8006 0x9
setvar 0x8007 0x9
special 0x136
pause 0
applymovement 0x2 @val1
waitmovement 0
applymovement 0xFF @val2
waitmovement 0
message @no
boxset 0x6
#raw 0x53 0x02 0x00
#raw 0x2F
#raw 0x4B
nop
setvar 0x8004 0x0
setvar 0x8005 0x3
setvar 0x8006 0x9
setvar 0x8007 0x2
special 0x136
pause 0
message @net
boxset 0x6
setflag 0x1001
release
end

#ORG @move
#raw 16
#raw 03
#raw FE

#ORG @wow
#raw 65
#raw FE

#ORG @1
= \v\h01:\c\h01\h08 Come back you little!!\p\c\h01\h02Pokémon:\c\h01\h06 Tree!Treecko!!

#ORG @weg
#raw 10
#raw 65
#raw FE

#ORG @uit
#raw 65
#raw 12
#raw FE

#ORG @val1
#raw 65
#raw FE

#ORG @val2
#raw 65
#raw FE

#ORG @no
= \v\h01:\c\h01\h08 Ow NOO!!\nThe Pokémon is about to fall!!\lI need to save it!!\pTreecko Return!!

#ORG @net
= \v\h01:\c\h01\h06 Yeah!\nI saved it just in time!

#ORG @klaar
release
end
 
I have this script that's pretty much exactly like the one where Birch says "Don't leave me like this!"

Code:
'-----------------------
#org 0x2914D5
lockall
msgbox 0x86B3A9E '"MOM's words echoed:\pAnd remember n..."
callstd 0x4
closeonkeypress
applymovement MOVE_PLAYER 0x86B3B06
waitmovement 0x0
releaseall
end


'-----------
' Movements
'-----------
#org 0x6B3B06
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x6B3A9E
= MOM's words echoed:\pAnd remember not to go into the tall\ngrass. Wild POKéMON might jump out.

But all it does is lock everything and then nothing else happens. Like I said earlier, it's exactly like the script where Birch doesn't let you leave, so I don't know what's wrong.
 
Can anyone tell me what's wrong with my script? (It says there's an error in the "give Pokemon" part-


Spoiler:
 
There was actually nothing wrong with my other script, but I figured out why it didn't work. But now I have a problem with this:

Code:
'-----------------------
#org 0x291572
lock
faceplayer
setvar 0x408D 0x3
setvar 0x4050 0x1
msgbox 0x829158E '"HI"
callstd 0x2
closeonkeypress
hidesprite LASTTALKED
fadescreen 0x0
release
end


'---------
' Strings
'---------
#org 0x29158E
= HI

It hides the sprite, but then it appears again as soon as I move at all.
 
HELP!!!

im totally new to hacking and ive just learned bout maps and texts and now i come across scripting???
can someone plz give a link to somewhere where i can learn the most basic stuff for people that have never scripted before?? a tutorial that can explain scripting from the very beginning?? and what is the best scripting program??
 
Last edited:
Jeez so many unanswered questions.

I decided to use XSE but when I type this script, a blank box comes out:
#Dynamic 0x376C3C

#ORG @Main
lock
faceplayer
Message @speak
Boxset 0x6
Release
End

#ORG @speak
= I'm a little kid.
Doesn't seem to be anything wrong with it. The Dynamic offset is ok since XSE looks for free space after that offset. Not many people know this for some reason but you can avoid all the lock, faceplayer stuff by using this:
Code:
#org @main
message @speak
[B]boxset 0x2[/B]
end

Can you tell me about "checkflag"?
And i can use what flags in Ruby?
Checkflag checks if a flag has been set. If that flag has been set then it sets the variable 0x800D (lastresult) to 0x1 if not it sets it to 0x0. Flags are used so that events cannot be repeated. Say you talk to professor Oak and he gives you your first Pokemon you don't want that script to repeat again so you put this in:
Code:
checkflag 0x200
if 0x1 goto @end
This checks the flag 200 to see if it has been set (if the event has occurred), if it has then it goes to a different routine. Of course to make this work you have to use a setflag 0x200 immediately after you are given the Pokemon. Flag numbers are in Hex so you can use numbers like 20A. Hope this helped

Okay i found the Emerald National Dex offset, applied it and got this

Code:
'-----------------------
#org 0xE3D07E
lock
faceplayer
msgbox 0x8E3D08D '"Here you may need this on your\njou..."
callstd 0x6
special 0x1F3
release
end
 
'---------
' Strings
'---------
#org 0xE3D08D
= Here you may need this on your\njourney. The Prof. is so\lscatter-brained he forgot to\limplement this feature in your dex.\lIt's the National Dex, use it to\lkeep a record of all your pokemon\lecounters.

It works, but i need some help with some movements...there is a lab assistant in Birch's lab...i need him to walk up to you AFTER you beat May and get the Hoenn Dex and pokeballs then give you the national dex...currently he is there and you have to go up to him and talk to him to get the ND

BTW i am using XSE
You have to put this script in the same one as the May battle script. Set the trainer battle type to 0x1 and put in the offset of the above script. Movements are very easy. Go to any tutorial and it'll have a list of movements. Movements are written out like this:
Code:
applymovement 0x[peopleNumber] @[offset]
waitmovement 0

#org @[offset]
#raw [movements]
I have a script:
Code:
'-----------------------
#org 0x15429E
lock
faceplayer
checkflag 0x9A
if 0x1 goto 0x8154338
setvar 0x8008 0x2
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x817940E '"Hello, TRAINER. Would you do me a f..."
callstd 0x5
compare LASTRESULT 0x0
if 0x1 goto 0x8154320
special 0x9F
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto 0x8154320
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if 0x5 goto 0x815432A
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitstate
bufferpokemon 0x0 0x8009
msgbox 0x81794C4 '"Wow!\nThis [buffer1] is so fluffy!"
callstd 0x4
setflag 0x9A
release
end

'-----------------------
#org 0x154338
msgbox 0x817950A '"Since we traded, you and me,\nwe're..."
callstd 0x4
release
end

'-----------------------
#org 0x154320
msgbox 0x81794ED '"I'm a little disappointed..."
callstd 0x4
release
end

'-----------------------
#org 0x15432A
bufferpokemon 0x0 0x8009
msgbox 0x81794DF '"That's no [buffer1]."
callstd 0x4
release
end


'---------
' Strings
'---------
#org 0x17940E
= Hello, TRAINER. Would you do me a favor\nand trade POKéMON with me?\pLiving in PACIFIDLOG, I can only catch\ncertain kinds of POKéMON.\p[buffer1]? Do you have one?\nI'll trade you my [buffer2] for it.

#org 0x1794C4
= Wow!\nThis [buffer1] is so fluffy!

#org 0x17950A
= Since we traded, you and me,\nwe're friends, aren't we?

#org 0x1794ED
= I'm a little disappointed...

#org 0x1794DF
= That's no [buffer1].

Can you explain it for me?
Thanks
This is a trading script right? And if I'm not mistaken you're looking to change the Pokemon you can trade. If its anything like the FR one you can't directly change it through this script. The name, pokemon, level etc. are all inside one of those specials. I'm not sure how its done, but I think you just need to go to offset of the script and the data to change those values will be somewhere close. This is just a guess I haven't tried it myself. Try asking D-Trough I believe he has a tool for FR which can change trades.

The Script freezes after the first Earthquake. Does anyone know what's the problem?

Code:
#Dynamic 0x800000

#ORG @Main
checkflag 0x1001
if 1 goto @klaar
lock
#raw 0x55 0x02 0x00
applymovement 0x2 @move
waitmovement 0
applymovement 0xFF @wow
waitmovement 0
message @1
boxset 0x6
applymovement 0x2 @weg
waitmovement 0
applymovement 0xFF @uit
waitmovement 0
#raw 0x2F
#raw 0x4B
nop
setvar 0x8004 0x0
setvar 0x8005 0x9
setvar 0x8006 0x9
setvar 0x8007 0x9
special 0x136
pause 0
applymovement 0x2 @val1
waitmovement 0
applymovement 0xFF @val2
waitmovement 0
message @no
boxset 0x6
#raw 0x53 0x02 0x00
#raw 0x2F
#raw 0x4B
nop
setvar 0x8004 0x0
setvar 0x8005 0x3
setvar 0x8006 0x9
setvar 0x8007 0x2
special 0x136
pause 0
message @net
boxset 0x6
setflag 0x1001
release
end

#ORG @move
#raw 16
#raw 03
#raw FE

#ORG @wow
#raw 65
#raw FE

#ORG @1
= \v\h01:\c\h01\h08 Come back you little!!\p\c\h01\h02Pokémon:\c\h01\h06 Tree!Treecko!!

#ORG @weg
#raw 10
#raw 65
#raw FE

#ORG @uit
#raw 65
#raw 12
#raw FE

#ORG @val1
#raw 65
#raw FE

#ORG @val2
#raw 65
#raw FE

#ORG @no
= \v\h01:\c\h01\h08 Ow NOO!!\nThe Pokémon is about to fall!!\lI need to save it!!\pTreecko Return!!

#ORG @net
= \v\h01:\c\h01\h06 Yeah!\nI saved it just in time!

#ORG @klaar
release
end
Damn, never tried an Earthquake script myself so I don't know how much help I'll be sorry. Isn't it supposed to be:
Code:
setvar 0x8004 0x0
setvar 0x8005 0x3
setvar 0x8006 0x9
setvar 0x8007 0x2
And I don't think you can use pause 0, that wouldn't show any of the script would it? Has to be at least 1 I think.

I have this script that's pretty much exactly like the one where Birch says "Don't leave me like this!"

Code:
'-----------------------
[B]@dynamic 0x800000[/B]

#org [B]@begin[/B]
lockall
msgbox [B]@text[/B]
callstd 0x4
closeonkeypress
applymovement MOVE_PLAYER 0x86B3B06
waitmovement 0x0
releaseall
end


'-----------
' Movements
'-----------
#org 0x6B3B06
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org [B]@text[/B]
= MOM's words echoed:\pAnd remember not to go into the tall\ngrass. Wild POKéMON might jump out.
But all it does is lock everything and then nothing else happens. Like I said earlier, it's exactly like the script where Birch doesn't let you leave, so I don't know what's wrong.
The reason for this is most likely because you edited the script. When you edit the script theres a chance you could corrupt it because you are overwriting the data. I've made the changes above that should make it work.

Can anyone tell me what's wrong with my script? (It says there's an error in the "give Pokemon" part-


Spoiler:
Whats with all these random dynamic offsets? Anyway you need 3 fillers, givepokemon is:
Code:
givepokemon [pokemon] [level] [item] 0x0 0x0 0x0

There was actually nothing wrong with my other script, but I figured out why it didn't work. But now I have a problem with this:

Code:
'-----------------------
#org 0x291572
lock
faceplayer
setvar 0x408D 0x3
setvar 0x4050 0x1
msgbox 0x829158E '"HI"
callstd 0x2
closeonkeypress
hidesprite LASTTALKED
fadescreen 0x0
release
end


'---------
' Strings
'---------
#org 0x29158E
= HI

It hides the sprite, but then it appears again as soon as I move at all.
You need to set a flag that will hide it. Find a flag you haven't used yet. We'll say its flag 0x200. After hidesprite put in setflag 0x200. In advanceMap click on that person and put 0200 in the person Id.

Phew! That was long!

EDIT:
One more...
im totally to hacking and ive just learned bout maps and texts and now i come across scripting???
can someone plz give a link to somewhere where i can learn the most basic stuff for people that have never scripted before?? a tutorial that can explain scripting from the very beginning?? and what is the best scripting program??
Try thethethethe's scripting tutorial its for Pokescript so the commands are a bit different from the newer script editors. There are two new scripters at the moment. XSE and PKSV. In my opinion the former is more user-friendly than the latter but the former is more powerful and can make scripting somewhat easier, even if it takes some getting used to. Since you're new I recommend XSE (find it in Hackmew's toolbox).
 
Last edited:
You have to put this script in the same one as the May battle script. Set the trainer battle type to 0x1 and put in the offset of the above script. Movements are very easy. Go to any tutorial and it'll have a list of movements. Movements are written out like this:
Code:
applymovement 0x[peopleNumber] @[offset]
waitmovement 0
 
#org @[offset]
#raw [movements]

No no no the guy who gives you the national dex is IN birches lab, i want him to give it to you AFTER birch gives you the the pokedex and may gives you the pokeballs, that when you try to attempt to leave the lab he walks up to you and gives you the National Dex upgrade(like the lab assistant in G/S/C who gives you your first 5 pokeballs)
 
Ok, I have a problem with a script.
It freezes after he walks up to you.
Eh...

Code:
'-----------------------
#org 0x2DDFB6
checkflag 0x200
if 0x1 goto 0x82DE13A
msgbox 0x82DE014 '"Get out of my way!"
callstd 0x6
applymovement MOVE_PLAYER 0x82DE205
applymovement 0x3 0x82DE02B
waitmovement 0x0
trainerbattle 0x0 0x35 0x1 0x82DE033 0x82DE067
fadescreen 0x1
hidesprite 0x3
setflag 0x200
fadescreen 0x0
msgbox 0x82DE0FB '"Hmm...He dropped this. \nI should g..."
warp 0x4 0x0 0x0 0x4 0x8
nop
call 0x8000400
call 0x8000408
call 0x8040008
call 0x8040800
nop
hidecoins 0xD9 0xE8
nop

'-----------------------
#org 0x2DE13A
msgbox 0x82DE149 '"I have to go to April!"
'-----------------------
#org 0x400
call 0x4481A70
'-----------------------
#org 0x408
showpokepic 0xE3FE 0xF1 0xCD
'-----------------------
#org 0x40008
writebytetooffset 0x19 0x70017809
'-----------------------
#org 0x40800
releaseall

'-----------
' Movements
'-----------
#org 0x2DE205
#raw 53 'Jump in Place (Facing Up)
#raw 0 'Face Down

#org 0x2DE02B
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)


'---------
' Strings
'---------
#org 0x2DE014
= Get out of my way!

#org 0x2DE033
= Move it! \nHuh? \pYou want to stop me? \pBuahaha!!

#org 0x2DE067
= Argh! You beat me!

#org 0x2DE0FB
= Hmm...He dropped this. \nI should give it to April!

#org 0x2DE149
= I have to go to April!

Oh, the funny call 0x8000 whatevers got there probably because I pushed into used space...
Ignore them unless they're the ones screwing it up.
Then, I'll repoint it and try again.
 
After choose pokemon in Ruby, player will appear at Prof. Birch Lab, and player can change nickname.
I can't find script offset for it. Do you know?
 
No no no the guy who gives you the national dex is IN birches lab, i want him to give it to you AFTER birch gives you the the pokedex and may gives you the pokeballs, that when you try to attempt to leave the lab he walks up to you and gives you the National Dex upgrade(like the lab assistant in G/S/C who gives you your first 5 pokeballs)
Ahh I see. Heres an example of the script you want.
Code:
#dynamic 0x810000

#org @left
applymovement 0x1 @moveL
waitmovement 0
call @main

#org @right
applymovement 0x1 @moveR
waitmovement 0
call @main

#org @main
checkflag 0x200
if 0x1 goto @end
message @wait
boxset 6
applymovement 0xFF @exclaim
waitmovement 0
applymovement 0x1 @move
waitmovement 0
message @here
boxset 6
special 0x1F3
release
end

#org @end
release
end

#org @moveR
#raw 0x13 0x0 0xfe

#org @moveL
#raw 0x12 0x0 0xfe

#org @move
#raw 0x10 0x10 0x10 0x10 0xfe '10 is to move down

#org @exclaim
#raw 0x62 0x1 0xfe '62 is the exclamation box, 1 is to face up
@left and @right are for the scripts on either side of the middle one and main is for the middle one. You could have worked this out by reading some tutorials.

Ok, I have a problem with a script.
It freezes after he walks up to you.
Eh...

Code:
'-----------------------
#org 0x2DDFB6
checkflag 0x200
if 0x1 goto 0x82DE13A
msgbox 0x82DE014 '"Get out of my way!"
callstd 0x6
applymovement MOVE_PLAYER 0x82DE205
applymovement 0x3 0x82DE02B
waitmovement 0x0
trainerbattle 0x0 0x35 0x1 0x82DE033 0x82DE067
fadescreen 0x1
hidesprite 0x3
setflag 0x200
fadescreen 0x0
msgbox 0x82DE0FB '"Hmm...He dropped this. \nI should g..."
warp 0x4 0x0 0x0 0x4 0x8
nop
call 0x8000400
call 0x8000408
call 0x8040008
call 0x8040800
nop
hidecoins 0xD9 0xE8
nop

'-----------------------
#org 0x2DE13A
msgbox 0x82DE149 '"I have to go to April!"
'-----------------------
#org 0x400
call 0x4481A70
'-----------------------
#org 0x408
showpokepic 0xE3FE 0xF1 0xCD
'-----------------------
#org 0x40008
writebytetooffset 0x19 0x70017809
'-----------------------
#org 0x40800
releaseall

'-----------
' Movements
'-----------
#org 0x2DE205
#raw 53 'Jump in Place (Facing Up)
#raw 0 'Face Down

#org 0x2DE02B
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)


'---------
' Strings
'---------
#org 0x2DE014
= Get out of my way!

#org 0x2DE033
= Move it! \nHuh? \pYou want to stop me? \pBuahaha!!

#org 0x2DE067
= Argh! You beat me!

#org 0x2DE0FB
= Hmm...He dropped this. \nI should give it to April!

#org 0x2DE149
= I have to go to April!

Oh, the funny call 0x8000 whatevers got there probably because I pushed into used space...
Ignore them unless they're the ones screwing it up.
Then, I'll repoint it and try again.
You should probably delete the unwanted calls. And you should rewrite this in some actual empty space. It freezes because you have forgotten the 0xfe after the movement data.
 
Great.
I added it, repointed it, but it ends after the trainer battle...

I have a question, if you use flags to hide sprites, are those flags set forever? (If you want the guy to stay hidden forever, that is)

Hmm...I shouldn't trust FSF anymore... -opens Cygnus Hex Editor-
 
Great.
I added it, repointed it, but it ends after the trainer battle...

I have a question, if you use flags to hide sprites, are those flags set forever? (If you want the guy to stay hidden forever, that is)

Hmm...I shouldn't trust FSF anymore... -opens Cygnus Hex Editor-
Yeah they are unless you use the command clearflag.
 
How can I change font text in Ruby?
 
What's wrong with this?

(As the title cleary states). I wanted to make a script where somebody gives you a totodile. Tell me what's wrong.

#Dynamic 0x3B4EB4

#org @start
lock
faceplayer
checkflag 0x201
if b_true goto @done
message @1
boxset 5
compare LASTRESULT 0x1
if b_true goto @take
message @2
boxset 6
release
end

#org @done
message @3
boxset 6
release
end

#org @take
givepokemon 0x4 0x5 0x0
message @3
boxset 6
setflag 0x201
release
end

#org @1
= Hello \v\h01!\nI'd like you to do something for me.\pWill you do it?

#org @2
= That's okay.\pMaybe I can find someone\nelse to do it.

#org @3
= Sorry.\nThat was my last pokemon!
 
Status
Not open for further replies.
Back
Top