score_under
Inactive; Former ROM hack tool author, ❤️
- 526
- Posts
- 19
- Years
- Age 32
- Kent, England
- Seen Dec 7, 2022
So, I think Irish Witch should not have all the attention :D
PROLOGUE:
To install PKSV,
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:
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:
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?
This will show the message:
Likewise, "\p" or "\l" signals a new paragraph.
Now, we make him give us some free stuff!
Red=updated, black=added
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!
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)
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
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
But where's the text?
Code:
#org hello 'remember we defined that?
= Hello, I'm the result of your amazing\nscripting skill.
Here, the line has split. "\n" is actually converted to a control code which tells Pokemon to change it into a new line.Hello, I'm the result of your amazing
scripting skill.
Likewise, "\p" or "\l" signals a new paragraph.
Now, we make him give us some free stuff!
Red=updated, black=added
Now, to see your code in action, right-click the .pks file and press "Compile".
#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.
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!
Last edited: