PokeHackers
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» We need to get this forum moving
Pokescript Tutorial EmptyWed Dec 15, 2010 4:11 am by ToadMan

» Meowth's Head Get's Smaller As It Evolves.
Pokescript Tutorial EmptyThu Dec 09, 2010 9:39 am by ToadMan

» Pokescript Tutorial
Pokescript Tutorial EmptySun Dec 05, 2010 7:16 am by Amphy

» The Forum Rules
Pokescript Tutorial EmptyThu Dec 02, 2010 11:42 am by ToadMan


Pokescript Tutorial

Go down

Pokescript Tutorial Empty Pokescript Tutorial

Post by Amphy Sun Dec 05, 2010 7:16 am

Scripting is one of the more important aspects in hacking. With it, you can create new events, in all kinds of forms. You can do all sorts, like trainer battles, giving items and Pokemon, moving items around and so on. I don't know everything about it, but I can share what I do know, which is enough to get by. This tutorial is aimed at the GBA games.

Writing a Message

We'll start off with a basic script:

Code:
#org $begin
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =Hello there. How are you?

-#org $begin - I'll explain what this all means now. The first line is basically telling the script where it is being assigned. The #org part is required, however the $begin could be anything, it could be $start, $go, even something crazy and stupid like $potatoes.

-lock - Lock is a very important command. What lock is does is fixes the player in place, while the script takes place, so they can't walk or run around and mess up the script.

-faceplayer - Faceplayer is only required when talking to a person. If you use a script on a sign this is meaningless. It won't crash the script, but it isn't needed. What faceplayer does is self explanatory, make a person face the player.

-message $1 - The message part is a similar situation to the $begin scenario we came up with earlier. The second part of the command can be anything. Remember it though, as you'll need it later.

-boxset 6 - The boxset can either be 4, 5, or 6. 4 never closes, and is often used in conjunction with fanfares, 5 displays a yes no option, and 6 is a standard message. They are necessary so that the script works.

-release - Release basically is the opposite of lock, allowing the player to move again.

-end - End is obvious, and is placed at the end of a script.

-#org $1- For this, see the section for #org $begin.

-$1 1 =Hello there. How are you? - Here, you use whatever you used after the message, so in my case $1 and then 1. After an equals sign, write out your text.

The script displays like this on screen:

Code:
Line 1 - Hello there. How are you?

Extending Messages

What you have to remember is longer scripts require more than 30 characters (1 line) of dialogue. Here is how we make new lines:

Code:
#org $begin
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =Hello there.\nHow are you?]\lMe?\pI'm fine.

-\n - Adds a new line, while keeping the existing line on the screen.
-\l - Does the same as \n,but get's rid of the top line to make room for it.
- \p - Clears the text box and starts it fresh.

It displays like this:

Code:
Line 1 - Hello there.
Line 2 - How are you?
Line 3 - Me? (Replaces line 1)
Line 4 - I'm fine. (Replaces lines 2 and 3)

Using Stored Text

What if you want to use the player's or rival's name in the script? You do it like this:

Code:
#org $begin
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =\v\h06: Hello, \v\h01.

- \v\h01 - This uses the player's name.
- \v\h06 - This used the rival's name.

It displays like this:

Code:
Line 1 - (Rival's name): Hello, (Player's name).

Changing Text Colours

In every GBA Pokemon game there are a variety of colours to display text in. This is how you do it:

Code:
#org $begin
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =\c\h01\h08Hey, sup?

\c\h01\h08 -Displays a message in a specific colour. In this case, blue. You should note this colour carries on throughout the message until it is changed again. In Firered and Leafgreen male text is blue, and female text is red.

It displays like this:

Code:
Line 1 - Hey, sup? (text is in blue)

The values are different between games, and there are a fair few so I'll post them all here:

Firered/Leafgreen:

Code:
White - \c\h01\h00
Black - \c\h01\h02
Grey - \c\h01\h03
Red - \c\h01\h04
Orange - \c\h01\h05
Dark Green - \c\h01\h06
Cyan - \c\h01\h07
Blue - \c\h01\h08
Light Blue - \c\h01\h09

Ruby/Sapphire/Emerald:

Code:
White - \c\h01\h01
Red - \c\h01\h02
Grey - \c\h01\h03
Blue - \c\h01\h04
Black - \c\h01\h09
Pink - \c\h01\h0C
Brown - \c\h01\h0D

Gender Specific Scripts

Some text displays differently depending on your gender, such as talking to your mother in the beginning of Firered and Leafgreen. Here is how to do that:

Code:
#org $start
lock
faceplayer
checkgender
compare LASTRESULT 0x0
if b_true goto $male
compare LASTRESULT 0x1
if b_true goto $female
end

#org $male
message $1
boxset 6
release
end

#org $female
message $2
boxset 6
release
end

#org $1
$1 1 =Aw, I was hoping a girl would\nshow up.

#org $2
$2 1 =Oh great, I'm always\nnervous around girls.

-checkgender - Checks your gender
-compare LASTRESULT - Checks the result of the last command. 0x0 is male, 0x1 is female.
-if b_true goto - Works with compare LASTRESULT. If it is right, it sends it to another offset.

It displays like this:

Male:

Code:
Line 1 - Aw, I was hoping a girl would
Line 2 - show up.

Female:

Code:
Line 1 - Oh great, I'm always
Line 2 - Nervous around girls.

More will come later.

Amphy

Posts : 2
Skill : 9818
Known As : 0
Join date : 2010-12-04

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum