View Single Post
Old February 14th, 2008 (3:59 AM). Edited July 15th, 2009 by score_under.
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: 24
Nature: Rash
Posts: 525
This post applies to an OLD version of the program only

copyvarifnotzero 0x8000 0x148
copyvarifnotzero 0x8001 0x1
When you find/obtain an item, the game needs to know which item and how much.
The number stored in 0x8000 tells it which item (0x148 = TM40 Aerial Ace)
The number stored in 0x8001 tells it how many (one)
then it calls the function to give the item (callstd MSG_FIND) and ends the script.

Also, be careful not to mix up message and msgbox in pksv - they mean different things.
message 0x????????  ' Gets ready to show a message (only one page, ie. cannot have \p or \l)


msgbox 0x???????? 'can have multiple pages
callstd MSG_NORMAL 'shows message
message 0x???????? is used primarily in the "berry" script, as it provides more control over when the message closes, what it does, etc.
msgbox 0x???????? is used for general-purpose messages.

How to edit scripts
This is a copy of a PM I sent - I hope it's useful to you.

I understand how to work the program, but I'm not sure how to change the scripts.

When I open it it comes up with a strange black box, then gives a prompt to open the ROM.
After that it asks for an offset. So I put it in and it comes up with the offset I asked for. But then if I hit any button it clicks out.

Sorry for being a bit ;) late, but if you're still at a loss, here's how to do it:

Save this as EditScript[NAME].bat (or something you can remember) EDIT: You need to put .bat on the end or it does not work!
@echo off
pksv ROMFILE.GBA OFFSET >edit_script
notepad edit_script
pksv -r edit_script ROMFILE.GBA
For example:
@echo off
pksv RubyRom.gba 1A14DD >edit_script
notepad edit_script
pksv -r edit_script RubyRom.gba
Then, move the EditScript[NAME].bat file into the PKSV folder (along with the ROM, if you don't know how to change BAT-files accordingly)
Now, double-click your .bat file and it should open notepad. Change the script in there, and as soon as you save and exit notepad, it will compile your script.

The 1st PKSV command chooses the ROM and offset, and decompiles it.
The last PKSV command chooses the ROM and script, and compiles it again.
ps. only 25% of people download this from - the rest come from
Plz not to PM me, I don't come here often enough. Email if you need me