The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.

Closed Thread
 
Thread Tools
  #1    
Old February 21st, 2008, 11:59 AM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 22
Nature: Rash
So, I think Irish Witch should not have all the attention :D

PROLOGUE:

To install PKSV,
  • Click the PKSV link in my signature
  • Download the latest version from the site
  • Extract it to a new folder.
  • Once it's in the correct folder, double-click AssociateShell.bat (if you don't have that file, get the latest version from my sig)
Something you might want to know: PKSV is case-insensetive. In other words, you can define a variable called "HeLlOwOrLd" and reference it as "heLLowORLd" if you wanted to.

How to compile
Save the script as a .PKS file. (i.e. "ThisIsAScript.pks")
Right-click the file and press "Compile".

Section 1 -- Basic Talking and Items

This section covers the talking and giving of items.
The first script shall be a talking script.

Open up notepad.
Save the empty file as "TalkingScript.pks" in the PKSV folder.
(This saves us time later)
Now, time to write the script.
First, we need to begin the script.
But at which offset? Let PKSV decide:
Code:
#define start-of-script FREESPACE10
#org start-of-script
As you can see, we (you and I, if you are following this tutorial) defined the variable "start-of-script" as a new section of free space, 0x10 bytes long (or 16 bytes in decimal).
This may seem complicated for some, but it is easy to get used to.
Now, we shall write a message.
Add this on:
Code:
#define hello FREESPACE40 '64 bytes of free space.
lock
faceplayer
msgbox hello
callstd msg_normal
release
end
Right. So we created even more free space, 64 bytes, and called the MsgBox function on it. Then we used callstd to show the message. Msg_normal is the type of message.
But where's the text?
Code:
#org hello 'remember we defined that?
= Hello, I'm the result of your amazing\nscripting skill.
This will show the message:
Quote:
Hello, I'm the result of your amazing
scripting skill.
Here, the line has split. "\n" is actually converted to a control code which tells Pokemon to change it into a new line.
Likewise, "\p" or "\l" signals a new paragraph.
Now, we make him give us some free stuff!
Red=updated, black=added
Quote:

#define start-of-script FREESPACE20
#org start-of-script
#define hello FREESPACE40 '64 bytes of free space.
lock
faceplayer
msgbox hello
callstd msg_normal
checkflag 0x200
#define already-done FREESPACE10
#define notdonemsg FREESPACE20
if 0x1 jump already-done
msgbox notdonemsg
callstd msg_normal
copyvarifnotzero 0x8000 0x2 'Copy the value for "ultra ball" into 0x8000
copyvarifnotzero 0x8001 0x5 'Five of them, please!
callstd MSG_OBTAIN 'You obtained the ultra ball!
closemsg 'close this message
setflag 0x200

release
end

#org already-done
release
end

#org notdonemsg
= Hi, I have some items here, but I'm not\na trainer so I can't use them.


#org hello 'remember we defined that?
= Hello, I'm the result of your amazing\nscripting skill.
Now, to see your code in action, right-click the .pks file and press "Compile".
Then, look in the log to see what the address was #defined as,
and finally, edit someone in advancemap to point to that address.
Run the rom, and talk to that person!
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; February 23rd, 2008 at 02:46 AM.
  #2    
Old February 22nd, 2008, 12:55 PM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 22
Nature: Rash
Yes, Irish Witch, this is WAR!

If you don't know which offsets the freespace command gets, check the log file
(eg:
Code:
#DEFINE
   -> start-of-script
FS -> 0x86B0B00
)
Section 2 -- I am a healer!

This is a very simple tutorial for a very simple command: healing.
Now, we start our script:
Code:
#org 0x86B1000 'Some space, usually free. Choose another offset if you want
#define warning freespace40
#define bye-bye freespace40
lock
faceplayer
message warning
showmsg
waitbutton
fadescreen 1
special 0x0 'yes, special OXOs
fadescreen 0
closemsg
message bye-bye
showmsg
waitbutton
closemsg
release
end

#org warning
= Hey, those trainers up there are tough.\nYou might need a little help.
#org bye-bye
= Ok, I healed your POKéMON!\nGo get 'em!
If you put a new line at the end of the script, the message box warning you of the EOF (end-of-file) does not appear.
Now, to explain the scripts:
Code:
#define warning freespace40
#define bye-bye freespace40
lock
faceplayer
message warning
This defines 2 places of free-space we can use.
Then, it locks the sprite and causes it to face the player.
Next it loads the free space named "warning" to the buffer for text.
Code:
showmsg
waitbutton
fadescreen 1
special 0x0 'yes, special OXOs
fadescreen 0
It shows the prepared message, and waits for the player to press any button. Then, it fades the screen to black, heals the player's pokémon, and fades back to the action.
Code:
closemsg
message bye-bye
showmsg
waitbutton
closemsg
release
end
Prepares the next message, shows it and waits for a button, etc, then releases the sprite and ends the script.


Remember to get the SVN copy for the latest bugfixes, features and commands!
__________________
Plz not to PM me, I don't come here often enough. Email if you need me
  #3    
Old June 30th, 2008, 09:18 AM
master morty's Avatar
master morty
Master Spriter
 
Join Date: May 2008
Location: The world I created yesterday
Gender:
Nature: Mild
so far it seems really good

to get it better than irish which's pokescript you should really make yourself noticable



some how
__________________
  #4    
Old June 30th, 2008, 11:54 PM
Christos's Avatar
Christos
Project Shinx
 
Join Date: Feb 2006
Location: Spain, Went's room
Nature: Serious
Send a message via Skype™ to Christos
You have just revived the thread. It hasn't had a post for over a month.
__________________
Cooltrainer♂ wants to battle!
Breloom (Lv. 47) - Technician - (Mach Punch, Bullet Seed)
Zangoose (Lv. 49) - Toxic Boost - (Slash, Close Combat)
November 28th / Staff Collab 2014
Closed Thread
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 04:08 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 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 generated content remains the property of its creator.