The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Tutorials
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

Notices

Tutorials Looking for a guide to help you out? Then you're in the right place! We've got everything you need, ranging from Mapping to Music!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.



Reply
Thread Tools
  #1  
Unread November 22nd, 2011, 11:13 AM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm

PKSV EXTRA SCRIPTING TUTORIAL


I know there's already the PKSV Scripting Tutorial Thread by Full Metal, but that thread didn't explain all there was about scripting, anyway. So in this thread, I will explain to you how to do a few 'extra' scripting stuff using PKSV-UI.


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!


Extra Lesson 2: Camera Movement
Spoiler:
Right, so Camera Movement is a script that moves the camera to another position. Well, it's hard to explain. So let this video set an example for you.



See that? That's what we're about to learn. So first 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?


Extra Lesson 3: Setmaptile
Spoiler:
So 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.


Extra Lesson 4: Warping
Spoiler:
Warping is a special script which 'forces' the player to warp somewhere. So 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.

So again, we'll need AdvanceMap for this. So let's open it up. And let's say there's a guy who wants to warp you to some random place in Victory Road. So let's get the map and map bank for Victory Road.



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

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



So 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 tf it's 39, make 0x39 and so on.)

So 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 in my case...

#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!


That's all for now. Till next time! If you have any questions, feel free to ask.



Last edited by dragon456; November 25th, 2011 at 03:16 AM.
Reply With Quote
  #2  
Unread November 25th, 2011, 09:50 PM
swiftgallade46's Avatar
swiftgallade46
Legend
 
Join Date: Nov 2011
Location: Baltimore, MD
Gender: Male
Nature: Naive
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?
__________________
GALLADE FTW FOREVER!
and ever
and ever
and ever
...
Reply With Quote
  #3  
Unread November 26th, 2011, 02:21 AM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm
Quote:
Originally Posted by swiftgallade46 View Post
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.
Reply With Quote
  #4  
Unread November 26th, 2011, 06:03 AM
swiftgallade46's Avatar
swiftgallade46
Legend
 
Join Date: Nov 2011
Location: Baltimore, MD
Gender: Male
Nature: Naive
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.

Last edited by swiftgallade46; November 27th, 2011 at 01:54 AM.
Reply With Quote
  #5  
Unread November 27th, 2011, 09:29 AM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm
Quote:
Originally Posted by swiftgallade46 View Post
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:

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

Code:
#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.

Last edited by dragon456; November 27th, 2011 at 02:33 PM.
Reply With Quote
  #6  
Unread November 27th, 2011, 05:26 PM
swiftgallade46's Avatar
swiftgallade46
Legend
 
Join Date: Nov 2011
Location: Baltimore, MD
Gender: Male
Nature: Naive
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)
__________________
GALLADE FTW FOREVER!
and ever
and ever
and ever
...
Reply With Quote
  #7  
Unread November 28th, 2011, 12:12 PM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm
Quote:
Originally Posted by swiftgallade46 View Post
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)
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

Last edited by dragon456; November 28th, 2011 at 12:41 PM.
Reply With Quote
  #8  
Unread November 29th, 2011, 02:52 AM
swiftgallade46's Avatar
swiftgallade46
Legend
 
Join Date: Nov 2011
Location: Baltimore, MD
Gender: Male
Nature: Naive
Quote:
Originally Posted by dragon456 View Post
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
__________________
GALLADE FTW FOREVER!
and ever
and ever
and ever
...
Reply With Quote
  #9  
Unread December 16th, 2011, 02:50 PM
AustinWolff's Avatar
AustinWolff
has left
 
Join Date: Aug 2011
Location: LA, California
Age: 15
Gender: Male
Nature: Brave
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?
__________________
I have left. Feel free to disable my account.
Reply With Quote
  #10  
Unread December 29th, 2011, 07:56 AM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm
Quote:
Originally Posted by AustinWolff View Post
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

Code:
special 0xA9

Last edited by dragon456; January 7th, 2012 at 01:15 PM.
Reply With Quote
  #11  
Unread April 5th, 2012, 08:47 PM
missinigo
Beginning Trainer
 
Join Date: Jun 2010
Gender: Male
how do you make items disappear?
Reply With Quote
  #12  
Unread April 6th, 2012, 01:00 AM
dragon456's Avatar
dragon456
Legendary Dragon Master
 
Join Date: May 2010
Location: Earth
Gender: Male
Nature: Calm
Quote:
Originally Posted by missinigo View Post
how do you make items disappear?
Oh, you mean like when you pick up a Pokeball or something? Here ya go then:

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


:3 Have fun!
Reply With Quote
  #13  
Unread August 7th, 2012, 01:31 PM
TorWallin
Beginning Trainer
 
Join Date: Aug 2012
Gender: Male
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

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.

Last edited by TorWallin; August 8th, 2012 at 07:30 AM.
Reply With Quote
  #14  
Unread August 8th, 2012, 11:49 AM
Typhlosion Lv 99's Avatar
Typhlosion Lv 99
Beginning Trainer
 
Join Date: May 2012
Location: Indonesia
Age: 15
Gender: Male
Nature: Bashful
How to make script like this?
Someone come and talk to the player,then do a battle,after that that person disappear
Reply With Quote
  #15  
Unread September 27th, 2012, 12:23 PM
tamsheel's Avatar
tamsheel
Unhatched Egg
 
Join Date: Jun 2011
Gender: Male
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....
Reply With Quote
  #16  
Unread October 17th, 2012, 06:56 PM
joexv's Avatar
joexv
Charizard inc. (owner)
 
Join Date: Oct 2012
Location: Oregon
Gender: Male
Nature: Adamant
The teleporting gives me a black screen help....
Reply With Quote
  #17  
Unread October 29th, 2012, 07:09 PM
tamsheel's Avatar
tamsheel
Unhatched Egg
 
Join Date: Jun 2011
Gender: Male
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.
Reply With Quote
  #18  
Unread April 6th, 2013, 01:39 AM
xXNightsChildXx's Avatar
xXNightsChildXx
Ghost Mistress
 
Join Date: Mar 2013
Location: In you closet with Slenderman
Gender: Female
Nature: Quiet
Quote:
Originally Posted by dragon456 View Post
Oh, you mean like when you pick up a Pokeball or something? Here ya go then:

Spoiler:
#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
__________________
ѕυиѕнιиє, тнєяє αιи'т α тнιиg тнαт уσυ ¢αи ∂σ тнαт'ѕ gσииα яυιи му иιgнт, вυт, тнєяє'ѕ נυѕт ѕσмєтнιиg αвσυт, тнιѕ ∂ιzzу ∂яєαмєя αи∂ нєя вℓєє∂ιиg ℓιттℓє вℓυє вσу, ℓι¢кιиg уσυя fιиgєяѕ ℓιкє уσυ'яє ∂σиє αи∂, уσυ'νє ∂є¢ι∂є∂ тнєяє ιѕ ѕσ мυ¢н мσяє тнαи мє, αи∂ вαву, нσиєѕтℓу ιт'ѕ нαя∂єя вяєαтнιиg иєχт тσ уσυ, ι ѕнαкє, ι вяσυgнт α gυи αи∂ αѕ тнє ρяєα¢нєя тяιє∂ тσ ѕтσρ мє, нσℓ∂ му нєαят ιт'ѕ вєαтιиg fσя уσυ αиуωαу, ωнαт ιf ι ¢αи'т fσяgєт уσυ؟ ι'ℓℓ вυяи уσυя иαмє ιитσ му тняσαт, ι'ℓℓ вє тнє fιяє тнαт'ℓℓ ¢αт¢н уσυ, ωнαт'ѕ ѕσ gσσ∂ αвσυт ρι¢кιиg υρ тнє ριє¢єѕ؟ иσиє σf тнє ¢σℓσяѕ єνєя ℓιgнт υρ αиумσяє ιи тнιѕ нσℓє.
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC. The time now is 06:20 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User posts belong to the user.