Deleted member 211486
Guest
- 0
- Posts
PKSV EXTRA SCRIPTING TUTORIALS
I know there's already the PKSV Scripting Tutorial Thread 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.
Extra Lesson 1: Weather
Spoiler:
I 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!
#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
Spoiler:
Camera Movement is a script that moves the camera to another position in the same map. Take a look at this video for exampe.
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.
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
Spoiler:
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):
And then the 'Block' number (again, look at the below left of A-Map):
And then choose a movement permission:
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.
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):
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://img695.imageshack.us/img695/9286/86149594.png)
And then the 'Block' number (again, look at the below left of A-Map):
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://img543.imageshack.us/img543/5218/14867188.png)
And then choose a movement permission:
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://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
Spoiler:
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.
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.
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!
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.
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://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.
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://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
Spoiler:
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.
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://i62.tinypic.com/k4y29y.png)
For this tutorial we'll use the Gamefreak theme. Get its Music no., which for us is 0141.
![[PokeCommunity.com] PKSV Extra Scripting Tutorials [PokeCommunity.com] PKSV Extra Scripting Tutorials](https://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
Spoiler:
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.
Last edited by a moderator: