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

PKSV scripting Tutorial/Script Thread

that doesn't work.

all that happens when I do that is a bunch of #raw x0FF

This happens to me too when I was using the wrong one (@offset1 <-> 0xEB0B21 (0x0 bytes) instead of @start <-> 0x740090 (0xB bytes)), but it still doesn't work if I use the start one and I'm pretty sure I'm following the instructions exactly.

I create the script, looks like this (because it's my first try just for practice):

Code:
#dynamic 0x740000
#org @start
lock
faceplayer
message @offset1
callstd MSG_NORMAL
release
end

#org @offset1
=Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
I hit compile and I get this come up: @start <-> 0x740090 (0xB bytes)
@offset1 <-> 0xEB0B21 (0x0 bytes)

In Advance Map I insert the script offset 0x740090 into the "script offset" field for the person I want to say it. When I click "Open Script, it comes out like this:

Code:
#org 0x8740090
'-----------------------------------
lock
faceplayer
message 0x8EB0B21 ' 
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x8EB0B21
=
And obviously fails to work in the game.

Where am I going wrong?

EDIT: Now it comes up with this:

Code:
#org 0x87400A8
'-----------------------------------
lock
faceplayer
message 0x87400B3 ' Last year they start...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400B3
= Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
And the character will not speak. I don't know what I did to cause the change, but I guess it's one step in the right direction. Still, upon testing, the speech window opens but no text is displayed.

Also, variables. Yeah, I can see how to read them. But what actually are they? What do they do?
 
Last edited:
This happens to me too when I was using the wrong one (@offset1 <-> 0xEB0B21 (0x0 bytes) instead of @start <-> 0x740090 (0xB bytes)), but it still doesn't work if I use the start one and I'm pretty sure I'm following the instructions exactly.

I create the script, looks like this (because it's my first try just for practice):

Code:
#dynamic 0x740000
#org @start
lock
faceplayer
message @offset1
callstd MSG_NORMAL
release
end

#org @offset1
=Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
I hit compile and I get this come up: @start <-> 0x740090 (0xB bytes)
@offset1 <-> 0xEB0B21 (0x0 bytes)

In Advance Map I insert the script offset 0x740090 into the "script offset" field for the person I want to say it. When I click "Open Script, it comes out like this:

Code:
#org 0x8740090
'-----------------------------------
lock
faceplayer
message 0x8EB0B21 ' 
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x8EB0B21
=
And obviously fails to work in the game.

Where am I going wrong?

EDIT: Now it comes up with this:

Code:
#org 0x87400A8
'-----------------------------------
lock
faceplayer
message 0x87400B3 ' Last year they start...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400B3
= Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
And the character will not speak. I don't know what I did to cause the change, but I guess it's one step in the right direction. Still, upon testing, the speech window opens but no text is displayed.

Also, variables. Yeah, I can see how to read them. But what actually are they? What do they do?


#dynamic 0x740000
#org @start
lock
faceplayer
message @text
callstd MSG_NORMAL
release
end

#org @text
= Last year they started building\na Pok\eCentre here, but they ran\lout of money.\pSo we made it a garden!\nIsn't it great?

Try this & open your ROM via PKSV first...
 
how would one do a mailman script. a person walks up to you.

something like "The mailman gave you a letter"

then he walks off, you read it. and then it releases you?
 
Whats wrong with the script below.
If I pick yes or no in the message box, it still goes to " @given " when
I would only want to go there on a yes. Any help is helpful
thanks in advance.

Problem part below (not all of the script)

dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
if 0x1 jump @given
jump @sad1
 
Whats wrong with the script below.
If I pick yes or no in the message box, it still goes to " @given " when
I would only want to go there on a yes. Any help is helpful
thanks in advance.

Problem part below (not all of the script)

dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
if 0x1 jump @given
jump @sad1

you don't need the second jump. Try:

#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @given
(now continue the script from @sad1)

REMEMBER:
@text - is a pointer to the question
@given is what is said if yes was the answer to the question
what ever is after @given occurs if the player answers no to the question @text

This has become a script help thread all of a sudden :P
 
ok so how would i make a script in which someone exits a building walks over to me and has me follow them inside (like professor oaks in fire-red/leaf-green) im making a game but i need a professor to escort me inside to give the starter pokemon
 
from now on, please ask questions regarding help with scripts in the script help request thread. thank you.
 
ive been messing with pksv for awhile and im able to do everything except messages (text keeps overlapping even with /n) and movement (not sure how to put it into the script) can anyone help me?
 
yup.
don't use /n, use\n trust me, it will work much better.
also, i believe XSE and PKSV both have a text converter, i reccomend using that (or perhaps the script gen inside pksv's menu -.- wow the laziness amazes me...)
 
nope, as i don't really get it myself (except for with jpans engine)
i recommend searching that tutorial allowing you to edit the multi-choice boxes though ;)
 
nope, as i don't really get it myself (except for with jpans engine)
i recommend searching that tutorial allowing you to edit the multi-choice boxes though ;)

I've seen a tutorial for that by Manipulation somewhere else, it requires hex editing. Jpan's patch is the way to go in my opinon.
 
haha, but that is the lazy way of doing things ;)
what if somebody wanted to do it on say, a game besides firered?
 
Could you explain how to find the whole scripts offset, im having trouble. Heres my script. In my game its how you get your two starters! (I need an offset that works with advance map!)
#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Hi!
callstd MSG_NORMAL
release
end

#org @text
= Hi!
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon CATERPIE 5 = 5 NONE 0 0 0
setflag 0x250
storepokemon 0 CATERPIE
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!


#dyn 0x740000
#org @begin
trainerbattle 0x0 0x059 0x0 @intro @defeat
msgbox @afterwards
callstd msg_normal
end
#org @intro
= I will crush you!!! Go! Butterfree and Beedrill!

#org @defeat
= You crushed me[.]

#org @afterwards
= Hmm. Very nice! I see my caterpie is really strong! Trade him to me for this Beedrill? My Beedrill is level 10 No? You just want him? Ok.... Bye Bye Beedrill.
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon BEEDRILL 10 = 10 NONE 0 0 0
setflag 0x250
storepokemon 0 BEEDRILL
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!
#dyn 0x740000
#org @
lockall
message @healmsg
showmsg
waitbutton
fadescreen 1
closemsg
special 0
fadescreen 0
msgbox @bettermsg
callstd MSG_NORMAL
releaseall
end

#org @healmsg
= Your POKéMON look tired[.]\nYou should give them some of my special medicine!.

#org @bettermsg
= There. All better now!
 
Could you explain how to find the whole scripts offset, im having trouble. Heres my script. In my game its how you get your two starters! (I need an offset that works with advance map!)
#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Hi!
callstd MSG_NORMAL
release
end

#org @text
= Hi!
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon CATERPIE 5 = 5 NONE 0 0 0
setflag 0x250
storepokemon 0 CATERPIE
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!


#dyn 0x740000
#org @begin
trainerbattle 0x0 0x059 0x0 @intro @defeat
msgbox @afterwards
callstd msg_normal
end
#org @intro
= I will crush you!!! Go! Butterfree and Beedrill!

#org @defeat
= You crushed me[.]

#org @afterwards
= Hmm. Very nice! I see my caterpie is really strong! Trade him to me for this Beedrill? My Beedrill is level 10 No? You just want him? Ok.... Bye Bye Beedrill.
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon BEEDRILL 10 = 10 NONE 0 0 0
setflag 0x250
storepokemon 0 BEEDRILL
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!
#dyn 0x740000
#org @
lockall
message @healmsg
showmsg
waitbutton
fadescreen 1
closemsg
special 0
fadescreen 0
msgbox @bettermsg
callstd MSG_NORMAL
releaseall
end

#org @healmsg
= Your POKéMON look tired[.]\nYou should give them some of my special medicine!.

#org @bettermsg
= There. All better now!


You must compile them. Even if I compiled it here and gave you the codes it would differ depending on the ROM and the scripting program has to actually implant the scripts themselves. I suggest looking at someone compiling a script on youtube, it's not an easy matter to explain in words (people often get confused).
 
I've been told there are a few bugs in my scripts. I haven't updated the first post yet, I'll do that on the weekend. [css makes it take forever, and I feel the need to heavily edit CSS every time I edit a post. ... :\ ]
anyways
original:
Spoiler:

And Fixed:
Spoiler:

@Sora's Nobody- Um, well I looked in my variable lesson, I don't see a message for YES/NO in there anywhere. :|
 
Hi I'm new to this whole rom hacking thing but i got down how to edit sprites and maps just wanna know about scripting few questions

1. Does PKSV have a way to show me the entire script for fire red and if not how can i do that

2. How do I asign a script to a new character that I put int/add a new main character to the game such as if I choose to be male female is also in the game as a rival/ally?
 
I made a script for Brendan in a cave in Pokemon FireRed. According to him he was there because of a rare Pokemon. He then engages the player in a Pokemon battle. After the player defeats him, Brendan says a few stuff about how strong the player is then an earthquake occurs. He then says that it must be coming from downstairs and walks towards a ladder leading downstairs.

____________________________________________________
#dynamic 0x74000
#org @start
lockall
checkflag 0x200
if true jump :end
applymovement 0x1 @movement
applymovement 0x1 @movement2
trainerbattle 0x0 0x1AA 0x0 @intro @defeat
msgbox @afterbattle ' You have amazed me b...
callstd MSG_LOCK ' Built-in lock command
lockall
setvar 0x8004 0x3
setvar 0x8005 14
setvar 0x8006 14
setvar 0x8007 3
special 0x136
waitspecial
releaseall
lock
faceplayer
msgbox @text ' What was that?
callstd MSG_NORMAL
release
applymovement 0x1 @movement3
applymovement 0x1 @movement4
end

#org @intro
= Hey!\nYou're ALBRAVE, right? \pI've heard so much about you! \pI've heard of your triumph over\nthe ELITE FOUR in KANTO! \pOh, I forgot to introduce myself.\pI am BRENDAN, the\nHOENN LEAGUE CHAMPION. \pI have come here because\nI have heard that a rare species\lof POK\eMON has come\nhere. \pBut before I battle it,\nI want to see your strength\nin a POK\eMON BATTLE! \pCome on!

#org @defeat
= Wow! You're strong!

#org @afterbattle
= You have amazed me beyond\nwords! \pI guess I'm not worthy\nof the rare POK\eMON that dwells here. \pBut you are! \nGo on! \pI must take flight! \pSee you around soon!

#org @text
= What was that? \pAn earthquake!\nIt must be coming from below!\lLet's check it out!

#org @movement
M look_down say_! end

#org @movement2
M walk_down walk_down

#org @movement3
M say_!!

#org @movement4
M walk_right walk_right walk_right walk_right end

_____________________________________________

I was able to compile this and get the offset but for some reason when I tested it on the game, the game just hangs... Can you tell me why? Please do tell me what's wrong with my script. I've just began scripting and I don't know much yet...
 
Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.

Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.
 
Last edited:
Back
Top