PDA

View Full Version : [Tutorial] PKSV Extra Scripting Tutorials


The Void
November 22nd, 2011, 03:13 AM
[css-div=background-color: #260919; border: ridge 4px #605747;background-image:url('http://www.ctimes.com.tw/download/200906/24/screenshotfgffdvcc.jpg');padding:20px;]
PKSV EXTRA SCRIPTING TUTORIALS

[css-div=background-color: #4D2A2D;border: ridge 2px white;][css-div=padding:20px]I know there's already the PKSV Scripting Tutorial Thread (http://www.pokecommunity.com/showthread.php?t=195659) by Full Metal, but that thread didn't explain all there was about scripting. That is why I've made a compilation of even more awesome scripts you an make with PKSV.[/css-div]
[/css-div]

[css-div=background-color: #4D2A2D;border: ridge 2px white;][css-div=padding:20px]Extra Lesson 1: WeatherI know this was already explained by Full Metal but I'm gonna expound on it and make it clearer for you anyway. Just follow this script I'm about to give you:

#dyn 0x740000
#org @main
lock
faceplayer
message @talk
callstd MSG_NOMRAL
setweather 0x3
doweather
release
end

#org @talk
= Behold, rain!

That was a script for rain. After the 'setweather' code, set the variable to 0x3 for rain, 0x0 for sunny, and 0x7 for snow. Just follow those guidelines and you have your very own weather code!

Extra Lesson 2: Camera Movement
Camera Movement is a script that moves the camera to another position in the same map. Take a look at this video for exampe.

XXUhuuMHyis

See that? That's what we're about to learn. Follow this code below:

#dyn 0x740000
#org @main
lock
faceplayer
msgbox @text
callstd MSG_NORMAL
special CAMERA_START
applymovement CAMERA @show
pauseevent 0x0
message @done
callstd MSG_NOCLOSE
pause 0xA
closemsg
applymovement CAMERA @return
pauseevent 0x0
special CAMERA_END
release
end

#org @text
= I will show you your house.

#org @show
= walk_left walk_left walk_left walk_left end

#org @return
= This is your house.\nNow you see.

See the script in the middle of callstd and release? Follow that pattern. It's very important you include the 'special' scripts unless you want your scripts to be all screwed up. Simple as that.

Extra Lesson 3: Setmaptile
Setmaptile is a special script that allows you to change things on the map (without having to use mapping tools). As for this tutorial you would need AdvanceMap and PKSV.

So first you need to look at 4 things. The X and Y Position of the map object you want to edit and the 'Block' of the object you'll replace it with. And the movement permission of the object you'll replace it with.

You'll know how to get those by opening AdvanceMap and following what I did below:

This is how to get the X and Y Position (look at the below left of A-Map):

http://img695.imageshack.us/img695/9286/86149594.png

And then the 'Block' number (again, look at the below left of A-Map):

http://img543.imageshack.us/img543/5218/14867188.png

And then choose a movement permission:

http://i42.tinypic.com/65piso.png

Now gather all of that beside each other. (If the Movement Permission you chose is 1, make it 0x1, if it's C, make it 0xC, and so on. Same thing applies with the 'Block' number.)

So if I put the X and Y Position, the Block number, and the Movement Permission together, that would then be...

0xB 0x8 0x5 0x1

Now put that in your script. Just follow this pattern:

#dyn 0x740000
#org @main
lock
faceplayer
message @text
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
setmaptile 0xB 0x8 0x5 0x1 (you put your pattern here)
special 0x8E
fadescreen FADEIN_BLACK
release
end

#org @text
= Behold, the power of setmaptile!

You can add more 'setmaptile' codes if you want to put more objects. Just follow the same pattern. Note that the fadescreen codes aren't all that necessary but they just add that 'fade' effect before and after your setmaptile happens to make it look cool.

Extra Lesson 4: Warping
Warping is a special script which 'forces' the player to move to another map. All we need is a 'warp' command followed by the map and map bank of the place you wanna warp in, a 0xFF command, and the new X and Y position you want your player to warp to in your map.

Open up AdvanceMap. Let's say there's a guy who wants to warp you to some random place in Victory Road. So now we have to get the map and map bank for Victory Road.

http://img717.imageshack.us/img717/8687/70512162.png

Now we have the map and map bank of Victory Road which is 1 and 39.

Next, we find the X and Y Position where the player is gonna warp to in the map. Let's make it random.

http://img35.imageshack.us/img35/1507/98344497.png

Now that we have that, let's put the map, map bank, and X and Y Position together, along with the 0xFF command. Do it in this order:

Map, Map bank, 0xFF command, X and Y Position. (Also note that if your Map or Map bank is, say, 1, then make it 0x1, and if it's 39, make it 0x39 and so on.)

In my case it's:
0x1 0x39 0xFF 0xB 0xA

Now, put all that after a 'warp' command, which you would put after your 'callstd' command in your script. And if you want, you can add the fadescreen effect like what I did in the previous lesson. So now I have...

#dyn 0x740000
#org @main
lock
faceplayer
msgbox @text
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
warp 0x1 0x39 0xFF 0xB 0xA
fadescreen FADEIN_BLACK
release
end

#org @text
= Mwahaha!\nI shall warp you to some\lrandom place!

Extra Lesson 5: Music

Remember that guy in the Game Freak building in Black & White who could change your background music? Now you can do that too!

Once again, we go to AdvanceMap. Click on any map, and go to the 'Header' tab. Click on the dropdown list below Music, and pick the sound of your choice.

http://i62.tinypic.com/k4y29y.png

For this tutorial we'll use the Gamefreak theme. Get its Music no., which for us is 0141.

http://i60.tinypic.com/33f43v6.png

Now let's start with scripting. Note that I've used our music no. as an offset for the playsound command in the script.

#dyn 0x740000
#org @main
lock
faceplayer
playsound 0x141 0x0
message @talk
callstd MSG_NOCLOSE
closemsg
release
end

#org @talk
= I just made your life more awesome.


Okay, so what if we want to play the music temporarily only? Then we add the pause and fadedefault commands. This way, the music will play only for a short while before reverting to the original.

#dyn 0x740000
#org @main
lock
faceplayer
playsound 0x141 0x0
pause 0xA
fadedefault
message @talk
callstd MSG_NOCLOSE
closemsg
release
end

#org @talk
= I just made your life more awesome.



Extra Lesson 6: Shinies

This is what it looks like to get a shiny:

lGo81t0D-XQ

Full tutorial here (http://www.pokecommunity.com/showthread.php?t=270827).


That's all for now. I'll be updating this as much as possible. If you have any questions, feel free to ask in this thread, or VM me directly.

[/css-div]
[/css-div][/css-div]

swiftgallade46
November 25th, 2011, 01:50 PM
hm this is very helpful thank you. would you mind doing one on changing regular NPCs into battleable trainers and changing what items you find?

The Void
November 25th, 2011, 06:21 PM
hm this is very helpful thank you. would you mind doing one on changing regular NPCs into battleable trainers and changing what items you find?

Changing the items you find would be really easy, and most people know how to do it, so I'm just putting it in this post.

So first, you go to "Script Generator" in PKSV.

Then you click on 'Find Item' then you fill up the stuff and you have your very own Item script (just put the compiled offset into, say a Pokeball event).

But as for the trainer thing, I think I'll put that in my first post instead.

swiftgallade46
November 25th, 2011, 10:03 PM
thanks again! as one of the only pksv tuts this should prove very helpful
incidentally, how would I per say add an NPC who could give you the National Pokedex? it doesnt seem to be in the script generator.

The Void
November 27th, 2011, 01:29 AM
thanks again! as one of the only pksv tuts this should prove very helpful
incidentally, how would I per say add an NPC who could give you the National Pokedex? it doesnt seem to be in the script generator.

Well, that's easy as well.

Just use this code:

special FR_NATIONAL_DEX

You can use that after your message saying that you'll upgrade his/her Pokedex. Example:

#dyn 0x740000
#org @main
lock
faceplayer
message @upgradepokedex
callstd MSG_NORMAL
special FR_NATIONAL_DEX
release
end

#org @upgradepokedex
= I'll upgrade your Pokedex for you.

swiftgallade46
November 27th, 2011, 09:26 AM
YES! Thank you SO much I've been looking EVERYwhere for that! Just to be sure though does the FR stand for FireRed? cos im using emerald but thats my bad for not saying so. or does it not matter (Im sure u've guessed at what a n00b i am by now) :P

The Void
November 28th, 2011, 04:12 AM
YES! Thank you SO much I've been looking EVERYwhere for that! Just to be sure though does the FR stand for FireRed? cos im using emerald but thats my bad for not saying so. or does it not matter (Im sure u've guessed at what a n00b i am by now) :P

You're not a noob, don't worry XD
I've known experienced scripters have the same problem.
But yes, the FR stands for FireRed and no, it won't matter if you're hacking Emerald :D

swiftgallade46
November 28th, 2011, 06:52 PM
You're not a noob, don't worry XD
I've known experienced scripters have the same problem.
But yes, the FR stands for FireRed and no, it won't matter if you're hacking Emerald :D
haha cool thanks it worked :D

AustinWolff
December 16th, 2011, 06:50 AM
hello, I have a question about the specials. I know a special that makes the hall of fame and credits role, but is there a special that ONLY makes the credits role and not the hall of fame?

The Void
December 28th, 2011, 11:56 PM
hello, I have a question about the specials. I know a special that makes the hall of fame and credits role, but is there a special that ONLY makes the credits role and not the hall of fame?

Sorry for taking so long to reply (didn't see you posted)... anyway... see below please XD

special 0xA9

missinigo
April 5th, 2012, 12:47 PM
how do you make items disappear?

The Void
April 5th, 2012, 05:00 PM
how do you make items disappear?

Oh, you mean like when you pick up a Pokeball or something? Here ya go then:

#dyn 0x740000
#org @start
copyvarifnotzero 0x8000 MASTERBALL
copyvarifnotzero 0x8001 1
callstd MSG_FIND
end


:3 Have fun!

TorWallin
August 7th, 2012, 05:31 AM
Hello! I am new with coding so i have some questions :)

I am trying to get the Player to "auto-walk" and talk when you walk on a special point of the ground.
This is my code

#dyn 0x74000
#org @start
lock
applymovement PLAYER @a
release
end
#org @a
m walk_up end


I have placed out a script on the ground i insert the script
But the game freezes when i walk on that spot.
What is the wrong?
Do i have to change the script?
Do i have to set var numbers.
Please answer.

Typhlosion Lv 99
August 8th, 2012, 03:49 AM
How to make script like this?
Someone come and talk to the player,then do a battle,after that that person disappear

tamsheel
September 27th, 2012, 04:23 AM
Hey all.hope u all are doing good and fine. I didnt know a thing about hacking...a couple of years ago,but only because of new pokemons i started getting the grip. After several attempts i can easily now insert sprites,use YAPE at some extend(dont know why but it crashes when using on hacked roms),can change pokemons and items name.and then i decided to make a hack to have all pokemons in gba rom. I tried using jambo 51,s patch,but couldn.t go much ahead after inserting sprites and enabling national dex,because of extreme hexing.
So i came back to normal.now i am adding new things in the famous hack pokemon light platinum bt weesely,i have added several gen 5 pokemons,removes several others and repetitive pokemons,got pokedex entries of some right,changed name added fakemons extra. Now i have added a lots of new maps.these will act as a side mini game.you get pokemart here,with masterballs,nurse joy,people giving stuff and pokemons.and here the problem started-1. i want a person to give a pokemon,but not more than once.that doesn,t work.the setflag didnt worked.iwanted them to give several new pokemons,fakemons,but only once. 2.i created several trainer mansion and lairs,fyll of champions and trainer. I want that i can go their and fight all the trainers,and then face the champion,having pokemons at level 100- but again and again. That is I want a rebattle script.write now i have a script,but with that i can fight only once.when i return to the sprite agin,nothing happens. I used pokescript for above two scripts.
3.i am re creating a event for tornadus,thundurus,landorus. I want that when i stand in front of the house in one of my map,a man comes out and make me follow him inside,then recite the whole history of the trio. I already have the map,and script to fight these pokemons prepared.just want this movement script.
4.similarly,when i enter a house in one other map of mine,i want a man there,when i talk to him he will ask me to go take a sleep on the map.only this much movement script i want.after that i can put a warp on bed itself,and make my player go to a different map to fight darkrai,as in diamond and pearl,and after fight warped back to my bed.
5.also if somehow i carry kaldeo to special part of map,kaldeo jumps out of pokeball,and then virizion,terrakin n cobalion come,and teach him a move,and kaldeo evolves.so a movement,move tutor and evolution script.6. When i enter a place,a person teaches a move to my meleotta,learning which my meleotta transforms into piourette forme.
7. I already made white orb,black orb,and gladecia flower item to transform kyurem to its two form,and shaymin to its.I want to give proper respect to these legendaries,hence i am asking for these script.or else cud have easily given them the easy wild battle script. And someone plz tell,after i get the script ready,if I get,then what to do next to compile it into a rom.I mean there is no compile button or so.
If someone got the time and patience to answer me and provide me the simple,usable,tested script,I shall be forever thankfull to him/her/them.
This rom is entirely for personal use so I can have all my favs in one rom with all events and all.so plz anyone help...
Hope to find a reply soon. Till then take care you all.and thanks to all scripter,gamers,programmers for providing these amazing tools,without which we could have only dreamed of such possibilities- sign off....

joexv
October 17th, 2012, 10:56 AM
The teleporting gives me a black screen help....

tamsheel
October 29th, 2012, 11:09 AM
See i dont remember for sure at the moment.but try this.
There is this command you use in pokescript.with that you use some figures.use this command in a script and compile it,and it will work.
Procedure:
1.write a script,any script will work,even a basic message script.
2.example-
#org &start
Lock
Faceplayer
Message &1
Boxset 6
Warp 0x20 0x5 0xFE 0x55 0x2A
Release
End

#org &1
&1 1 =this is an example.
3.in the above script,when you will run it,then the person will first say tha-this is an example,and then teleport you to the map you entered.
4.if you want you can write this script,compile and then in a-map select a new script event and assign it.then you have to change the var value to 4050.thats it.now when you will step on that script tile in game,again the message will be displayed-'this is an example' and you will be teleported.
5.you can even use this warp command with give pokemon or give item or wild battle or trainer battle script.
6.just remember to add this line-
Warp 0x20 0x5 0xFE 0x2A 0x65 (this is just a example).
Warp will teleport you.
0x20 means map number 20 in HEX.you will have to check your map number in A-Map and then convert it to hex using a hex calculator and enter as the first figure.0x20 in this case..
0x5 means bank number in HEX.check this too in a-map.convet thenumber to hex and enter as the second one.
0xFE is to be written as it is.
0x2A means the exact spot you want to be teleported.its the x- coordinate.example you wanted to be teleported in a certain map at a point.the value of that point you can check in bottom left hand side.it says X:... And Y:...
Both X and Y values are already in hex so no need to convert as like fist two numbers.
7.Complete the script and hit compile,enter offset in a-map and save.
8.goto any other map number.
9.if it says save changes,click yes.
10.go back to your map number on which you placed the teleport script and open it using pokescript.
11.check the warp values.
First three values will be as you have initially written,but the last two may have changed.
12.if not enjoy.
13.if the values are indeed changed,correct them and hit compile,save.save.
14.now your warp will work.
15.i faced your problem too.
16.always after compiling check the last two figures in warp command.they tend to corrupt while compiling.
Hope it helps,if not pm me,i shall be happy to assist you.bye take care.

xXNightsChildXx
April 5th, 2013, 05:39 PM
Oh, you mean like when you pick up a Pokeball or something? Here ya go then:

#dyn 0x740000
#org @start
copyvarifnotzero 0x8000 MASTERBALL
copyvarifnotzero 0x8001 1
callstd MSG_FIND
end


:3 Have fun!

I used the exact same code and when I picked up the master-ball it vanished, but when I move one tile it reappears. Is there any way to make it disappear for good once its been picked up? :3

MajorAjay
August 21st, 2013, 01:29 PM
I was wondering how to make a rival battle. Like how do i make a battle with the enemy walking away after the battle?

graphicsturtle123
September 6th, 2013, 09:21 AM
I've made a script and saved and compiled it, but when I try to open it on Advance Map it comes up like this:
#org 0x881565C
'-----------------------------------
lockall
checkflag 0x253
if true jump 0x887405A ' Flag is set
if false jump 0x887409E ' Flag is unset
setflag 0x251
waitbutton
releaseall
end

#org 0x887405A
'-----------------------------------
#raw 0xD8
#raw 0xD5
#raw 0xE2
#raw 0xDB
#raw 0xD9
#raw 0xE6
#raw 0xE3
#raw 0xE9
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xDA
#raw 0xE3
#raw 0xE6
nop0 ' #raw 0x0
#raw 0xE4
#raw 0xD9
#raw 0xE3
#raw 0xE4
#raw 0xE0
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE6
#raw 0xD5
#raw 0xEA
#raw 0xD9
#raw 0xE0
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xE0
#raw 0xE3
#raw 0xE2
#raw 0xD9
setdoorclosedstatic 0xFFFF 0xFFFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
CMD_C3 0xB4
#raw 0xE1
nop0 ' #raw 0x0
#raw 0xE7
#raw 0xE3
#raw 0xE6
#raw 0xE6
#raw 0xED
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xD8
#raw 0xD5
#raw 0xE2
#raw 0xDB
#raw 0xD9
#raw 0xE6
#raw 0xE3
#raw 0xE9
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xE9
#raw 0xE4
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xDC
#raw 0xD9
#raw 0xD5
#raw 0xD8
CMD_FB 0xDCE8DDEB
#raw 0xE3
#raw 0xE9
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xD5
nop0 ' #raw 0x0
msgboxsign
#raw 0xC9
waitcry
#raw 0xD9
nop0 ' #raw 0x0
textcolor 0xC9
#raw 0xC8
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xE1
#raw 0xD5
#raw 0xED
#raw 0xD6
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
nop0 ' #raw 0x0
#raw 0xD7
#raw 0xE3
#raw 0xE9
#raw 0xE0
#raw 0xD8
nop0 ' #raw 0x0
#raw 0xD6
#raw 0xE3
#raw 0xE6
#raw 0xE6
#raw 0xE3
#raw 0xEB
nop0 ' #raw 0x0
#raw 0xE3
#raw 0xE2
#raw 0xD9
setdooropened 0xFFFF 0xFFFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
'Decompiler stopped due to failsafe mechanism (too many #RAW 0xFF commands)

#org 0x887409E
'-----------------------------------
nop0 ' #raw 0x0
#raw 0xE7
#raw 0xE3
#raw 0xE6
#raw 0xE6
#raw 0xED
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xD8
#raw 0xD5
#raw 0xE2
#raw 0xDB
#raw 0xD9
#raw 0xE6
#raw 0xE3
#raw 0xE9
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xE9
#raw 0xE4
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xDC
#raw 0xD9
#raw 0xD5
#raw 0xD8
CMD_FB 0xDCE8DDEB
#raw 0xE3
#raw 0xE9
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xD5
nop0 ' #raw 0x0
msgboxsign
#raw 0xC9
waitcry
#raw 0xD9
nop0 ' #raw 0x0
textcolor 0xC9
#raw 0xC8
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xE1
#raw 0xD5
#raw 0xED
#raw 0xD6
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
nop0 ' #raw 0x0
#raw 0xD7
#raw 0xE3
#raw 0xE9
#raw 0xE0
#raw 0xD8
nop0 ' #raw 0x0
#raw 0xD6
#raw 0xE3
#raw 0xE6
#raw 0xE6
#raw 0xE3
#raw 0xEB
nop0 ' #raw 0x0
#raw 0xE3
#raw 0xE2
#raw 0xD9
setdooropened 0xFFFF 0xFFFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
'Decompiler stopped due to failsafe mechanism (too many #RAW 0xFF commands)

Why is it doing this? If it helps, here is what the script should be:
#dyn 0x740001
#org 0x81565C
'-----------------------------------
lockall
checkflag 0x253
if true jump 0x87405A ' Flag is set
if false jump 0x87409E
setflag 0x251
waitbutton
releaseall
end

#org 0x87405A
message 0x87402A ' I'm sorry, th-\pOh r...
showmsg
waitbutton
fadescreen FADEOUT_WHITE
closemsg
disappear 0x3
setflag 0x251
fadescreen FADEIN_WHITE
releaseall
end

#org 0x87409E
message 0x87409B
showmsg
waitbutton
release
end

#org 0x87409B
= I'm sorry, it is too dangerous up ahead\pwithout a POKe\MON, maybe you could borrow one?

#org 0x87402A
= Recent POK\eMON attacks mean that it \is now too dangerous for people to travel alone[.]

PLEASE HELP!!!

manadhon
September 6th, 2013, 05:59 PM
Send me the original script you used, or rather, post it.

graphicsturtle123
September 7th, 2013, 12:29 AM
This is what it should be:

#dyn 0x740001
#org 0x81565C
'-----------------------------------
lockall
checkflag 0x253
if true jump 0x87405A ' Flag is set
if false jump 0x87409E
setflag 0x251
waitbutton
releaseall
end

#org 0x87405A
message 0x87402A ' I'm sorry, th-\pOh r...
showmsg
waitbutton
fadescreen FADEOUT_WHITE
closemsg
disappear 0x3
setflag 0x251
fadescreen FADEIN_WHITE
releaseall
end

#org 0x87409E
message 0x87409B
showmsg
waitbutton
release
end

#org 0x87409B
= I'm sorry, it is too dangerous up ahead\pwithout a POKe\MON, maybe you could borrow one?

#org 0x87402A
= Recent POK\eMON attacks mean that it \is now too dangerous for people to travel alone[.]

manadhon
September 7th, 2013, 06:59 PM
Well, I took a look at your script, and rewrote it:


#dyn 0x740000
#org @main
checkflag 0x253
if == jump @1
jump @2

#org @1
lock
faceplayer
message @3
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
disappear 0x3
fadescreen FADEIN_BLACK
setflag 0x251
release
end

#org @2
lock
faceplayer
message @4
callstd MSG_NORMAL
release
end

#org @3
= You may proceed.

#org @4
= I'm sorry, but it's too dangerous\nup ahead without a Pok\emon. Maybe\lyou could borrow one?

You don't need to use if twice, and lockall and releaseall should only be used when movement is involved (although it does not have a major effect on the script). Showmsg and waitbutton are also unnecessary, unless it's a level script (or something elaborate), so use callstd. Modify the script to your needs, and feel free to ask if you have any further questions/problems.

graphicsturtle123
September 8th, 2013, 03:45 AM
Thank you so much! I am new to PKSV so I make stupid mistakes...

I'm making a road blocked script and thanks to manadhon I have made half of it, but now I need to make the person script. Can anyone help? This is the first script that manahdon made:
#org 0x8740000
'-----------------------------------
#raw 0xFF
checkflag 0x253
if true jump 0x874000F ' Flag is set
jump 0x8740024

#org 0x874000F
'-----------------------------------
lock
faceplayer
message 0x874002F ' You may proceed.
callstd MSG_LOCK ' Built-in lock command
fadescreen FADEOUT_BLACK
disappear 0x3
fadescreen FADEIN_BLACK
setflag 0x251
release
end

#org 0x8740024
'-----------------------------------
lock
faceplayer
message 0x8740040 ' I'm sorry, but it's ...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x874002F
= You may proceed.

#org 0x8740040
= I'm sorry, but it's too dangerous\nup ahead without a Pok\emon. Maybe\lyou could borrow one?






Can someone please help?

graphicsturtle123
September 12th, 2013, 09:50 AM
This is what my script should be:

#dyn 0x740002

#org @start
lock
faceplayer
msgbox @text ' ????: So, Whatdaya say? /pWant this rare POK\eMON or not?
callstd MSG_YESNO
if true jump @givetorchic
if false jump @no
end

#org @givetorchic
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
addpokemon TORCHIC 0x5 NONE 0 0 0
setflag 0x250
storepokemon 0 TORCHIC
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
message @yes
:end
release
end


#org @no
message @no
release
end

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

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

#org @speech
= ????: So, Whatdaya say? /pWant this rare POK\eMON or not?

#org @yes
= ????: I picked this POK\eMON up in /pHOENN[.] Don't worry I didn't /nsteal it[.]/p Maybe I'll see you around[.]

#org @no
= ????: Hmph[.] /pYou do know you're missing out /non the opportunity of a lifetime?


But when I open it on advance map it looks like this:
#org 0x8740002
'-----------------------------------
checkflag 0x250
if true jump 0x874003B ' Flag is set
setflag FR_POKEMON
countpokemon
compare LASTRESULT 0x6
if == jump 0x874003D ' Equal To
addpokemon TORCHIC 5 NONE 0x0 0x0 0x0
setflag 0x250
storepokemon 0x0 TORCHIC
message 0x8740071 ' You got a \v\h02!
fanfare 0x101
showmsg
waitfanfare
waitbutton
release
end

#org 0x874003B
'-----------------------------------
release
end

#org 0x874003D
'-----------------------------------
msgbox 0x8740047 ' You don't have enoug...
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end


#org 0x8740071
= You got a \v\h02!

#org 0x8740047
= You don't have enough room in your party.


What is wrong?
Please help...

manadhon
September 12th, 2013, 03:48 PM
Manadhon to the rescue again.

Rewritten and tested:

#dyn 0x740002
#org @main
lock
faceplayer
checkflag FR_POKEMON
if == jump @End
message @Text
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @Give_Torchic
jump @No

#org @No
message @Nope
callstd MSG_NORMAL
release
end

#org @Give_Torchic
countpokemon
compare LASTRESULT 0x6
if < call @Give
message @Room
callstd MSG_NORMAL
release
end

#org @Give
addpokemon TORCHIC 5 NONE 0 0 0
fanfare 0x101
message @Get_Msg
callstd MSG_NOCLOSE
waitfanfare
closemsg
message @Nikname
callstd MSG_YESNO
compare LASTRESULT YES
if == call @Yes
setflag FR_POKEMON
release
end

#org @End
message @Around
callstd MSG_NORMAL
release
end

#org @Yes
fadescreen FADEOUT_BLACK
special NAME_POKEMON
waitspecial
setflag FR_POKEMON
return

#org @Text
= ????: Hey, kid! I got this\nrare Pok\emon, and, well,\ldo you want it?

#org @Nope
= ????: Hmph...\pI hope you know you're missing\nout on the chance of a lifetime.

#org @Room
= ????: What, you don't even have\nroom? Come back when you do.

#org @Around
= ????: I got that in Hoenn,\nso don't worry about me stealing\lit or anything. Maybe I'll see\lyou around.

#org @Get_Msg
= \v\h01 recieved a Torchic!

#org @Nikname
= Would you like to give\nTorchic a nickname?

To start off, make sure your checkflag is at the beginning of the script. Instead of using if twice, use compare LASTRESULT for yes (or no) and jump for the opposite. Don't use :end unless you have a message prepared. Otherwise, jump to another offset (like myself).
The storepokemon command is unnecessary, since you're only using one Pokemon. The showmsg and waitbutton are unnecessary as well, just use callstd. Lastly, there was no pointer to noroom-msg.

Modify the script to your needs, and feel free to ask if you have any further questions and/or problems.

graphicsturtle123
September 13th, 2013, 07:26 AM
I'm making a new script where you have to pay 10 pokedollars to get a pokemon but when I compile it a message comes up saying extra characters on line ignoring. What am I doing wrong?

superluke
September 17th, 2013, 09:33 PM
I copied the script that dragon456 used but when i ran it i found my self not at victory road but at silph co. dose any one know what went wrong?

manadhon
September 18th, 2013, 01:04 PM
I'm going to address both of you:

Graphicsturtle123: Send me the script, and I'll help you

Superluke: use Advance Map for map values. If that doesn't help, contact me.

graphicsturtle123
September 19th, 2013, 10:03 AM
#dyn 0x740004
#org @main
lock
faceplayer
checkflag FR_POKEMON
if == jump @End
showmoney 0x0 0x0
message @Text
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @Check Money
jump @No

#org @No
message @Nope
callstd MSG_NORMAL
release
end

#org @Check Money
checkmoney 0x10 0x0 0x0
compare LASTRESULT 0x1
if == jump @Give_Oshawott
jump @nomoney

#org @Give_Oshawott
countpokemon
compare LASTRESULT 0x6
if < call @Give
message @Room
callstd MSG_NORMAL
release
end

#org @nomoney
message @notenoughmoney
release
end

#org @Give
addpokemon MAGIKARP 5 NONE 0 0 0
fanfare 0x101
message @Get_Msg
callstd MSG_NOCLOSE
waitfanfare
closemsg
message @Nikname
callstd MSG_YESNO
compare LASTRESULT YES
if == call @Yes
setflag FR_POKEMON
paymoney 10 0
updatemoney 0 0 0
hidemoney 0 0
release
end

#org @End
message @Around
callstd MSG_NORMAL
release
end

#org @Yes
fadescreen FADEOUT_BLACK
special NAME_POKEMON
waitspecial
setflag FR_POKEMON
return

#org @Text
= ????: Hey, kid! I got this\nrare Pok\emon, and, well,\ldo you want it?

#org @Nope
= ????: Hmph...\pI hope you know you're missing\nout on the chance of a lifetime.

#org @Room
= ????: What, you don't even have\nroom? Come back when you do.

#org @Around
= ????: What are you saying? /p It's not an OSHAWOTT? /n Well it is what it is, and you/ponly paid $10 for it - what do you expect?

#org @Get_Msg
= \v\h01 recieved an OSHAWOTT!

#org @Nikname
= Would you like to give\nOshawott a nickname?

#org @notenoughmoney
= ????: You have some cheek, /pcoming here and then not buying my /nthings[.]
This is it.....................

ContestTrainer
November 10th, 2013, 05:34 AM
Hey I made this script for the normal pokedex but everytime I make my character go get it, they obtain it but then the game just freezes its very upsetting, could you Please show me what I'm doing wrong. Thank you!

#dyn 0x740000
#org @start
'-----------------------------------
message 0x87402DB ' You've stolen a Poke...
callstd MSG_LOCK ' Built-in lock command
special 0x829
release
end


#org 0x87402DB
= You've stolen a Pokedex!

Terff
April 4th, 2014, 01:25 PM
So I've been working on scripting Leaf green and I can't find the offset for the champion battle, I want to edit his text but I just can't find the offset anywhere.

VV
April 6th, 2014, 08:57 PM
So I've been working on scripting Leaf green and I can't find the offset for the champion battle, I want to edit his text but I just can't find the offset anywhere.

I don't know if this helps. Go to advance map, go the the place where the champion is, click the champion, copy the offset or open offset.

The Void
April 22nd, 2014, 08:08 AM
Alright, so I updated this thing, and added two more tutorials. Any and all questions are always welcome.

quil09
June 23rd, 2014, 09:11 PM
can you give us a list of commands in pksv and how do i use reappear and disappear
because when i used the disappear it reappears and when i used reappear it wont appear

AkameTheBulbasaur
June 24th, 2014, 07:14 AM
can you give us a list of commands in pksv and how do i use reappear and disappear
because when i used the disappear it reappears and when i used reappear it wont appear

I don't know too much about the "reappear" command, but I can help you with "disappear."

When you want a sprite on the map to disappear after a certain event, like being talked to, you need to know the Person Event Number. You can find this by going on Advancemap, clicking the events tab and clicking the person event in question. If you look to the right you'll see a list of information. The Person Event Number should be displayed underneath the "delete event" button.

Once you have that, you need to write the script. For the disappearing part, I usually go with this:

Fadescreen FADEOUT_BLACK
disappear 0x(Person Event Number)
fadescreed FADEIN_BLACK

I do this because it looks better in game, but the fade screens aren't too important. The next thing you need to do is make the event stay gone once it disappears. For that, you'll need to set a flag.

setflag 0x###

That number can be anything, just remember to write it down because that number can't be used for any other flag. After you've set the flag, just click on the Person Event you want to disappear and find the Person ID. It should be close to the "open script" button. Set the person ID to the number of the flag you set and BOOM! Your person should stay gone after the script ends.

I'm sorry I can't help you with reappearing, but my guess is that it would use the same concepts at disappear.

quil09
June 25th, 2014, 04:51 AM
I don't know too much about the "reappear" command, but I can help you with "disappear."

When you want a sprite on the map to disappear after a certain event, like being talked to, you need to know the Person Event Number. You can find this by going on Advancemap, clicking the events tab and clicking the person event in question. If you look to the right you'll see a list of information. The Person Event Number should be displayed underneath the "delete event" button.

Once you have that, you need to write the script. For the disappearing part, I usually go with this:

Fadescreen FADEOUT_BLACK
disappear 0x(Person Event Number)
fadescreed FADEIN_BLACK

I do this because it looks better in game, but the fade screens aren't too important. The next thing you need to do is make the event stay gone once it disappears. For that, you'll need to set a flag.

setflag 0x###

That number can be anything, just remember to write it down because that number can't be used for any other flag. After you've set the flag, just click on the Person Event you want to disappear and find the Person ID. It should be close to the "open script" button. Set the person ID to the number of the flag you set and BOOM! Your person should stay gone after the script ends.

I'm sorry I can't help you with reappearing, but my guess is that it would use the same concepts at disappear.

Thanks. This will help. I manage to know how to use the reappear

WAFFAHOUSE
August 13th, 2014, 07:08 PM
Hey I'm currently making a rom hack of fire red and I've followed all your instructions on making a person give you the national dex and I can't get them to do anything but tell me they're gonna give me the dex... They never give it to me though. Please email me [email protected] I really need to have national dex for my rom hack since I have so many pokes that won't evolve
Thanks!
Ps
Please messege me back I need you bad bro I've googled this for like two wks now and no luck until I ran upon your page... But still haven't fully got it down

WAFFAHOUSE
August 14th, 2014, 12:40 AM
Well, that's easy as well.

Just use this code:

special FR_NATIONAL_DEX

You can use that after your message saying that you'll upgrade his/her Pokedex. Example:

#dyn 0x740000
#org @main
lock
faceplayer
message @upgradepokedex
callstd MSG_NORMAL
special FR_NATIONAL_DEX
release
end

#org @upgradepokedex
= I'll upgrade your Pokedex for you.



Can you please elaborate. Is this a script generator thing? If so. Which steps do I take to get this done? Been trying for weeks