Pokemon Gba Scripting Tutorial
By: Andrew • Research Paper • 504 Words • January 4, 2010 • 994 Views
Join now to read essay Pokemon Gba Scripting Tutorial
Getting Started
#ORG $StartScript
Lock
Faceplayer
#ORG : beginning of a script
Lock : Locks down the character you activate in the game so that they won't move around while the script is running.
Faceplayer : makes them turn to face the player.
GotCookie : What is highlighted in blue is a Variable name. You can use any word you want for a variable name but there can't be any puntuation in it.
Displaying a message
#ORG $ShowText
Lock
Faceplayer
message $NoCookie
$NoCookie 1 = I'm not made of cookies!lYou only get one.
boxset 6
release
end
l : To write next line chacters.
n : To write end of line characters.
p : To write next page characters.
Release : The opposite of the lock command.
End : Finishes the script.
Boxsets
Boxset 6: displayes a normal textbox.
(used in Displaying a messsage)
Boxset 5: displays a "Yes/No" dialog so the user can select one.
The way messagebox works is by placing you're response into a location in memory referred to as LASTRESULT. To find out what this is we need to use a compare statement first.
compare LASTRESUILT B_TRUE
if B_False goto $DontGet
B_True: Refers to Yes
B_False: Refers to No
Note:
B_TRUE can also be written as 1 or 0x1
Receiving Items
#org $Startscript
Lock
Faceplayer
checkflag 0x200
if B_TRUE goto $GotCookie
message $AskMe
$AskMe 1 = Would you like a Lava Cookie?
boxset 5
compare LASTRESUILT B_TRUE
if B_False goto $DontGet
giveitem 0x26 1
setflag 0x200
Release
end
#ORG $GotCookie
Lock
Faceplayer
message $NoCookie
$NoCookie 1 = I'm not made of cookies!lYou only get one.
boxset 6
release
end
#ORG $DontGet
Lock
Faceplayer
message $AllMine
$AllMine