DeSiPokemon.com

DeSiPokemon Gallery   DeSiPokemon Doodle   IRC Chat    DP Mail
Download Daily Pokemon Diamond and Pearl episodes from DeSiPokemon.com
Celebrating 15 Years of DeSiPokemon!

PKSV scripting thread

Find information to customise your hack. A big document or tutorial to help you out, maybe? Come search here for a document that helps you with the aspect you wish to hack. (For Program Tutorials and Hex Documents only.

Moderator: DP Super Mods

  • Advertisement
Play-Asia.com - Buy Video Games for Consoles and PC - From Japan, Korea and other Regions!

PKSV scripting thread

Postby Maxedge » October 20th, 2009, 11:24 am

Reasons why I use PKSV
->Its easy
->Its got a script generator which makes scripting easy. All u have to do is tell the generator what to make.
->Its colorful :mrgreen:

http://www.pokecommunity.com/showthread.php?t=116370

is where u can get it!!

But the question is how to get the damn script into the game.......
Well its easy.
1.Get urself Advance Map

2.Go to Settings --> Choose Script Editor --> Choose a script editor (PKSV in my case) --> Click Yes (In my case OK?)

3.Now load the game (if u haven't done it yet)

4.Chose a map from the left hand list.

5.Go to events tab.

6.Click on a sprite.

7.On the right side u will see a side-window.

8.Scroll down in it and click Open Script in it.

9.Ur script editor's opened.

10.Edit the script.

11.Click ROM --> Open ROM --> Choose ur ROM (For PKSV okay?)

12.Click on compile (or press F9) once the ROM is loaded.

13.Close the script editor. Save the ROM in Advance Map and u r all done :D


HAPPY SCRIPTING!!
Last edited by Maxedge on October 23rd, 2009, 11:42 am, edited 1 time in total.

Image
Image
User avatar
Maxedge
Spambot Assassinator
Spambot Assassinator
 
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
 
Posts: 1455
Age: 31
Joined: May 31st, 2009, 8:06 pm
Location: Somewhere in my world...:D
Gender: Male
Pokies: 51.10
Karma: 7

Advertisement

Lesson 1 : Talking

Postby Maxedge » October 20th, 2009, 11:29 am

In most of the cases we begin the script with

#dynamic 0x740000
#org @start

Here we are declaring a dynamic label with #org @start
The @start part is dynamically placing a label in an offset found out by our first line....
This is technical term so never mind :D
All u need to know is u have to start like this
The @start part is a dynamic label. It can @main or something else too!!

Now to show up a message we use:
lock
faceplayer
message @[textlabel]
callstd [type]
release
end

#org @[textlabel]
=[Ur message]


Now describing this line by line:
message @[textlabel] tells that we have got a message here
callstd [type] tells the type of message

#org @[textlabel]
=[Ur message] tells what ur message is which u described about by message @[textlabel]


Example (Best part):
#dynamic 0x740000
#org @main
lock
faceplayer
message @text
callstd MSG_NORMAL
release
end

#org @text
=We did it!!


Here our textlabel was "text" , type of message was "NORMAL" , lock stopped the talking person from moving , faceplayer made it look at player while talking and finally release freed it. Using end saves rom from crashing

But the text can't be too long.
Hence use following:
\n The text following will be in a new line
\l scrolls the bottom line up, and adds the following text in a new line (use only after \n)
\p starts a new box
\v\h01 Players name
\v\h02 buffer 0
\v\h03 buffer 1
\v\h04 buffer 2
\v\h05 buffer 3
\v\h06 Rivals name

Image
Image
User avatar
Maxedge
Spambot Assassinator
Spambot Assassinator
 
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
 
Posts: 1455
Age: 31
Joined: May 31st, 2009, 8:06 pm
Location: Somewhere in my world...:D
Gender: Male
Pokies: 51.10
Karma: 7

Lesson 2 : Callstd functions

Postby Maxedge » October 20th, 2009, 11:43 am

Remember we used callstd MSG_NORMAL ?
well there are more types of messages.

callstd MSG_NORMAL

This is for ordinary messages

callstd MSG_SIGN

This is for signboards, posts, etc.

callstd 2 or callstd 0x2

This is also for normal messages but it frees u of writing lock, faceplayer, release, etc.

Example:

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

#org @text
=We did it!!



can be written as

#dynamic 0x740000
#org @main
message @text
callstd 2
end

#org @text
=We did it!!



callstd MSG_YESNO

This is for yes/no questions.
syntax is:

message @[textlabel]
callstd MSG_YESNO
If 0x1 jump @[labelforyes]
jump @[labelforno]

#org @[textlabel]
=[Ur question of course]

#org @[labelforyes]
=[Ur response if yes was pushed]
release
end

#org @[labelforno]
=[Ur response if not was pushed]
release
end




An example:
#dynamic 0x740000
#org @main
lock
faceplayer
message @text
callstd MSG_YESNO
If 0x1 jump @yes
jump @no

#org @text
=So you have a brain? :P

#org @yes
=Good!!
release
end

#org @no
=Great another brainless!!
release
end



Now what did we do?
By->
If 0x1 jump @yes
jump @no

<-we told the script that if we were returned with 1 do what is with yes script otherwise do what is with no script.

We didn't use "release" and "end" with main script as our work had not finished there.
If u look at normal messages, u will find that we have done everything in the main script. Its the duty of message @text to extract the message from #org @text
and simply display it.

But here we have to
also look for what to say if yes or no is pushed so we can't end the script in the main body but wait until we have told what for yes and no.



callstd MSG_NOCLOSE

This is also a simple message but it won't go until a particular key is pressed.
After the message u have to use
closeonkeypress
to make the script know that it has to close it when key is pressed

That's all for callstd functions. Remember to make a STD call after this XD
Last edited by Maxedge on October 23rd, 2009, 11:53 am, edited 1 time in total.

Image
Image
User avatar
Maxedge
Spambot Assassinator
Spambot Assassinator
 
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
 
Posts: 1455
Age: 31
Joined: May 31st, 2009, 8:06 pm
Location: Somewhere in my world...:D
Gender: Male
Pokies: 51.10
Karma: 7

Lesson 3 : Flags

Postby Maxedge » October 23rd, 2009, 11:45 am

Flags can be compared to checkpoints in a mission game (Delta Force?) or "X" mark on a map.
They are used to set a marker at a position of the script.


checkflag (some value) ->Checks condition of our marker. It is always followed by "if" statement.
setflag (same value) ->Says allright bring it on to the checkflag.
clearflag (same value) ->Says no not now!! to our marker.

Example:
#dynamic 0x740000
#org @main
lock
faceplayer
checkflag 0x200
if 0x1 jump @haveit
message @want
callstd MSG_YESNO
if 0x1 jump @pushedyes
jump @pushedno

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @pushedyes
setflag 0x200
giveegg PICHU
message @herego
callstd MSG_NORMAL
release
end

#org @pushedno
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= Hey, do you want this Pichu egg?

#org @howsit
= Here you go!\nPlease raise it well.

#org @dontwant
= Oh, ok. Maybe someone else will take it.


In our example we chose a flag at position 0x200.
First we asked the script to check its condition.
If we are ready then jump to what we said.
Then we forget the flag for te time being and continue as usual.
In the case of @pushedyes we come back to our flag and tell it allright follow me (The script in next line I mean).
Rest is as usual ......See easy, isn't it?

Image
Image
User avatar
Maxedge
Spambot Assassinator
Spambot Assassinator
 
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
 
Posts: 1455
Age: 31
Joined: May 31st, 2009, 8:06 pm
Location: Somewhere in my world...:D
Gender: Male
Pokies: 51.10
Karma: 7

Lesson 4 : Giving Stuff

Postby Maxedge » October 23rd, 2009, 11:50 am

Giving and taking stuff:
To give a Pokemon we use addpokemon [pokemon name] [level] [itemheld] 0 0 0

Example:
addPokemon PIKACHU 34 MASTERBALL 0 0 0

I don't know why we add 0 0 0 at the end but I know it is important to add while giving Pokemons.

To give an item use
additem [item name] [amount]

Example:
additem RARECANDY 50

To give an egg use
giveegg [basic pokemon name]

Example:
giveegg TOGEPI

Whatever we did here gives benefit to player that it us XD

But before u give an item to the player u may like to check space in his/her bag.

Well u can do this by using
checkspaceinbag

But remember to use flag and if condition here ok?

Image
Image
User avatar
Maxedge
Spambot Assassinator
Spambot Assassinator
 
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
 
Posts: 1455
Age: 31
Joined: May 31st, 2009, 8:06 pm
Location: Somewhere in my world...:D
Gender: Male
Pokies: 51.10
Karma: 7



  • Advertisement

Return to Documents and Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest





Join DeSiPokemon at Facebook Orkut Twitter


Affiliates: Pokemon - India | Pokémon |OFFICIAL| | Pokémon Diamond & Pearl

  • Advertisement
Your Ad Here