Thread: [Tutorial] Basic PKSV tutorials
View Single Post
  #2    
Old February 22nd, 2008 (12:55 PM).
score_under's Avatar
score_under score_under is offline
I program the *other* ASM.
Crystal Tier
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 22
Nature: Rash
Posts: 525
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