PDA

View Full Version : [Tutorial] PKSV scripting Tutorial/Script Thread


Full Metal
September 22nd, 2009, 06:22 PM
[css-div="padding:10px;color:#EEE;max-width:600px;margin:0 auto;"][css-div="box-shadow: rgba(0,0,0,.8) 0 .5em 8px 0;background:#444;padding:1px;border:0 solid #222;border-bottom-width:2em;"][css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Intro.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
Scripting is just sticking one command ontop of another.
Each command does something different.
Usually, just reading the command name tells you what it does.
Every script is stored at an "offset"
An offset is just a number representing a place in your ROM
So if you store your script in 0x800000, then that's your offset
In order to store your script you must know where to put it.
Well...I usually cheat and let PKSV decide for me xD
This is called DYNAMIC offsets, and for this tut, we will only use these
Dynamic offsets work like this
[Commands start now]
#dynamic OFFSET
[No more commands]
OFFSET is just where PKSV starts looking for a place to store your script
Usually, I use "#dynamic 0x740000"
That is where a good chunk of free space begins, so we hackers like to use it
Comments (stuff that PKSV will ignore) are allowed after a single spoiler character ( ' )
eg
uncommmentedd and creating bugs 'Commented, but not making bugs
or
lock 'Locks our player
faceplayer 'look at player
PKSV can be found HERE!
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Hello World![/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
A script always starts somewhere
So we'll declare a script like this

#dynamic 0x740000
#org @start
'pretty simple

"#org @start" is declaring a dynamic label.
the "@start" part of your script is dynamically placed in your ROM based on the offset PKSV
found when you used "#dynamic 0x740000"
This is how you store an offset to anything
if you call a message the syntax looks like this
[...]
message @textlabel
[...]

#org @textlabel
= Text...what else? xD

cripts, Text, Movements, and Pokemart data are all called in the above manner

Okay, whenever you talk to someone you don't want them wondering all over the place right?
Wouldn't it be nice to lock them down in chains?
Well now you can! With this awesome command your players will never move again!
What is the command you ask? Simple!
"lock"
But that's not all, you also want the speaker to look at the talker right?
This one is simple to!
“faceplayer”
that's it!
Now there are two parts to displaying a message
Loading the message
And showing it
“message @textlabel” will load the message stored in your textlabel
“callstd MSG_NORMAL” will show the message just loaded in normal format
So now you've shown a message, great!
But..your player can't move anymore!, atleast, not yet anyways
Before the player can move again, he/she has to be “released” from the “lock” we put on them
the command to do this is
“release”
and finally, to prevent a crash of your ROM we will put
“end”
“end” is a necessity to your script, just always keep it there and you'll be good to go!

So to put it all together

#dynamic 0x740000 'Start looking at 0x740000
#org @start 'This is our start label for our script
lock ' Keep player from moving
faceplayer ' Make the speaker face the player
message @offset1 'load the text in the offset1 label into memory
callstd MSG_NORMAL 'show the message in memory
release 'Let our player move again
end 'End the @start label of our script

#org @offset1 'This is our text label
= So you got it to work eh?\nGood Job! 'I'll explain this in just a second I promise

There are problems with text being to long.
The messagebox can hold a max of about 35 characters per line, and 2 lines per “box”
So there are “symbols” to get around this

\n The text following will be in a new line
\l scrolls the bottom line up, and adds the following text in a new line (use only after \n)
\p starts a new box
\v\h01 Players name
\v\h02 buffer 0
\v\h03 buffer 1
\v\h04 buffer 2
\v\h05 buffer 3
\v\h06 Rivals name

which means
So you got it to work eh?\nGood Job! Would display as

So you got it to work eh?
Good Job!
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Message-Box.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
In order to variate your message you just have to change a single command
callstd 2 This will rid you of needing a “lock” , a “faceplayer” , or a “release”

#dynamic 0x740000
#org @main
message @text
callstd 2 'Or 0x2, 0x just means it's in hex, without it use decimal numbers
end
#org @text
= Text

As opposed to...
#dynamic 0x740000
#org @main
lock
faceplayer
message @text
callstd MSG_NORMAL
release
end
#org @text
= Text

callstd 3 commonly used for signs
nothing special, displays the message and thats it
AKA MSG_SIGN

callstd 4 ensures that the message won't go away until the command “closemsg” is called

message @txt
callstd 4 'Could also use MSG_NOCLOSE....
[…]
closeonkeypress
callstsd 5 (AKA MSG_YESNO)
displays your message and a yes/no dialog
to find out what the player pushed
add the following
#dynamic 0x740000
#org @main
lock
faceplayer
message @question
callstd MSG_YESNO
if 0x1 jump @pushy
jump @pushn

#org @pushy
[…]' Do stuff if they pushed yes
release
end

#org @pushn
[...]'Do stuff if they pushed no
release
end

2 new commands were introduced here
jump- continues script somewhere else
jump also has a similar, call, call is used to go to a script, but still comeback (using the command “return” instead of “end”)

if (value) (command) (label)

callstd MSG_YESNO
if 0x1 jump @pushy 'This will jump to pushy if the value returned from yes/no box is 1
jump @pushno

since we aren't using “Call” there is no need for an “end” command in our main script, instead place the end command in the places where the script would actually end (in this case it is pushn and pushy) Also, since the script would continue at pushy if the user pushed yes, then there is no need to waste space with another if statement. Instead, just use “jump @pushno” since you know the only other possibility is that the user pushed no.
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Giving Things.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
In this lesson we will learn how to
give AND take items
give pokemon
give eggs

the commands for each are simple
giving a pokemon:
addpokemon PokemonName (level) itemname (0) (0) (0)
example:
addpokemon BULBASAUR 25 00 0 0 0'Gives a level twenty five bulbasaur, not holding 'an item
addpokemon PIKACHU 25 LIGHTBALL 0 0 0 'Gives a level 25 pikachu holding a 'lightball
just always ALWAYS ALLLLLWWAAAYYSS remember to add three '0's

giving an item:
additem itemname (amount)
example:
additem POKEBALL 50 'Gives 50 pokeballs to the player
giving an egg:
giveegg PokemonName
example:
giveegg Pichu 'Gives us a pichu egg
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Flags.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
flags are amazingly useful, the equivalent of BOOLEAN values in C/C++
They allow you to do an event ONLY once, do it again when something happens, etc
This time I'll start with an example first
#dynamic 0x740000
#org @main
lock
faceplayer
checkflag 0x200
if 0x1 jump @haveit
message @want
callstd MSG_YESNO
if 0x1 jump @pushedyes
jump @pushedno

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @pushedyes
setflag 0x200
giveegg PICHU
message @herego
callstd MSG_NORMAL
release
end

#org @pushedno
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= Hey, do you want this Pichu egg?

#org @howsit
= Here you go!\nPlease raise it well.

#org @dontwant
= Oh, ok. Maybe someone else will take it.
Setflag – This will make checkflag return 1
Clearflag – This will make checkflag return 0
Checkflag-- This will compare a flag for it being raised,or lowered. Afterwards you want to add “if 0x1 [jump/call] @[scriptlabel]”
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Variables.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
The pokemon games have lots of spots in the GBA memory to store numeric values in. These are called “variables”

setvar 0x[varnumber] 0x[value] –That sets the [varnumber] to be [value]
subtractvar 0x[varnumber] 0x[value] – Subtracts [value] from [varnumber] variable
addvar 0x[varnumber] 0x[value] – Adds [value] to [varnumber] variable
compare 0x[varnumber] 0x[value] – Returns 1 if [varnumber] is set to [value] again, useage of the if statement is used
compare 0x8000 0x3
if 0x1 [jump/call] [label]
resetvars – Resets the variables 0x8000 through 0x8001
storevar 0x 0x[varnumber]
This can be used in loops as in this example
#dynamic 0x740000
#org @main
lock
faceplayer
setvar 0x4000 0x20
setvar 0x4001 0x0
jump @loop

#org @loop
subtractvar 0x4000 0x4001
storevar 0x0 0x4000
message @reps
callstd MSG_NORMAL
addvar 0x4001 0x1
compare 0x4001 0x20
if 0x1 jump @end
jump @loop

#org @end
release
end

#org @reps
= Only \v\h02 loops to go!
There is a new command introduced here again
storevar 0x[buffernumber] 0x[varnumber]
If you use 0x0 for buffernumber the variable is stored in \v\h02, 0x1 means \v\h03, etc until you get to \v\h05 and 0x3

While the above method works, there is a new feature in PKSV that makes everything much more efficient.
#dynamic 0x740000

#org @main
lockall
setvar 0x8010 0x5
message @start
callstd MSG_NORMAL
fadesong 265
:loop
pause 0x50
compare 0x8010 0x1
if == jump @if1
storevar 0x1 0x8010
message @loopmsg
callstd MSG_NORMAL
:skip
subtractvar 0x8010 0x1
compare 0x8010 0x0
if == jump:-loop
jump :loop
:-loop

message @done
callstd MSG_NORMAL
fadedefault
release
end

#org @if1
message @crud
callstd MSG_NORMAL
jump :skip

#org @start
= \v\h01 turned on the SNES

#org @loopmsg
= \v\h03 lives left

#org @crud
= Oh crud, I only have one live left!

#org @done
= \v\h01 got a gameover\ntime to quit!
There are now two types of labels for PKSV. There is one that works like we've discussed so far. These are the '@' labels we've been using.There is also another way.
A ' : ' label is used within an '@' label. It is simply a way to start a script from somewhere other than the beginning, and you can use them just like you would an '@' label.
#org @mainoffset
lock ' this is one byte
faceplayer ' this is another byte
:label ' this label is at the mainoffset+2 bytes, so if you jump to :label, then it will skip
' Lock and faceplayer commands, but doesn't take up space itself.
There were also two new commands from the above example
fadesong [song number] – fades the current song that's playing into the sappy song number
fadedefault – Fades the song back to the default song for the map
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Misc.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
there are also more things to store in a buffer
they are always preceded with “storeZZZ” where ZZZ can be replaced with attack,boxname,comp,firstpokemon,furniture,item,it ems,pokemon,pokemonvar,or text
the arguments are the same for storevar and can be called just the same way, through messages.

Waitbutton – Continues the script after the user pushes a button

lasttrainerbattle – Initiates the last battle the player taken.


Getplayerpos 0x[varx] 0x[vary] – stores the players x position and y position in the corresponding variables

showpokepic POKEMONNAME xpos ypos– shows the pokemon sprite at x,y position

hidepokepic – The sprite displayed w/ above command will not hide until this command used

random ZZ – Generates a random number between 0 and ZZ then puts it in LASTRESULT or 0x800D

special XX – This is for a bunch of commands that must be used through this one
Here is a list of specials for you (they are different for each game)
FireRed / LeafGreen

special 0x0 'Heal Pokémon
special 0x29 'Choose three Pokemon for something
special 0x3C 'Access PC
special 0x8D 'Person says what said the last person you talked to
special 0x8E 'Reload Map
special 0x9D 'Old Man Catches Weedle
special 0x9F 'Choose Pokemon
special 0xAB 'FR/LG/R/S 'Tree' Data Called
special 0x108 'Kanto dex document
special 0x10F 'Game Restart
special 0x110 'Hall of Fame and Credits
special 0x111 'Elevator animation
special 0x113 'FR/LG/R/S screen scrolling
special 0x114 'FR/LG/R/S stop screen scrolling
special 0x132 'Shows floors
special 0x136 'Horizontal Earthquake
special 0x137 'Glitched Battle
special 0x138 'Battle
special 0x139 'Battle
special 0x13D 'Flash
special 0x13F 'Warp to first warp of the map
special 0x156 'Ghost
special 0x157 'Bike
special 0x161 'Surf
special 0x163 'Store Pokemon to Dex
special 0x166 'Nickname
special 0x16F 'Fire Red/Leaf Green National Dex
special 0x173 'Add to fame Checker?
special 0x17B 'Sea gallop Animation
special 0x18B 'Displays an image. Only known images are Kabuotps and Aerodactyl fossils.
special 0x18C 'Closes image shown with special 0x18B
special 0x191 'S.S. Anne animation

Ruby / Sapphire
0 = Heals Party Pokémon
2 = Warp sound + FadeBlack
3 = Hero Uses Last Used Warp
8 = Make new Secret Base/Enter Secret Base
9 = Come out of Coliseum
A = Come out of Coliseum
E = Hero Uses Secret Base PC
F = Something to do with registry in a secret base
11 = Something to do with Secret Base battling
18 = Move Player to X01 Y03
19 = Something to do with secret base battling
1A = Turning off PC
1B = Mixing Records
1F = checks whether game is linked
20 = Please wait followed by wild battle (Linkup) (VS in coliseum)
21 = "Please wait link stand by" (Link Feature)
22 = "Please wait link stand by" (Link Feature)
23 = Call Save Menu
29 = Select 3 Pokémon [maybe for Battle tower?]
2A = Black Screen
2B = Something to do with Berry Growth
2C = Opens up berry pocket (Used in berry blender script)
2D = Something to do with Planted berry (Used with CmdC3)
2E = Something to do with Berry Growth
2F = Something to do with Berry Growth
30 = Maybe activates the watered flag (used first, then special0x5E)
34 = Open Textbox (Stays Open)
35 = Open Textbox (Stays Open)
3B = Trainer battle
3C = Access Lanette's PC (BOX System)
5D = Call Save Menu which keeps looping.
5E = Watering of Berry (used first, then special0x5E)
5F = You fill your trainer's profile/interview
60 = Shows what you put for trainer's Profile/interview
67 = Strange Message with sound (could be Unown speech)
6C = Trainer Tales (Link Feature)
6D = Choose Tale
75 = Secret Base Decoration Item Menu
7C = Something to do with renaming
7D = Something to do with renaming
83 = Poké Slots In Use (Store Command)
8A = Crashes
8D = Displays the last message
8E = Used with Setmaptile to make it work
91 = setmaptile #206 at X8 YB
94 = Something to do with Timed events
98 = Cable Car Ride Cutscene
9A = Male Clock
9B = View Clock
9C = Choose Starters From Birch's Bag
9D = Wally Catching Ralts
9E = Nickname's first Pokémon in Party
9F = Choose a Pokémon in the party (For Nickname)
A0 = ?
A1 = Starts Berry Blender
A2 = Slot game.
AF = Gabby and TV's "In serach of Trainers"
BC = Store a Pokémon For Day Care
BD = Take back Pokémon From Day Care
BE = Get Breeding Growth (store)
BF = Get Price
C0 = Something to do with Day Cay pay (store)
C2 = Egg hatch (1st Pokémon in party)
C4 = Battle results For The Coliseum
C6 = Something to do with DayCare cost
C8 = Move to the last sethealingplace/flightspot after some time (faint!!) (Fainted Event)
D0 = Opens PokéBlock case
D1 = Stores a random value to LASTRESULT (If the value matches mirage Island will show)
D4 = Used Before Special 0xF9/FA
D5 = Catch Pokémon tip, boxset 4 (use closeonkeypress)
D6 = tile change (in the middle of screen?)(For PC)
D7 = tile change (flower, in the middle of screen?)
D9 = Sets some sort of tiles
DA = Sets some sort of tiles
DB = Choose Pokémon then Fadescreen
DC = Opens the First Pokémon's Moves
E0 = Move tutoring For 1st Pokémon in Party
E3 = CheckBike (store command) 00 = nobike
E4 = Set Cycling Road Results (time, collisions)
E6 = First Pokémon Happy (StoreResult, 4 = Happy),
EC = Verse a high level trainer, level 100/Random Battle?
F1 = Restarts Game
F5 = choose 3 Pokémon(Battle tower) F6 = ?
F9 = Item Storage Mailbox Decoration
FA = Item Storage - No Decoration
FB = World Map
FE = Used for In-Game Trades - Trades 1st trade Pokémon "Makit" to 1st Pokémon in Party
103 = Berry Blender results
106 = PC (menu opens and disappears real fast)
107 = Hall of Fame, through PC (Will be corrupt if there's no data) (reads)
108 = Hoenn Pokédex diploma
10E = Boat sailing for a long time, like Fire Red's speed boat (+Return)
10F = Restarts
110 = Hall of Fame "Credits" (Saves data)
111 = Elevator animation<
112 = Displays Flutes
113 = Freezes The Screen/Camera
114 = Releases The Screen/Camera
119 = Groudon's Orb followed by earthquake
11B = Battel Tower Results
12C = Player Goes to last warp/flightspot used
12D = Makes special 0x9d work properly
130 = Is PC Box Full (store command) (0 = full)
131 = Earthquake for few seconds "Earthquake (stops)"
132 = Show Floors & Which Floor you're on
134 = CheckPokerus [0001 = Pokerus]
136 = Weird Quake
137 = Lava Battle/with Groudon
138 = Land Battle/with legendary
139 = Land Battle2/different song/battle with ledgendary - used with wildbattle
13B = Small screen shake
13D = Light/Flash
13E = Player uses the warp last used (no sound)
13F = falls in first warp of the first map
140 = Pokémon Image (UnLZ 199/200)
142 = Ecard battle Initiate (used in Levelscript at mossdeep, Oldman's house)
143 = Battle ?(perhaps used for wildbattle)
147 = Check Pokemon
14C = Turns Off Background/Map music

Emerald
special 0x0 ' Heal Pokémon
special 0x116' screen scrolling (control with 7F with move commands)
special 0x117' stop screen scrolling (return to original position before using this)
special 0x1F3' national dex

For Movements it's almost like movements
PKSV comes with a movement planner which makes everything much much easier
syntax:
applymovement 0x[person event number] @label

Then add “#org @movement label”
Next make your movement script and copy it to your clipboard now just make a new line and paste the data.
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Show me the Money![/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
These are a few commands used to give,take,check for money,and show money
Giveing Money
Command: givemoney ZZ 0
Where ZZ is the amount of money to give (must be less than one million)
example:
[...]
givemoney 200 0 'Gives 200 pokedollars to the player
[...]

Takeing Money
command: paymoney ZZ 0
where ZZ is the amount of money to be taken from the player(must be less than or equal to the amount of money the player has)
example:
[...]
paymoney 200 0 'Makes player loose 200 pokedollars
[...]

Checking money
command: checkmoney ZZ 0
where ZZ is the amount of money to be looked for, if the player has this much money, LASTRESULT is set to 1, otherwise it is 0
example:
[...]
checkmoney 200 0 'Checks if the player has 200 pokedollars, sets LASTRESULT to 1 if he/she does
compare LASTRESULT 0x1 'Compares LASTRESULT to containing 1
if 0x1 jump @continue 'Jumps to #org @continue if LASTRESULT had one in it
jump @notenough 'Jumps to the script saying that the player did not have enough money
[...]

Showing Money
A little more complex than the other money commands
Showing Money
command: showmoney [ZZ] [YY] 0
Where ZZ is the x coordinates and YY is the y coordinates
example:
[...]
showmoney 10 10 0 'Displays money at 10,10 on the screen
[...]
However if you take money, or give it, the money that the player sees needs to be updated to avoid confusion
command: updatemoney [ZZ] [YY] 0
Where [zz] and [yy] are the same as the coordinates used in your show money

Also, you will want to remove the money from the screen before your script ends.
command: hidemoney [zz] [yy] 0
Where [zz] and [yy] are the same as the coordinates used in your show money
example:
[...]
showmoney 10 10 0
paymoney 200 0
updatemoney 10 10 0
hidemoney
[...]

You really shouldn't use any of these commands without using them all, with the exception of updatemoney maybe...
An example using them all
[quote]
#org @main
'-----------------------------------
lock
faceplayer
checkmoney 0x96 0x0 0x0
compare LASTRESULT 0x1
if == jump @canhave ' Equal To
jump @canthave

#org @canhave
'-----------------------------------
showmoney 0xA0A 0x0
msgbox @hy ' Hey \v\h01, do you w...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump @want ' Equal To
jump @notwant

#org @want
'-----------------------------------
paymoney 0x96 0x0 0x0
additem SUPERPOTION 1
msgbox @ty ' Thank you for your b...
callstd MSG_LOCK ' Built-in lock command
hidemoney 0xA 0xA
release
end

#org @canthave
'-----------------------------------
msgbox @he ' Hello \v\h01.
callstd MSG_LOCK ' Built-in lock command
release
end

#org @notwant
'-----------------------------------
msgbox @mb ' My business is alway...
callstd MSG_LOCK ' Built-in lock command
hidemoney 0xA 0xA
release
end


#org @hy
= Hey \v\h01, do you want a\nA super potion for 150 ?

#org @ty
= Thank you for your business.

#org @he
= Hello \v\h01.

#org @mb
= My business is always open\nto those who can afford it.
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Weather![/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]These are simple commands to change the weather in outdoors maps.
SetWeather and doweather work together
setweather 0x3 'Sets the weather to do to 3 for rain
doweather 'Does the weather we set with setweather
resetweather 'Undoes the effects of setweather and doweather
You can find a list of weathers in a-map under the header tab
This should be enough to get you started, I might post more sooner, but not until I get suggestions to add, or PKSV has more features needing explanations.

Also, just so you know
“#dynamic 0x740000” can be “#dyn 0x740000” also, the offset does NOT have to be 0x740000 it can be any offset you want.
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Level Scripts.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]
There are two types of level scripts....
.....Type 1
........The kind that is under the events tab (aka trap script)
.....Type 2
........The kind that is under the header tab (aka ...level scripts?)
How to use type 1
1) Create a script event in a-map events tab (the green s kind...)
2) Assign a variable into the correct box
3) Assign the value to be whatever that variable isn't (after the level script is used the variable is assigned this value...)
4) Assign the "unkown" to 3
5) Compile your script
6) Assign the script offset to the proper box
How to use type 2
These are a little bit more challenging and i'll update again when i can explain it
[/css-div][/css-div]

[css-div="background:rgb(220,70,70) url('http://www.deviantart.com/download/287144796/stripes_bg_by_tyler_elric-d4qyicc.png');background-position:fixed;font-weight:bold;font-size:2em;text-align:center;padding:0 0 .5em 0;background-attachment:fixed;width:102%;margin-left:-1%;"]Sample Scripts.[/css-div][css-div="padding:0 1em 2em 1em;position:relative;top:-.5em;"][css-div="background:rgb(200,200,200);padding:1em 1em 3em .5em;color:#444;box-shadow: rgba(0,0,0,.8) 0 .5em 10px 2px;"]

[b]Snes Script
Description: Displays "[player] turned on the snes!" then plays battle music, followed by a "player has X lives left" where x is a number which is automatically decremented. Then when the player has no more lives left "Game over time to go"
#dynamic 0x740000

#org @main
lockall
setvar 0x8010 0x5
message @start
callstd MSG_NORMAL
fadesong 265
:loop
pause 0x50
compare 0x8010 0x1
if == jump @if1
storevar 0x1 0x8010
message @loopmsg
callstd MSG_NORMAL
:skip
subtractvar 0x8010 0x1
compare 0x8010 0x0
if == jump:-loop
jump :loop
:-loop

message @done
callstd MSG_NORMAL
fadedefault
release
end

#org @if1
message @crud
callstd MSG_NORMAL
jump :skip

#org @start
= \v\h01 turned on the SNES

#org @loopmsg
= \v\h03 lives left

#org @crud
= Oh crud, I only have one live left!

#org @done
= \v\h01 got a gameover\ntime to quit!
Credit: Full Metal

-Untitled-
Description:This only happens once,player looks left and up pops an excite icon, OW person w/ event id of 4 looks down and right,then player talks about not being late to get their first pokemon,then the other guy will run down 3 steps and dissapear. Please note that if you don't have your map set up as mryvn's then the script will look a little weird. So i reccomend that you also set the person id no to 8C3 (which makes them dissapear forever,i'll explain more on the next update) as well as adjust the movement and sprite placement to fit to your map (eg add more downs/change direction the other person runs)
#dynamic 0x74000
#org @start
lockall
checkflag 0x8C3
if true jump :end
applymovement PLAYER @a1
applymovement 0x4 @a2' Where 0x4 is event # of whoever is talking to you
message @a3'
callstd MSG_NORMAL
applymovement 0x4 @a4' Where 0x4 is event # of whoever is talking to you
pauseevent 0x0
disappear 0x4' Where 0x4 is event # of whoever is talking to you
setflag 0x8C3
:end
releaseall
end

#org @a3
= \v\h06: Awesome weather right?\nLet's hurry up!\p Don't want to be late\n for out first Pokemon!

#org @a1
M look_left say_! end

#org @a2
M look_down look_right end

#org @a4
M run_down run_down run_down end
Credit: Mervyn

Eevee Script
Description: Give the player an Eevee!
#dyn 0x740000
#org @start
lock
checkflag 0xABC
if 0x1 jump @geteevee
faceplayer
msgbox @eevee1
callstd MSG_NORMAL
release
end

#org @geteevee
faceplayer
checkflag 0xXYZ
if 0x1 jump @eevee2
msgbox @eevee3
callstd MSG_NORMAL
countpokemon
compare LASTRESULT 0x6
if == jump @toomany
addpokemon EEVEE 6 NONE 0x0 0x0 0x0
setflag 0xXYZ
storepokemon 0x0 EEVEE
message obtain
fanfare 0x101
showmsg
waitfanfare
waitbutton
faceplayer
msgbox @howseevee
callstd MSG_NORMAL
end

#org @eevee2
faceplayer
msgbox @howseevee
callstd MSG_NORMAL
end

#org @toomany
msgbox @toomuch
callstd MSG_NOCLOSE
release
end


#org @eevee1
=

#org @howseevee
=

#org @eevee3
=

#org @toomany
=

Credit: Undocumented.

[/css-div][/css-div]

[/css-div][/css-div]

mervyn797
September 23rd, 2009, 09:02 AM
nice tut dude! keep up the good work!

NarutoActor
September 23rd, 2009, 11:49 AM
bravo I always liked pksv better than xse but sadly pksv isnt used that much by the better scripters and no WERE no tutorials for pksv this is the first good pksv tutorial good job I hope you add more :D

Full Metal
September 24th, 2009, 12:10 PM
Lolz, thanks for the comments, if you have any ideas for the tut just give them to me ok?
I think I might add money stuff next...
also, how was the tut?
Any improvements needed?

SharpPoint
September 24th, 2009, 01:05 PM
Any improvements needed?

You can organize the text better. Like make it more manageable and understandable.

But, since this is the first PKSV tutorial ever (I think), this tutorial is very good. :)

NarutoActor
September 24th, 2009, 02:42 PM
I like it :D I dont know what to sugestion because I look thow scripting tuorials that have something I dont know...the only thing herd of that I cant do but will love to learn is this
changing the overworld players sprite
(to be continued)

.Seth
September 24th, 2009, 02:48 PM
It needs padding, I'll tell you that much.
It sounds like a nice tutorial, but I prefer XSE.
It's no fun when it's so easy.

NarutoActor
September 24th, 2009, 03:08 PM
oh I just remebered can you please explain flag skelitons

Full Metal
September 24th, 2009, 05:08 PM
Like the ones in PKSV?
Well...not really in need of a tutorial, but lemme have a look
Ok well for flag skeleton numero uno
of course you have
lock and faceplayer
it first checks your flag
if it's set, it will go to #org @flag-2
otherwise it will continue and say the message in #org @flag-1-msg
really simple actually
Now for flag skeleton numero dos (:P i'm learning spanish now xD)
hehe.. this is Score_Under using The new " : " label feature, this way the second message is said every time, but the first is said but once
Reread tut if you don't understand

and also,
@rairaiku- Did you mean css padding? Cuz i didn't use any css if i remember right...just a bunch of div's so that it would look a little less boring, but still look good with almost all the themes that PC has, i find it doesn't look half bad in PawLicious, but if you insist, i'll add some padding.

@sharppoint- as in text wrapping, or as in the format that the information was given?
*edit*
Would you all like me to provide a download to this in PDF/Word/Open Office format for download?

NarutoActor
September 24th, 2009, 05:20 PM
okay I understand flag skeliton 1 but not 2 I check the tut still a little confused oh and do you know what I mean by changing the playes overworld have have seen it been done in a couple of hacks it was used for a couple of things like a digging mini game

Full Metal
September 24th, 2009, 05:37 PM
Hm...
how to put this

you have to understand this
dynamic labels are just a way to "rename" offsets
every command will take a few bytes
eg lock takes one byte,a pointer takes 4
A " : " label is inside of a dynamic label, but it is pointing at a further spot on the script
Eg,
At position 45 is lock
at position 46 is faceplayer
then if you have a ":" label it points to 45+2
so that way you can say
Jump :-label which will go to the #dynamic label, but it would skip the lock and faceplayer
:\ it's hard to explain, just think of it as a way to skip around in your script.
another example
#org @a is stored at 0x123456
lock
faceplayer
:-label is just a way for PKSV to say, jump to #org @a+2, which is where the :-label is at
If i can think of a way to explain better i will.
And as far as changeing the players ow...if i can get some better asm, i'll post that up here to, but, asm is a bit out of my range, if i'm walked through it, i can figure it out, but it's not very easy.

NarutoActor
September 24th, 2009, 05:48 PM
thanks I understand the use of skeliton 2
on the overworld player changing pokepal was able to do it without asm he said something about load from pointer or data I ask him how to do it but he said its complicated and thats he is not a good teacher

score_under
September 25th, 2009, 08:57 AM
It's no fun when it's so easy.
...what?
In what way do you mean it? You mean you prefer having to look up movement codes for yourself, you prefer writing scripts without features like code labels, and you don't like convenience?

I should send you a table of the commands and their hex value. That'd satisfy you ;)

Full Metal
September 26th, 2009, 05:05 PM
*bump*
The tuts been updated with weather and money
Next I'll add level scripts

.Seth
September 26th, 2009, 05:09 PM
...what?
In what way do you mean it? You mean you prefer having to look up movement codes for yourself, you prefer writing scripts without features like code labels, and you don't like convenience?

I should send you a table of the commands and their hex value. That'd satisfy you ;)

Movement Codes aren't #raw's anymore, in XSE at least. :/
I'm not saying I don't like convenience, but it's a bit more fun when you're not guided through everything. *coughD/P/Ptcough*

Believe me, I think your script editor is wonderful. I just prefer XSE.

score_under
September 27th, 2009, 11:39 AM
Movement Codes aren't #raw's anymore, in XSE at least. :/
Are you sure? My copy is 1.1.1, which still reports itself as latest, and it gives me this:
#org 0x165758
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements

Maxzeroedge
October 11th, 2009, 10:30 PM
A dumb question......How do u insert the script into the ROM and btw.......Thanks for the tutorial....Its easy learning!!

Full Metal
October 12th, 2009, 05:13 PM
just push "F9" or Rom->Compile

NarutoActor
October 13th, 2009, 01:33 PM
or click the buttune that looks like a gear

mervyn797
October 20th, 2009, 03:07 AM
how do i make sprites dissapear? i mean, if move them, what's the syntax?

score_under
October 20th, 2009, 01:16 PM
how do i make sprites dissapear?
disappear [sprite ID]
e.g.
disappear LASTTALKED
i mean, if move them, what's the syntax?
applymovement [sprite ID] [movement list]
e.g.
applymovement PLAYER @move

Full Metal
October 20th, 2009, 04:50 PM
oooh yes, thats a good idea for an update
sorry, i wasn't watching thread >_<
i'll try 'n update it tonight with people dissapearing and level scripts

Maxzeroedge
October 20th, 2009, 10:01 PM
I am a newbie and can u explain about variables?
Which variable and value to be chosen and all that.....

mervyn797
October 21st, 2009, 02:46 AM
disappear [sprite ID]e.g.
disappear LASTTALKEDapplymovement [sprite ID] [movement list]e.g.
applymovement PLAYER @move
actually i mean, move them to another map or such. is it possible?
and to make the sprite disappear, do i need to include a fadescreen too?

Full Metal
October 21st, 2009, 04:35 AM
no, moving a sprite from one map to another is not possible (to my knowledge)
However, creating the illusion is as easy as making a sprite on each map, with the same picture number, and the scripts make one dissapear and the other rea-apear (I'm working on this again, due to being in standby, i couldn't update the post

NarutoActor
October 21st, 2009, 12:15 PM
Are you sure? My copy is 1.1.1, which still reports itself as latest, and it gives me this:
#org 0x165758
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements
you can define things maby his is step_up_normal but the normal xse is #raw 0x13

mervyn797
October 23rd, 2009, 01:40 AM
no, moving a sprite from one map to another is not possible (to my knowledge)
However, creating the illusion is as easy as making a sprite on each map, with the same picture number, and the scripts make one dissapear and the other rea-apear (I'm working on this again, due to being in standby, i couldn't update the post
bah, i donno, i use the disappear command but it wouldnt disappear untill we dont move out of the screen. >_>

Full Metal
October 23rd, 2009, 12:11 PM
if ur using FR there might be a special for reloading the map...(i think, idk if it's in the list or not)

mervyn797
October 24th, 2009, 05:30 AM
if there is, plz tell.
yeah, im using firered rom

Full Metal
October 24th, 2009, 10:43 AM
special 0x8E
T_T there IS A LIST of specials in lesson 6...

Full Metal
October 25th, 2009, 01:22 PM
Ok FINALLY! The CSS is finished!
Final design i think, any suggestions, please leave a vm
for a suggestion you need the following...
a tiled image
a color for the border of the entire post
a color for the border of a lesson
a color for the bg of a lesson
and lastly, a (horizontally) tile image for the comments
nao...i am making a new lesson for level scripts (finally) next is sprite dissapearance
ALSO, don't feel shy people, submit a script or two for me to add to the collection (i also gotta re-add that...)

mervyn797
October 26th, 2009, 07:38 AM
excellent work there, blob of blobs. lesson 6, thank god!
i can give u some scripts, but which ones in particular do u need?

Full Metal
October 26th, 2009, 02:02 PM
any...these are just scripts submitted by people who like to share :)
i didn't post this earlier...it was assumed that people would know this...
MAKE SURE THAT THESE ARE PKSV SCRIPTS!
o yea...lesson 6 has been there for long time....?
also,lesson nine is what was added
and i'll update that with type two when i get a break from all this homework >_<

NarutoActor
October 26th, 2009, 02:26 PM
o.o nice update i like how you incorporated the css from your sig to the thread and I like the snes script but why an old system why not a wii?

Maxzeroedge
October 26th, 2009, 09:27 PM
Hey can u make the variables part a bit more easier?
I mean I understand only the compare and storevar what's the use of others?

mervyn797
October 27th, 2009, 05:55 AM
well,
a small script from me to add for your collection, xD
CLICK THE SPOILER
#dynamic 0x74000
#org @start
lock
checkflag 0x8c3
if true jump @end
applymovement PLAYER @a1 ' look_left say_! end
applymovement 0x4 @a2' look_down look_right...
message @a3' \v\h06: Awesome weat...
showmsg
closemsg
applymovement 0x4 @a4 ' run_down run_down ru...
disappear 0x4
setflag 0x8c3
release
end

#org @end
release
end

#org @a3
= \v\h06: Awesome weather right?\nLet's hurry up!\p Don't want to be late\n for out first Pokemon!

#org @a1
M look_left say_! end

#org @a2
M look_down look_right end

#org @a4
M run_down run_down run_down end

Full Metal
October 28th, 2009, 01:18 PM
@max0edge- I think i'll update the variables section, OR add a second section for them, there is a lot of useage in them
@mervyn-A few q's, do you want credits?,Care to give it a title or shall i?
*edit*
Also,mervyn here's a ...efficientized version 'o ur script

#dynamic 0x74000
#org @start
lock
checkflag 0x8C3
if true jump :end
applymovement PLAYER @a1
applymovement 0x4 @a2
message @a3'
callstd MSG_NORMAL
applymovement 0x4 @a4
pauseevent 0x0
disappear 0x4' Where 0x4 is event # of whoever is talking to you
setflag 0x8C3
:end
release
end

#org @a3
= \v\h06: Awesome weather right?\nLet's hurry up!\p Don't want to be late\n for out first Pokemon!

#org @a1
M look_left say_! end

#org @a2
M look_down look_right end

#org @a4
M run_down run_down run_down end

@narutoactor-XD all you have to do is change a word

Mr.Silver
October 28th, 2009, 02:05 PM
Here f-metal an eevee script!
#dyn 0x740000
#org @start
lock
checkflag 0xABC
if 0x1 jump @geteevee
faceplayer
msgbox @eevee1
callstd MSG_NORMAL
release
end

#org @geteevee
faceplayer
checkflag 0xXYZ
if 0x1 jump @eevee2
msgbox @eevee3
callstd MSG_NORMAL
countpokemon
compare LASTRESULT 0x6
if == jump @toomany
addpokemon EEVEE 6 NONE 0x0 0x0 0x0
setflag 0xXYZ
storepokemon 0x0 EEVEE
message obtain
fanfare 0x101
showmsg
waitfanfare
waitbutton
faceplayer
msgbox @howseevee
callstd MSG_NORMAL
end

#org @eevee2
faceplayer
msgbox @howseevee
callstd MSG_NORMAL
end

#org @toomany
msgbox @toomuch
callstd MSG_NOCLOSE
release
end


#org @eevee1
=

#org @howseevee
=

#org @eevee3
=

#org @toomany
=

mervyn797
October 29th, 2009, 02:18 AM
@blob of blobs: oh thanks for that edit. and the title, i cant think of one. xD
a small correction, make it Mervyn instead of mervn

also, blob of blobs,
that special thing isnt working for me, is there a particular way to use it?
this is the last part of my script:
pauseevent 0x55
setflag 0x201
setflag 0x202
setflag 0x203
special 0x8E
fadescreen FADEOUT_BLACK
fadescreen FADEIN_BLACK
release
end

Full Metal
November 1st, 2009, 05:06 AM
try putting it in between the fadescreens

amoliski
November 25th, 2009, 10:40 AM
I am trying to make a script to replace the default oak walking you to the lab script.
I placed a dude blocking the right side of the path, and the left side I created this script, but it freezes when I get to that point... this language is VERY confusing!

#dynamic 0x874009F
#org @start
lockall
countpokemon
compare 0x800D 0x0
if 0x1 goto @sorry
releaseall
end

#org @sorry
applymovement 0xFF @face
message @sorryMsg
showmsg
waitbutton
applymovement 0xFF @walk
releaseall
end

#org @sorryMsg
= You shouldn't go into the park\nwithout a pok\emon to\lprotect you!

#org @walk
M walk_down
return

#org @face
M walk_left
return

I know I have a lot wrong, what would it take to make this work? Would using flags make the script easier to write? Is this even the right place to be asking for help?

NarutoActor
November 25th, 2009, 12:55 PM
well for one is the tile script set to unknow 3 and var number 4050(or something close)

amoliski
November 26th, 2009, 02:22 AM
Yes and yes. Strange thing is when I go to look at my script, it shows up as...

#org 0x8740264
'-----------------------------------
#raw 0xFF
loadbytefrompointer 0x3 0xDCE700E9
#raw 0xE3
#raw 0xE9
#raw 0xE0
#raw 0xD8
#raw 0xE2
givetocoincase 232 ' Bear in mind, it's not in hex
#raw 0xDB
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE2
#raw 0xE8
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xDC
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE4
#raw 0xD5
#raw 0xE6
#raw 0xDF
CMD_FE 0xEB
#raw 0xDD
#raw 0xE8
#raw 0xDC
#raw 0xE3
#raw 0xE9
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xD5
nop0 ' #raw 0x0
#raw 0xE4
#raw 0xE3
#raw 0xDF
comparevars 0xE3E1 0xE2
#raw 0xE8
#raw 0xE3
#raw 0xFA
#raw 0xE4
#raw 0xE6
#raw 0xE3
#raw 0xE8
#raw 0xD9
#raw 0xD7
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
tempspriteface 0xFF 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF (for a bazillion times)
'Decompiler stopped due to failsafe mechanism (too many #RAW 0xFF commands)

Full Metal
November 27th, 2009, 05:58 AM
...ok...when this happens, it's usually a compiler error, try this
step one
compile this script in PKSV
#eorg 0x8740264
step two
re-compile the original script with dynamics
and see if it works.

Jemzx
November 28th, 2009, 07:41 PM
I'm trying to change the text of Prof. Oak, but it always mix up all the words and when I fix and save the script, it turns out of order again...

Is there a way to change Oak's text as desired (It is when u walk to grass and he stops you.)

Full Metal
November 29th, 2009, 09:20 AM
My guess would be that you have no clue what you are doing.
Read the script, figure out the order the text is called in, edit
the text accordingly while also making sure that you keep the
length shorter/equal to the original text length. If this is a bit to complicated....
1)Start with a new ROM, don't do ANYTHING TO IT
2) The only thing you should do to it is....
2.A)Edit the text using a-text
3)Create yet another new ROM and make a patch
4)Delete the two ROMS u just created
5)Apply the patch to your ROM Hack

Jemzx
November 30th, 2009, 05:30 PM
My guess would be that you have no clue what you are doing.
Read the script, figure out the order the text is called in, edit
the text accordingly while also making sure that you keep the
length shorter/equal to the original text length. If this is a bit to complicated....
1)Start with a new ROM, don't do ANYTHING TO IT
2) The only thing you should do to it is....
2.A)Edit the text using a-text
3)Create yet another new ROM and make a patch
4)Delete the two ROMS u just created
5)Apply the patch to your ROM Hack

thank you Full Metal, but I'm still getting wrong the change with Prof. Oak...

Maybe I'll delete the original script and make a new one with Pokescript... So I should cut to the starter pokemon event, and make something else...

Full Metal
December 1st, 2009, 05:32 AM
O___O??
Pokescript.....
Use PKSV, trust me, it's much better
AND it's updated and has SG, plus it's own built in script generator

Jemzx
December 18th, 2009, 05:23 PM
Ok, I just saw the lesson 9, now I learn how to make the level scripts I wanted... Thanks a lot for the tutorial n_n

Full Metal
December 18th, 2009, 07:14 PM
thank u for teh complimentz...
i'm finking of making mawr......

Razer Rage
December 18th, 2009, 09:06 PM
So, how does PKSV compare to XSE? Why would you recommend PKSV over XSE?

Nice tutorial, although I would make the text larger, and maybe darker. I don't like bright text, it hurts my eyes.

I also recommend making screenshots to illustrate what you're teaching. They make a huge difference, trust me.

Full Metal
December 19th, 2009, 06:56 AM
Well..
1) PKSV has an sg, it has a movement planner, it can decompile thumb code and has scintilla, plus you don't need to include any header files to say "givepokemon BULBASAUR", not to mention there is a drop down code completion feature that is really nice. XSE is nice, and it has some of the same things PKSV does (calculator,notes etc) BUT it's just not quite as user friendly. XSE really is good, and there are times when i use (like for eraserange and what not) but usually, i use pksv.
2) hm....i'll look into it...
3) I'l try 'n make em.

Jemzx
December 19th, 2009, 05:40 PM
Do u know how to work with gender script??

score_under
December 19th, 2009, 05:50 PM
Do u know how to work with gender script??
'... in the middle of some script ...
checkgender
compare lastresult boy
if == jump :boy
'do something girlish
jump :continue
:boy
'do something boyish
:continue
'continue the script as normal

Full Metal
December 19th, 2009, 06:03 PM
withe the checkgender command of course
That will be added into the tut as lesson 10.

Jemzx
December 19th, 2009, 06:35 PM
thank you score under. n_n

Razer Rage
December 23rd, 2009, 12:58 PM
I don't get it. I made a script, compiled it, and now I'm not sure how to decompile it so I can edit it. With XSE, I simply enter the offset and click the button. PKSV has this popup that has no meaning to me.

-_-

sir.euge
December 23rd, 2009, 01:21 PM
nice tutorial! ihope you post more tutorials especially on movements!

Full Metal
December 23rd, 2009, 01:54 PM
hm....movement help? Otay.

interdpth
December 23rd, 2009, 06:26 PM
Anyone know how to set lastresult to a byte in memory?

like
get bytefrompointer
set lastresult etc

I'm probably being stupid so I imagine someone knows.

Full Metal
December 23rd, 2009, 07:04 PM
try writebytetooffset
i'm not really sure how that works, but feel free to try ^_^
also, just check the drop down menu, then go to hackmew's xse and look for a similar command in the command help, that should get you the right "arguments" (arguments are just information a command needs to know in order to do what it needs to)

interdpth
December 23rd, 2009, 07:11 PM
Yeah, i've looked through the whole command list, I really don't want to have to track down the actual memory address for LAST RESULT

urgh this nasty

Full Metal
December 24th, 2009, 03:47 PM
lolz
check hackmew's knowledge thread, the asm thing has yet to work for me, (because it always gets the wrong address somehow or the other) but yea...he tells ya how to find the address of some variables.

Hedgehogger
December 24th, 2009, 07:40 PM
PKSV's an excellent program--I've been using it to compile my scripts for a while since I used to own Windows 98, which was non-XSE compatible. I've got Windows 7 now, but before I give you my life's story, I noticed Advance-Text doesn't work...Now I learned that in PKSV you could decompile a script, edit it, and re-compile it to the same offset.

I used this method a couple of times to change text, but I just need to know...If the text is shorter than the original, what happens to the leftover data? (I tried to look into it with a Hex Editor and the decompiled offsets, but I just got random Raw's out of it) And if the text is longer than the original, will anything be overwritten?

Full Metal
December 26th, 2009, 05:34 PM
if the text is longer, then yes absolutely, things will be overwritten (unless you repoint the data...)
if the text is shorter, then the bytes will be left alone and you'll just have two different strings (pieces of text).

Camshaft
January 1st, 2010, 06:43 PM
So I am new at this and i have been trying to write movement scripts with no success, this is how I write it.

#org 0x816582F
'-----------------------------------
lock
faceplayer
message 0x87400BD ' Do you like adventur...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump 0x87400D4 ' Equal To
jump 0x87400E0

#org 0x87400D4
'-----------------------------------
message 0x87400E9 ' Thats awesome!!\nMe ...
callstd MSG_LOCK ' Built-in lock command
applymovement 0x4 0x26704CC
pauseevent 0x0
release
end

#org 0x87400E0
'-----------------------------------
message 0x8740102 ' Aw . . .\nYou are re...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400BD
= Do you like adventure?

#org 0x87400E9
= Thats awesome!!\nMe Too!!

#org 0x8740102
= Aw . . .\nYou are really missing out

#org 0x26704CC
M walk_down walk_down end


but when i compile it, it comes out like
#org 0x816582F
'-----------------------------------
lock
faceplayer
message 0x87400BD ' Do you like adventur...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump 0x87400D4 ' Equal To
jump 0x87400E0

#org 0x87400D4
'-----------------------------------
message 0x87400E9 ' Thats awesome!!\nMe ...
callstd MSG_LOCK ' Built-in lock command
applymovement 0x4 0x26704CC ' Not in ROM area
nop1 ' #raw 0x1
#raw 0x74
jumpstd 0x9

#org 0x87400E0
'-----------------------------------
message 0x8740102 ' Aw . . .\nYou are re...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400BD
= Do you like adventure?

#org 0x87400E9
= Thats awesome!!\nMe Too!!

#org 0x8740102
= Aw . . .\nYou are really missing out

I was wondering what I'm doing wrong

Full Metal
January 1st, 2010, 06:56 PM
trying redoing this in dynamics.

#org @main
'-----------------------------------
lock
faceplayer
message @q
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @yush
jump @neo
#org @yush
'-----------------------------------
message @msg2
callstd MSG_LOCK
applymovement 0x4 @m1
pauseevent 0x0
release
end
#org @neo
'-----------------------------------
message @msg3
callstd MSG_LOCK
release
end

#org @q
= Do you like adventure?
#org @msg2
= Thats awesome!!\nMe Too!!
#@msg3
= Aw . . .\nYou are really missing out
#@m1
M walk_down walk_down end

also, since the script u compiled wasn't in dynamics, I'll assume that you compiled the script, then decompiled and tried to edit it.
If you intend to do this decompile the script using the "dynamic offsets" option in pksv's decompile box. this will avoid any errors like this.
If i'm not wrong, what happened was when you added to the script, the scripts overwrote eachother.
I could not see any problems in ur script, but the above should work (assuming the event number of the ow is 0x4. . .)
*edit*
welcome to pokecommunity ^.^

Camshaft
January 1st, 2010, 09:25 PM
awesome thanks for the warm welcome, that worked perfectly. Great tutorial too by the way

Full Metal
January 2nd, 2010, 09:57 AM
thank ya thank ya :D
again may i make it known
ToDo
Level Script Update
Check Gender Script
and perhaps (still considering it) some tuts on how to use some features on jpans patch as i already have quite the lengthy script using the run-time multichoice. ... i'll add it to the collection nao.

ThePoketrix
January 8th, 2010, 02:15 PM
One prob.
HOW IN THE WORLD DO YOU SAVE CHANGES TO EXISTING SCRIPTS?!?!?

Full Metal
January 8th, 2010, 08:59 PM
-_- how many times have i answered this?
1) If its a file then either File->Save or ctrl+s
2) If it is supposed to be *inside* the ROM then push F9 or ROM->Compile
srsly though...i might have to add an entire new tutorial for all these nubs asking me how to put a script in a rom or save it...heck, i could probably write a book! >_>
FOR THE LAST FREAKING TIME
IF YOU WANT TO STORE A FILE IN THE GBA ROM, PUSH F FREAKING 9. IF YOU WANT TO SAVE IT AS A FILE TO EDIT LATER, PUSH CTRL + S
maybe the uggested screaming got it through your heads. >.>

Full Metal
January 10th, 2010, 10:12 AM
those are there for EMFASISS, and yes, that would be considered off topic

Mr.Silver
January 10th, 2010, 01:51 PM
Hey metal,Do you mind putting in a "Script showcase" Section?
If so heres the first:
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/dqBJu5emkTM&hl=en_US&fs=1&color1=0x5d1719&color2=0xcd311b"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dqBJu5emkTM&hl=en_US&fs=1&color1=0x5d1719&color2=0xcd311b" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

Full Metal
January 10th, 2010, 04:23 PM
:| i spose.... but its not going inside the *tut* itself, but in another css-div :P

Mr.Silver
January 10th, 2010, 04:30 PM
'kay.
(im breaking the character count :D)

558122_DG
January 21st, 2010, 06:07 PM
can't wait to see the move camera script implemented into this tutorial :D
It's pretty nice, you should update the level scripts part though :)

overall good tut :)

6ryan4
February 7th, 2010, 12:58 PM
I need help with this script:


#dyn 0x740000
#org 0x8734246
lock
msgbox @crono1
callstd MSG_NOCLOSE
pause 0x4
closemsg
applymovement 0x8 @cronoturns
msgbox @crono2
callstd MSG_NORMAL
applymovement 0x9 @gruntturns
msgbox @crono3
callstd MSG_NORMAL
applymovement 0x9 @gruntcomes
jump @trainer

#org @trainer
trainerbattle 0x0 0x003 0x9 @intro @defeat
jump @aftermath

#org @aftermath
lock
msgbox @crono4
applymovement 0x9 @gruntruns
applymovement 0x8 @cronoruns
disappear 0x8
disappear 0x9
pause 0x3
end

#org @intro
= GRUNT: I do as CRONO says.

#org @defeat
= ...I have failed CRONO.

#org @afterwards
= I can also say something after the battle

#org @crono1
= Alright, the next step is...

#org @cronoturns
m look_down say_! end

#org @crono2
= Oh, crap! Not you again!

#org @gruntturns
m look_down say_! end

#org @crono3
= I don't have time for a battle!\nIt's the GRUNT's turn!

#org @gruntcomes
m walk_down look_right end

#org @crono4
= What?! No way!\pGrrr...abort mission!

#org @cronoruns
m run_up run_up run_up run_up run_up run_up run_up run_up end

#org @gruntruns
m run_up run_up run_up run_up run_up run_up run_up run_up end


I need to make it so that the script continues directly after the trainer battle. Can someone edit my script so it'll do that?

558122_DG
February 7th, 2010, 01:34 PM
I need help with this script:


#dyn 0x740000
#org 0x8734246
lock
msgbox @crono1
callstd MSG_NOCLOSE
pause 0x4
closemsg
applymovement 0x8 @cronoturns
msgbox @crono2
callstd MSG_NORMAL
applymovement 0x9 @gruntturns
msgbox @crono3
callstd MSG_NORMAL
applymovement 0x9 @gruntcomes
jump @trainer

#org @trainer
trainerbattle 0x0 0x003 0x9 @intro @defeat
jump @aftermath

#org @aftermath
lock
msgbox @crono4
applymovement 0x9 @gruntruns
applymovement 0x8 @cronoruns
disappear 0x8
disappear 0x9
pause 0x3
end

#org @intro
= GRUNT: I do as CRONO says.

#org @defeat
= ...I have failed CRONO.

#org @afterwards
= I can also say something after the battle

#org @crono1
= Alright, the next step is...

#org @cronoturns
m look_down say_! end

#org @crono2
= Oh, crap! Not you again!

#org @gruntturns
m look_down say_! end

#org @crono3
= I don't have time for a battle!\nIt's the GRUNT's turn!

#org @gruntcomes
m walk_down look_right end

#org @crono4
= What?! No way!\pGrrr...abort mission!

#org @cronoruns
m run_up run_up run_up run_up run_up run_up run_up run_up end

#org @gruntruns
m run_up run_up run_up run_up run_up run_up run_up run_up end


I need to make it so that the script continues directly after the trainer battle. Can someone edit my script so it'll do that?

This goes in the script help thread not here. And full metal are you updating this thread?

Hedgehogger
February 8th, 2010, 11:18 AM
I was wondering...

When inserting a standard warp script, how would you make it warp you to a map that has 3 numbers in the Map address (i.e. 1.122)?

At first I tried just entering "warp 0x1 122 0x0", but that turned it into its true Hex number, which is 7A.

Then, I tried warp "0x1 290 0x0", since 290 in hex is 122...The script came out as warp 0x1 0x90 0x0.

So I tried warp 0x1 0x90 0x2, but then the warp just doesn't work altogether. A little help? The reason why I'm asking here is because I've never seen how it would work in PKSV.

Nvm. I had to put 0x7A in. Ignore this post...

Full Metal
February 11th, 2010, 02:08 PM
OK
@558122_DG- I'll update when i...
A) Have the time (i'm doing a TON of work on Script Gen) and...
B) Feel like it
C) Am not grounded, (FEB 20th, I will be ungrounded, but I have a taekwondo tournament which will occupy all day )
So that everyone knows, I'm grounded until FEB 20th, so don't take it personal if I don't reply, this is the only reply I will make, because I *do* want to maintain some trust with my parents...

unitedpokemon
February 12th, 2010, 04:06 AM
Hey someone please.can anyone of you makes me a traveling script?Like the vermillion travel script.i put its code (the real vermillion person who let you travel) and insert.then i get a tri-pass and i go and talk with him,the script wont work.pls anyone make me one.

NarutoActor
March 16th, 2010, 02:23 PM
for the css I think you should make it have a thicker border. Also The text is hard to see I think you should make the size thicker, but I like it alot.

Full Metal
March 16th, 2010, 04:46 PM
will do next time i'm updating, thanks for the feedback ^^

Ready4failure
May 16th, 2010, 03:22 PM
i hate to revive an old thread, but i didnt want to pm you for something small as this. i have a script where the person im talking to jumps at one point:

#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Im so excited!
callstd MSG_NORMAL
applymovement 0x4 @move
pauseevent 0x0
msgbox @text2
Callstd MSG_NORMAL
release
end
#org @text
= Im so excited!
#org @text2
= I love pokemon!
#org @move
m jump_down jump_down jump_down jump_down say_! end

now, I want to make it so that he jumps facing me, no matter where i talk to him from. how do i do that?

TheChroniclesofLance
May 17th, 2010, 04:23 PM
how do you input the new script?
the script number is different from the offset number.

Ready4failure
May 17th, 2010, 05:03 PM
how do you input the new script?

if you're asking how to put the script in the game, when you have a person highlighted in A-map, copy the (@start <-> 0x740001) in the compiled script into the space that it says script offset.

if you were somehow talking to me, i did the exact same thing, i made the thing from scratch, and inserted it like that.

TheChroniclesofLance
May 17th, 2010, 08:25 PM
if you're asking how to put the script in the game, when you have a person highlighted in A-map, copy the (@start <-> 0x740001) in the compiled script into the space that it says script offset.

if you were somehow talking to me, i did the exact same thing, i made the thing from scratch, and inserted it like that.

that doesn't work.

all that happens when I do that is a bunch of #raw x0FF

Ruzzle
May 18th, 2010, 09:12 AM
I want MOM to give me a Pokemon on the beginning.
But how do i let the Pokemon menu show up?
Because i want MOM to give me the first Pokemon..

Ready4failure
May 18th, 2010, 11:49 AM
that doesn't work.

all that happens when I do that is a bunch of #raw x0FF

ok then, well that normally means you did something wrong lol. ok, explain your process, because what you're supposed to do is open the rom in pksvui, make the script, hit the compile button, then go into A-map and put the number you copied into the offset box. you need to compile the script of the game you're going to use it in, the same file and all. if you still have trouble, pm me or something, i know how to do that at least. lol

TheChroniclesofLance
May 23rd, 2010, 01:35 PM
I read the tutorial but cannot completely understand how to make a new script.

I want to make a script that it like

"You found some pokemon in the snow! You can only save one."
You then pick between three different pokemon.
After you pick the pokemon, you find a pokedex nearby.

thanks for the help if you can

Darkerm
May 23rd, 2010, 01:44 PM
I think the Easy starter script need a pointer for text. It work fine by Giving the starter, item, tm, pokedex but without saying anything. That just weaird.

TheChroniclesofLance
May 23rd, 2010, 02:45 PM
couldn't the easy-starter have some thing that allows you to pick between a set of pokemon.

Also tried the earthquake thing but when I tested it, it didn't work

jamesofice
June 1st, 2010, 01:20 PM
i'm compilin a script for a hack where your mom walks to you and gives you running shoes i've compiled it repeatedly an looked at every single offset and i never get the one i want heres the script in a spoiler to show you and you can see what i'm doing wrong, if possible could you please fix it?



#dyn 0x740000
checkflag 0x1500
if true jump 0x740001
#org @start
m say_! walk_up walk_right walk_up look_right end
lock
faceplayer
msgbox @text ' Oh! \v\h\01! happy birthday here's your present from me!
callstd MSG_NORMAL
setflag FR_RUNNING_SHOES
call 0x100000
m walk_down walk_left walk_down look_left end
setflag 0x1500
release
end
#org @text
= Oh! \v\h\01! happy birthday\n here's your present from me!
#org @0x740002
' Those running shoes will get\n you to the lab quicker!
#org @0x740001
' Hello \v\h01! are you okay\n you should go upstairs for a\p rest...
fadescreen FADEOUT_BLACK
fanfare 0x100
waitfanfare
closemsg
special HEAL_POKEMON
fadescreen FADEIN_BLACK
' there all better!
release
end

Full Metal
June 1st, 2010, 01:30 PM
eh...put the
checkflag 0x1500
if true jump 0x740001
under the #org @start...

Dylanimus
June 2nd, 2010, 04:35 AM
Hi, this iss a nice tut, but could you please give me an example of a giveaway with this in it?

addpokemon BULBASAUR 10 00 0 0 0
addpokemon SQUIRTLE 10 00 0 0 0
addpokemon CHARIZARD 25 00 0 0 0

Thank you vm!

jamesofice
June 3rd, 2010, 12:04 PM
ermm i tried that.... it's still not working what offset do i copy when i've compiled it...

Full Metal
June 3rd, 2010, 04:00 PM
eh...have you used pokescript before?
PKSV and POKESCRIPT DO NOT mix.

Dylanimus
June 4th, 2010, 09:11 AM
---To jamesofice: Thanks for helping James.

---To Full Metal: I create scripts, yeah but I should need an example from something when you get a Pokémon, some example from when you only get 1 of them is also okay.

Full Metal
June 4th, 2010, 09:31 AM
a simple givepokemon script (wait...isn't there one of those in my tutorial?)

#dyn 0x740000
#org @main
lock
faceplayer
checkflag 0x1111
compare LASTRESULT
if true jump @how
addpokemon BULBASAUR 5 1 0 0 0
message @here
callstd MSG_NORMAL
release
end
#org @howishe
message @howishe
callstd MSG_NORMAL
release
end
#org @here
= Please have this BULBASAUR...
#org @howishe
= How is the BULBASAUR I gave you?

Dylanimus
June 4th, 2010, 09:39 AM
Thank you vm for your help!!

---------------------------------------------------------------------------------------------------------------------

Hi again, I tried and tried to make the script but it doesn't work.:'(

Beechlgz
June 6th, 2010, 01:54 AM
that doesn't work.

all that happens when I do that is a bunch of #raw x0FF

This happens to me too when I was using the wrong one (@offset1 <-> 0xEB0B21 (0x0 bytes) instead of @start <-> 0x740090 (0xB bytes)), but it still doesn't work if I use the start one and I'm pretty sure I'm following the instructions exactly.

I create the script, looks like this (because it's my first try just for practice):

#dynamic 0x740000
#org @start
lock
faceplayer
message @offset1
callstd MSG_NORMAL
release
end

#org @offset1
=Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?I hit compile and I get this come up: @start <-> 0x740090 (0xB bytes)
@offset1 <-> 0xEB0B21 (0x0 bytes)

In Advance Map I insert the script offset 0x740090 into the "script offset" field for the person I want to say it. When I click "Open Script, it comes out like this:

#org 0x8740090
'-----------------------------------
lock
faceplayer
message 0x8EB0B21 '
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x8EB0B21
= And obviously fails to work in the game.

Where am I going wrong?

EDIT: Now it comes up with this:

#org 0x87400A8
'-----------------------------------
lock
faceplayer
message 0x87400B3 ' Last year they start...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400B3
= Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
And the character will not speak. I don't know what I did to cause the change, but I guess it's one step in the right direction. Still, upon testing, the speech window opens but no text is displayed.

Also, variables. Yeah, I can see how to read them. But what actually are they? What do they do?

Alignment
June 6th, 2010, 05:07 AM
This happens to me too when I was using the wrong one (@offset1 <-> 0xEB0B21 (0x0 bytes) instead of @start <-> 0x740090 (0xB bytes)), but it still doesn't work if I use the start one and I'm pretty sure I'm following the instructions exactly.

I create the script, looks like this (because it's my first try just for practice):

#dynamic 0x740000
#org @start
lock
faceplayer
message @offset1
callstd MSG_NORMAL
release
end

#org @offset1
=Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?I hit compile and I get this come up: @start <-> 0x740090 (0xB bytes)
@offset1 <-> 0xEB0B21 (0x0 bytes)

In Advance Map I insert the script offset 0x740090 into the "script offset" field for the person I want to say it. When I click "Open Script, it comes out like this:

#org 0x8740090
'-----------------------------------
lock
faceplayer
message 0x8EB0B21 '
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x8EB0B21
= And obviously fails to work in the game.

Where am I going wrong?

EDIT: Now it comes up with this:

#org 0x87400A8
'-----------------------------------
lock
faceplayer
message 0x87400B3 ' Last year they start...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87400B3
= Last year they started building\n\la PokeCentre here, but they ran\n\lout of money.\nSo we made it a garden!\n Isn't it great?
And the character will not speak. I don't know what I did to cause the change, but I guess it's one step in the right direction. Still, upon testing, the speech window opens but no text is displayed.

Also, variables. Yeah, I can see how to read them. But what actually are they? What do they do?


#dynamic 0x740000
#org @start
lock
faceplayer
message @text
callstd MSG_NORMAL
release
end

#org @text
= Last year they started building\na Pok\eCentre here, but they ran\lout of money.\pSo we made it a garden!\nIsn't it great?

Try this & open your ROM via PKSV first...

TheChroniclesofLance
June 6th, 2010, 07:06 AM
how would one do a mailman script. a person walks up to you.

something like "The mailman gave you a letter"

then he walks off, you read it. and then it releases you?

cormac
June 6th, 2010, 08:29 AM
Whats wrong with the script below.
If I pick yes or no in the message box, it still goes to " @given " when
I would only want to go there on a yes. Any help is helpful
thanks in advance.

Problem part below (not all of the script)

dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
if 0x1 jump @given
jump @sad1

Alignment
June 6th, 2010, 10:54 AM
Whats wrong with the script below.
If I pick yes or no in the message box, it still goes to " @given " when
I would only want to go there on a yes. Any help is helpful
thanks in advance.

Problem part below (not all of the script)

dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
if 0x1 jump @given
jump @sad1

you don't need the second jump. Try:

#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @given
(now continue the script from @sad1)

REMEMBER:
@text - is a pointer to the question
@given is what is said if yes was the answer to the question
what ever is after @given occurs if the player answers no to the question @text

This has become a script help thread all of a sudden :P

snyderc
June 12th, 2010, 07:29 PM
ok so how would i make a script in which someone exits a building walks over to me and has me follow them inside (like professor oaks in fire-red/leaf-green) im making a game but i need a professor to escort me inside to give the starter pokemon

Full Metal
June 13th, 2010, 05:49 PM
from now on, please ask questions regarding help with scripts in the script help request thread. thank you.

pokehax18
June 25th, 2010, 10:43 PM
ive been messing with pksv for awhile and im able to do everything except messages (text keeps overlapping even with /n) and movement (not sure how to put it into the script) can anyone help me?

Full Metal
June 26th, 2010, 11:28 AM
yup.
don't use /n, use\n trust me, it will work much better.
also, i believe XSE and PKSV both have a text converter, i reccomend using that (or perhaps the script gen inside pksv's menu -.- wow the laziness amazes me...)

DCrawford33
June 27th, 2010, 03:17 PM
This is a good tutorial, but could you explain the multiplechoice command for me?

Full Metal
June 27th, 2010, 06:30 PM
nope, as i don't really get it myself (except for with jpans engine)
i recommend searching that tutorial allowing you to edit the multi-choice boxes though ;)

Alignment
June 27th, 2010, 07:30 PM
nope, as i don't really get it myself (except for with jpans engine)
i recommend searching that tutorial allowing you to edit the multi-choice boxes though ;)

I've seen a tutorial for that by Manipulation somewhere else, it requires hex editing. Jpan's patch is the way to go in my opinon.

Full Metal
June 28th, 2010, 07:23 AM
haha, but that is the lazy way of doing things ;)
what if somebody wanted to do it on say, a game besides firered?

minime010
July 28th, 2010, 09:39 AM
could you add battle scripts?

ger345
August 7th, 2010, 03:33 PM
Could you explain how to find the whole scripts offset, im having trouble. Heres my script. In my game its how you get your two starters! (I need an offset that works with advance map!)
#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Hi!
callstd MSG_NORMAL
release
end

#org @text
= Hi!
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon CATERPIE 5 = 5 NONE 0 0 0
setflag 0x250
storepokemon 0 CATERPIE
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!


#dyn 0x740000
#org @begin
trainerbattle 0x0 0x059 0x0 @intro @defeat
msgbox @afterwards
callstd msg_normal
end
#org @intro
= I will crush you!!! Go! Butterfree and Beedrill!

#org @defeat
= You crushed me[.]

#org @afterwards
= Hmm. Very nice! I see my caterpie is really strong! Trade him to me for this Beedrill? My Beedrill is level 10 No? You just want him? Ok.... Bye Bye Beedrill.
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon BEEDRILL 10 = 10 NONE 0 0 0
setflag 0x250
storepokemon 0 BEEDRILL
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!
#dyn 0x740000
#org @
lockall
message @healmsg
showmsg
waitbutton
fadescreen 1
closemsg
special 0
fadescreen 0
msgbox @bettermsg
callstd MSG_NORMAL
releaseall
end

#org @healmsg
= Your POKéMON look tired[.]\nYou should give them some of my special medicine!.

#org @bettermsg
= There. All better now!

Alignment
August 7th, 2010, 05:41 PM
Could you explain how to find the whole scripts offset, im having trouble. Heres my script. In my game its how you get your two starters! (I need an offset that works with advance map!)
#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Hi!
callstd MSG_NORMAL
release
end

#org @text
= Hi!
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon CATERPIE 5 = 5 NONE 0 0 0
setflag 0x250
storepokemon 0 CATERPIE
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!


#dyn 0x740000
#org @begin
trainerbattle 0x0 0x059 0x0 @intro @defeat
msgbox @afterwards
callstd msg_normal
end
#org @intro
= I will crush you!!! Go! Butterfree and Beedrill!

#org @defeat
= You crushed me[.]

#org @afterwards
= Hmm. Very nice! I see my caterpie is really strong! Trade him to me for this Beedrill? My Beedrill is level 10 No? You just want him? Ok.... Bye Bye Beedrill.
#dyn 0x740000
#org @start
lock
checkflag 0x250
if 0x1 jump :end
setflag FR_POKEMON
countpokemon
compare LASTRESULT 6
if == jump @noroom
addpokemon BEEDRILL 10 = 10 NONE 0 0 0
setflag 0x250
storepokemon 0 BEEDRILL
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
:end
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @noroom-msg
= You don't have enough room in your party.

#org @get-msg
= You got a \v\h02!
#dyn 0x740000
#org @
lockall
message @healmsg
showmsg
waitbutton
fadescreen 1
closemsg
special 0
fadescreen 0
msgbox @bettermsg
callstd MSG_NORMAL
releaseall
end

#org @healmsg
= Your POKéMON look tired[.]\nYou should give them some of my special medicine!.

#org @bettermsg
= There. All better now!


You must compile them. Even if I compiled it here and gave you the codes it would differ depending on the ROM and the scripting program has to actually implant the scripts themselves. I suggest looking at someone compiling a script on youtube, it's not an easy matter to explain in words (people often get confused).

Full Metal
March 1st, 2011, 05:56 PM
I've been told there are a few bugs in my scripts. I haven't updated the first post yet, I'll do that on the weekend. [css makes it take forever, and I feel the need to heavily edit CSS every time I edit a post. ... :\ ]
anyways
original:

unsigned int size;//C++ code, sorry, forgot to push ctrl+c....
#dynamic 0x740000
#org @main
lock
faceplayer
checkflag 0x200
if 0x1 jump @haveit
message @want
callstd MSG_YESNO
if 0x1 jump @pushedyes
jump @pushedno

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @pushedyes
setflag 0x200
giveegg PICHU
message @herego
callstd MSG_NORMAL
release
end

#org @pushedno
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= Hey, do you want this Pichu egg?

#org @howsit
= Here you go!\nPlease raise it well.

#org @dontwant
= Oh, ok. Maybe someone else will take it.

And Fixed:

#dynamic 0x740000
#org @main
lock
faceplayer
checkflag 0x200
if 0x1 jump @haveit
message @want
callstd MSG_YESNO
if true jump @pushedyes
jump @pushedno

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @pushedyes
setflag 0x200
giveegg PICHU
message @herego
callstd MSG_NORMAL
release
end

#org @pushedno
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= Hey, do you want this Pichu egg?
#org @herego
= Here you go!\nPlease raise it well.
#org @howsit
= How's the PIICHU I gave you?
#org @dontwant
= Oh, ok. Maybe someone else will take it.

@Sora's Nobody- Um, well I looked in my variable lesson, I don't see a message for YES/NO in there anywhere. :|

sora19
March 18th, 2011, 10:44 PM
Hi I'm new to this whole rom hacking thing but i got down how to edit sprites and maps just wanna know about scripting few questions

1. Does PKSV have a way to show me the entire script for fire red and if not how can i do that

2. How do I asign a script to a new character that I put int/add a new main character to the game such as if I choose to be male female is also in the game as a rival/ally?

The Void
April 24th, 2011, 08:40 PM
I made a script for Brendan in a cave in Pokemon FireRed. According to him he was there because of a rare Pokemon. He then engages the player in a Pokemon battle. After the player defeats him, Brendan says a few stuff about how strong the player is then an earthquake occurs. He then says that it must be coming from downstairs and walks towards a ladder leading downstairs.

____________________________________________________
#dynamic 0x74000
#org @start
lockall
checkflag 0x200
if true jump :end
applymovement 0x1 @movement
applymovement 0x1 @movement2
trainerbattle 0x0 0x1AA 0x0 @intro @defeat
msgbox @afterbattle ' You have amazed me b...
callstd MSG_LOCK ' Built-in lock command
lockall
setvar 0x8004 0x3
setvar 0x8005 14
setvar 0x8006 14
setvar 0x8007 3
special 0x136
waitspecial
releaseall
lock
faceplayer
msgbox @text ' What was that?
callstd MSG_NORMAL
release
applymovement 0x1 @movement3
applymovement 0x1 @movement4
end

#org @intro
= Hey!\nYou're ALBRAVE, right? \pI've heard so much about you! \pI've heard of your triumph over\nthe ELITE FOUR in KANTO! \pOh, I forgot to introduce myself.\pI am BRENDAN, the\nHOENN LEAGUE CHAMPION. \pI have come here because\nI have heard that a rare species\lof POK\eMON has come\nhere. \pBut before I battle it,\nI want to see your strength\nin a POK\eMON BATTLE! \pCome on!

#org @defeat
= Wow! You're strong!

#org @afterbattle
= You have amazed me beyond\nwords! \pI guess I'm not worthy\nof the rare POK\eMON that dwells here. \pBut you are! \nGo on! \pI must take flight! \pSee you around soon!

#org @text
= What was that? \pAn earthquake!\nIt must be coming from below!\lLet's check it out!

#org @movement
M look_down say_! end

#org @movement2
M walk_down walk_down

#org @movement3
M say_!!

#org @movement4
M walk_right walk_right walk_right walk_right end
_____________________________________________

I was able to compile this and get the offset but for some reason when I tested it on the game, the game just hangs... Can you tell me why? Please do tell me what's wrong with my script. I've just began scripting and I don't know much yet...

markis
April 26th, 2011, 04:57 AM
Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.

Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.

Full Metal
May 7th, 2011, 03:50 PM
@dragon456 - Well, for starters you have redundant lockall dealies. ( why release, then immediately lock ? ) and secondly, you're missing your :end label specifier, and a setflag statement from what I can see.
@markis - um.... what?

zachlim98
May 15th, 2011, 03:40 AM
Cool, really useful tutorial! Thanks a lot!

Full Metal
May 15th, 2011, 04:19 PM
You bet, I'm glad you find it useful.

Roboto-kun
May 30th, 2011, 10:57 PM
You must compile them. Even if I compiled it here and gave you the codes it would differ depending on the ROM and the scripting program has to actually implant the scripts themselves. I suggest looking at someone compiling a script on youtube, it's not an easy matter to explain in words (people often get confused).

Just click the compile button. Omg. It's so easy. o.o

Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.

Hi, i'm new here. I have 3 questions. First, wtf that FR_BADGE_1 and RS_BADGE_1. And others like what? What whey do and how to use with examples? Second, can you tell more about MSG_FIND MSG_NORMAL and others? What whey do and how to use? With examples. And third, how to make person event follow player script? Like in pkmn yellow. Looking forward to your answer.

Answers:
1. FR_BADGE_1 is a command that gives you the 1st badge. FR_BADGE_2 is the second and so on. RS_BADGE_1 will erase your badge. How to use FR_BADGE_1:

#dyn 0x740000
$org @main
lock
faceplayer
setflag FR_BADGE_1
release
end

That's about it.

2. MSG_NORMAL is a normal message. MSG_NORMAL is a message like "Player found the rare candy!". MSG_NOCLOSE is a non-closing message, much like MSG_NORMAL. However, the only difference between the two is MSG_NOCLOSE doesn't close even when the next command appears. To close it, use closemsg. MSG_OBTAIN are messages like "Player obtained item!". MSG_YESNO are used for yes and no messages. I think there're more, but figure them out by yourself. ;D

How to use MSG_NORMAL:
#dyn 0x740000
#org @start
lock
faceplayer
message @talk
callstd MSG_NORMAL
release
end

#org @talk
= Hello.

How to use MSG_NOCLOSE:
#dyn 0x740000
#org @start
lock
faceplayer
message @talk
callstd MSG_NOCLOSE
release - BTW, a command like release can also close MSG_NOCLOSE
end

#org @talk
= Hello.

How to use MSG_FIND/OBTAIN:
#dyn 0x740000
#org @start
lock
faceplayer
copyvar 0x8000 POTION (or something like that)
callstd MSG_FIND < MSG_OBTAIN is used like that as well.
release
end

How to use MSG_YESNO:
#dyn 0x740000
#org @start
lock
faceplayer
message @talk
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @yes
compare LASTRESULT NO
if == jump @no
release
end

#org @talk
= Are you a girl?

#org @yes
= Oh! Ok.

#org @no
= Oh...

3. It is quite impossible to make a Pokemon follow you. I've seen videos, however, you cannot tell if they're real.

Hope I helped you!

Multiple choice function?

Ghost2d
June 4th, 2011, 10:42 AM
I want to learn to make a script, where the pokedex is givin to me, maybe with a message attached.

Full Metal
June 4th, 2011, 03:13 PM
The simple answer is:
Read the tutorial. :)

Rock Star Incorporated
June 20th, 2011, 12:35 PM
Hey buddy, thanks for this tutorial, its really helped me. I don't know if I missed it, but do you have a section which includes how to make a sprite dissapear?

In my hack I have someone guarding the exit out of the first town, and I want them to move out the way once I recieve my pokemon.

Would I use flags, person ID's or something alike?
If you can help me I would be so grateful, thanks.

Full Metal
June 22nd, 2011, 08:24 PM
^ I believe there is an 'in depth advance map tutorial'
search 'map tutorial'
I believe it's by the author of NSE, but my memory is rusty at best.
But the idea of it is, you take the person ID of an OW on advance-map, and that is a flag. When you set the flag, that person vanishes. When you clear the flag, they reappear. Pretty convenient feature. (:
Alternately, if you just want to hide them temporarily I believe there is a 'hidesprite 0xZZ' command, that hides the OW with the ID of 0xZZ. Like I said, this is based off the top of my head, and my memory is about as good as a gold-fish's. X)

Rock Star Incorporated
June 27th, 2011, 11:48 AM
Thanks a lot ! I will look this up now :)

ahsome
July 11th, 2011, 11:45 PM
Thx man, your tutorial is like one of the only ones :(
You are great, and this tutorial made me want to do PKSV and no other (but the compile that automatically finds free space kept me on going lol :D)
Just wanna know, can you make a YouTube of this? cause i really needed this scripting for my hack (Pokemon Operation Blackstrike btw)
Unless you wanna help my hack? That will be good too :D :D

Full Metal
July 12th, 2011, 08:00 AM
Um....no.
Making a video of scripting is beyond pointless. :)
Just read, and try to make sense of it.
Not that hard.

ahsome
July 12th, 2011, 09:27 PM
sure i dont mind :P
btw, do you know how to hack ruby?
because i want to make it that, you know the place where the truck is?
when you get out, you go outside your house right?
well, i wanted to make a truck an aeroplane (wacky idea, but hey :P) but i keep teleporting to the original spot all the time grrr
when i looked at the warp in the truck it leads nowhere WHY???
it says this
WARP
warp no:127
map bank:127
map:127
thats from advance map
PLS HELP ME< I KNOW IT MUST BE SCRIPT SO HELP ME PLSPSLSPSLSPLS :'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(

Full Metal
July 13th, 2011, 08:25 AM
There's a level script in the starting town that checks the player's gender, and places him/her at the apropriate spot.

ahsome
July 14th, 2011, 03:19 AM
Then can hou PM me how to change it to a different spot pls. I really need this to work. Il add you to the people who help section :D
BTW, how you make a scipt that if you go somwhere, some guy comes from nowhere and talkee to you? (i think its a green box script, not sure)

Full Metal
July 14th, 2011, 07:46 AM
^ TBH I think you should give up for now. Learn how to script, then continue. At this rate you're never going to get far. You need to learn how to stand on your own two feet.
The level script can be found via A-MAP and decompiled w/ PKSV.

darklugia23
July 18th, 2011, 10:12 PM
How can I create a pokemon battle script? The script generator doesn't work for me it just freezes my fire red when I click A on the sprite with the generated pokemon script and it doesnt work for S/R/E eather some help would be appreciated

Full Metal
July 19th, 2011, 07:33 AM
De-compile the script.
You inserted it wrong.

darklugia23
July 21st, 2011, 08:29 PM
wow it worked for my firered and leafgreen! Thanks but the script generators wild battle script still doesn't work for R/S/E

snyderc
July 23rd, 2011, 08:52 AM
can someone here help me? iv looked all around and i cant figure out whats wrong in it. everytime its activated the game just freezes instead of continuing on with the script. <spoiler> #dyn 0x740000
#org @start
checkflag 0x0856
if true jump @end
lock
msgbox @class
callstd MSG_NORMAL
msgbox @quizyesno
callstd MSG_YESNO
if 0x1 jump @quizquestion
jump @decline


#org @class
= \v\h01! Where do you think you're going? \nClass isn't over yet. \pIf you can answer my question \nI will let you go early, but you must be back \p in time for graduation!

#org @quizyesno
= Do you want to take her quiz?
#org @quizquestion
msgbox @quiz
callstd MSG_YESNO
if 0x1 jump @correct
jump @wrong
#org @quiz
= Does the status effect POISON damage \nyour POKEMON's health?

#org @correct
callstd MSG_NORMAL
msgbox @yay
setflag 0x0856
release
end
#org @wrong
= I guess someone didn't study their notes\nvery well.
applymovement PLAYER @left
#org @left
M walk_left end
#org @decline
msgbox @sit
callstd MSG_NORMAL
release
end
#org @sit
= Well then sit back down and wait for class to end.
#org @end
end
#org @yay
= Alright, fine. Just be back soon </spoiler>

slowbro42
August 20th, 2011, 03:39 PM
i input a give-pokemon script and placed the script offset correctly but when i test the game the person doesn't appear on the map unless i walk around a bit. and when i finally talk to him he reads the text that some other person on the map would say. what's wrong? I have delted the person many times and tried new givepokemon scripts but the same thing happens. please help.

Full Metal
August 20th, 2011, 04:16 PM
This is very odd indeed, although I'm not sure I understood what you're saying completely.
Perhaps you have too many events in your map? say...more than 0xFFFFFF ( more than 6,000 ) ? If not, I'm at a loss as to what the problem could be without actually seeing your script.

slowbro42
August 25th, 2011, 09:22 AM
Oh I figured it out soon after, the personevent# was the same as another sprite...Duh. But one last thing:

I am creating a three-person givepokemon yes/no script (i.e. each person offers a pokemon). When the player selects the one pokemon he/she wants then all the 3 sprites should disappear but when I leave the town and back the sprites reappear. If i perform the event again they disappear for good therefore letting the player select an unwanted second starter. Here's my script that is very similar to the other 2:

#dyn 0x800000
#org @main
lock
faceplayer
message @intro
callstd MSG_NORMAL
checkflag 0x1000
if == jump @haveit
showpokepic CYNDAQUIL 0xA 0x3
message @talk
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @pushedyes
jump @pushedno

#org @haveit
release
end

#org @pushedyes
hidepokepic
addpokemon CYNDAQUIL 5 ORANBERRY 0 0 0
setflag 0x828
fanfare 0x13E
waitfanfare
message @take
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
disappear 0x4
disappear 0x5
disappear 0x6
fadescreen FADEIN_BLACK
setflag 0x1000
release
end

#org @pushedno
hidepokepic
message @notake
callstd MSG_NORMAL
release
end

#org @intro
= Hi there \v\h01!\nI bet your headed toward Route 1\lhuh?\pWell first you have to have a\nPok\emon for protection.\lYou can have one from one of us\nso choose wisely.

#org @talk
= I hold Cyndaquil the Fire\nPok\emon, would you like him?

#org @howsit
= I hope you do well on your journey,\nso good luck.\lDon't forget to say bye to your mom.\nWe must go now.

#org @take
= Great choice!\nCyndaquil will serve you well.

#org @notake
= Okay then, but you must choose a\nPok\emon reguardless.

I have tried adding extra flags and repositioning my 'setflag 0x1000' but nothing seems to work. help if you can

riddle775775
September 19th, 2011, 04:08 PM
all you need to do is, make the person ids of the sprites that you want to disappear the same number as the flag you set, so in your case the sprites would have an id of 1000

RSBeauAngel
January 10th, 2012, 06:32 PM
Hey, I'm really new to this whole hacking thing, but I'm really interested in it and really want to try my hand at it, so I came here to look for help. I really didn't think I'd understand all this scripting stuff, but I'm really happy that I understood what you wrote here. Thank you so much, this tutorial is so helpful, but I still don't think I fully understand everything here.
I don't really understand the situation in which I would use these scripts. Like, I don't know really when I'd have to use the variables, or level scripts, and other things like that. I also have no idea how to make a trainer battle, or to make people move, and other stuff that I know I would need to create a hack.
This tutorial really gave me hope, and I know that with a little more help I could understand it fully. I've seen that you've wanted to add new lessons to this, but that was years ago, and I'm sad because of that. Your tutorial is so easy to understand, I really hope you do get the motivation to add more lessons so people like me can understand how to script things like battles and movement, etc.
I also think another thing to add to help would be situations in which the scripts would apply. Like, when you would use the level scripts and what you use them for. Same with the variable scripts. Because I know that even though I understand how to write them, I have no clue as to what to use them to do.
Sorry if this was a lot, this is my first post on this site and your tutorial just gave me so much hope and excitement for this. I don't want to give up because I have no idea how to do something that isn't taught in this tutorial, so I really do hope you decide to continue your wonderful teaching of PKSV! :)

The Void
January 10th, 2012, 09:45 PM
Hey, I'm really new to this whole hacking thing, but I'm really interested in it and really want to try my hand at it, so I came here to look for help. I really didn't think I'd understand all this scripting stuff, but I'm really happy that I understood what you wrote here. Thank you so much, this tutorial is so helpful, but I still don't think I fully understand everything here.
I don't really understand the situation in which I would use these scripts. Like, I don't know really when I'd have to use the variables, or level scripts, and other things like that. I also have no idea how to make a trainer battle, or to make people move, and other stuff that I know I would need to create a hack.
This tutorial really gave me hope, and I know that with a little more help I could understand it fully. I've seen that you've wanted to add new lessons to this, but that was years ago, and I'm sad because of that. Your tutorial is so easy to understand, I really hope you do get the motivation to add more lessons so people like me can understand how to script things like battles and movement, etc.
I also think another thing to add to help would be situations in which the scripts would apply. Like, when you would use the level scripts and what you use them for. Same with the variable scripts. Because I know that even though I understand how to write them, I have no clue as to what to use them to do.
Sorry if this was a lot, this is my first post on this site and your tutorial just gave me so much hope and excitement for this. I don't want to give up because I have no idea how to do something that isn't taught in this tutorial, so I really do hope you decide to continue your wonderful teaching of PKSV! :)

You use vars and flags when you want to trigger a certain event or make an event happen only once. Level scripts are scripts used when you enter the map, like a script that triggers upon entering. They're pretty simple and I don't think they need to be added to the thread, though. If you have any questions, you are welcome to VM/PM me. You might also want to check this thread (http://www.pokecommunity.com/showthread.php?t=267579) I made out because they teach a few other script variants not mentioned in this thread. I wish you the best of luck in your journey towards mastery. :)

DealNotTheDevil
February 1st, 2012, 04:52 AM
Hello Everyone!
I need help one something!

Basically, I'm trying to import FRLG maps into Emerald,
To create a "super region" in that sense,
And I'm currently encountering issues with
Connections (I linked them properly on Advance Map, but it doesn't load or becomes one way even though I make it two way)
and also my more pressing issue,

:Remember HGSS, where wild encounter music is different for different region.
I'm trying to incorporate that,
So I'm wondering if there is any script that can change wild battle and trainer battle music in that region, and it will reset to normal battle theme when I leave Kanto and head back to Hoenn!
thanks!

droomph
February 1st, 2012, 03:15 PM
Hello Everyone!
I need help one something!

Basically, I'm trying to import FRLG maps into Emerald,
To create a "super region" in that sense,
And I'm currently encountering issues with
Connections (I linked them properly on Advance Map, but it doesn't load or becomes one way even though I make it two way)
and also my more pressing issue,

:Remember HGSS, where wild encounter music is different for different region.
I'm trying to incorporate that,
So I'm wondering if there is any script that can change wild battle and trainer battle music in that region, and it will reset to normal battle theme when I leave Kanto and head back to Hoenn!
thanks!You will need to make a whole separate behavior byte identical to the normal grass, but refers to a special that plays the second theme instead when you encounter a Pokémon.

DealNotTheDevil
February 4th, 2012, 04:36 AM
You will need to make a whole separate behavior byte identical to the normal grass, but refers to a special that plays the second theme instead when you encounter a Pokémon.

Do you have any idea how to do that??

miksy91
February 4th, 2012, 06:13 AM
Do you have any idea how to do that??
An asm code that loads all other data expect for the music byte from the assembly of normal grass (you've got to be familiar with hex editing before trying to do this though).

DealNotTheDevil
February 4th, 2012, 06:26 AM
An asm code that loads all other data expect for the music byte from the assembly of normal grass (you've got to be familiar with hex editing before trying to do this though).

Thing is, I don't know what is the offset for ASM nor what to change on it.

I found an interesting site, however it is for FRLG.

(I cannot link the site cause I have yet to reach 15 post count, instead i'll add it to a notepad file.)

Zidca
February 24th, 2012, 11:12 AM
Hello. Your tutorial helped, but what do I do when im ready to decompile it, and how do I put it in the game via Advanced Map?

Full Metal
February 24th, 2012, 02:51 PM
^ Look at an advance-map tutorial, it will help you immensely, my good friend.

Mr.KoolAid
March 30th, 2012, 07:35 AM
Hi, i am trying to use pokescript to script events in a fire red rom.

I am having a lot of problems i was hoping someone could help me out with.

Basically, every time i script something (i use the templates they give us) i than hit save (save to its own folder, is this right? - as a .pks or whatever) and than i dont know what to do, with the offsets.

What offset to i set to the event? for trainers is it the one it says in PET? and after i am done with all the scripting stuff, do i compile or decompile? and from there what do i do???

Please help me!!!

bjanzen
March 30th, 2012, 01:05 PM
Hi, i am trying to use pokescript to script events in a fire red rom.

I am having a lot of problems i was hoping someone could help me out with.

Basically, every time i script something (i use the templates they give us) i than hit save (save to its own folder, is this right? - as a .pks or whatever) and than i dont know what to do, with the offsets.

What offset to i set to the event? for trainers is it the one it says in PET? and after i am done with all the scripting stuff, do i compile or decompile? and from there what do i do???

Please help me!!!

If you were using PKSV which it says you're not, you type the offset for @start or @main and put it into advanced map, after hitting compile ofcourse.

Now for my own question, i've scripted a dozen or so events that involve interacting with things and i've gotten the hang of it, but i am trying to make a script that triggers when you step on the tile. You know like when you havent progressed enough and someone comes and rejects you from walking into a new area, or a rival battle when you walk on the tile. I've tried everything, can anyone give me some guidance? does it need a lock/faceplayer or lockall? or pauseevent 0x0? any help would be appreciated.

Mr.KoolAid
March 30th, 2012, 01:25 PM
i'm still confused, you said i am not using pksv... is that not what pokescript is? and the rest of that was all nonsense to me. I have no idea what i am doing and there is no @start or @main in my script, and i am using the template pksv gives me :/

i think my only problem is not saving it correctly. once i type in what i want, what are the exact steps i need to do to save it properly (even with compiling - do i just click compile and then be done with it? or do i do something with the information?)

please, can someone give me some step by step instruction on what to do, i have been searching for days now :/

bjanzen
March 30th, 2012, 02:25 PM
I thought pokescript and pksv were different, could be wrong. Anyways, the script generator in pksv should have an @start, it will be the second line. Once you've made your script you press compile and it will spit out a few offsets depending how many dynamic ones you've made. two windows will pop up, go to the one saying dynamic offsets and it will say something like

@start <-> 0x746286 (0x18 bytes) <-----this is the only offset you will put
@talk <-> 0x74629E (0x6F bytes) into advanced map
@move <-> 0x74630D (0x2 bytes)

just take 0x746286 (@start) and remove the 0x and put it into advanced map in the script offset box.
$00746286 <--- it needs a $ and the two 0s at the front

those are example offsets, yours will be different. hope i helped.

Mr.KoolAid
March 30th, 2012, 05:05 PM
ok, so i have been doing it correctly :/

any suggestions on why it has not been working for me?

I have the trainer ID set to the person i changed in PET and the offsets match, i use the template and type in 0x002 (the trainer im using) and it loads the template. i than change the green text to what i want it to say. i save it. compile it. and make sure the offsets match. i then exit and save my game in A-Map.

bjanzen
March 30th, 2012, 09:56 PM
After the explanations i gave you, i'm not sure i understand what you're trying to do my friend...

Mr.KoolAid
March 31st, 2012, 08:27 AM
I am trying to set up a trainer script.

I have the trainer ID set to which trainer i want in PET.

I use the script generator and it asks me to type in the trainer i want (i type in 0x002) it loads the script.

I then change the text it says to what i want. I save, compile, copy the offset, exit, and save my file in advance map. I load up the ROM but the trainer does nothing.

I also tried copying my one working trainer script (dont know how i did it) into my new one. The trainer loads now but it has the ??? pokemon. I also cannot change what he says, it always loads back up to the other trainer, even after i change the text, save, and compile again.

I am bad at this...

shahariko5
April 4th, 2012, 03:12 PM
I have a problem , after i doing a script and copy the @start to the offist , I'm open the script again and its change to : callstd MSG_LOCK ' Built-in lock command ,
how i'm fix that?

linton58
April 10th, 2012, 03:53 PM
I am trying to set up a trainer script.

I have the trainer ID set to which trainer i want in PET.

I use the script generator and it asks me to type in the trainer i want (i type in 0x002) it loads the script.

I then change the text it says to what i want. I save, compile, copy the offset, exit, and save my file in advance map. I load up the ROM but the trainer does nothing.

I also tried copying my one working trainer script (dont know how i did it) into my new one. The trainer loads now but it has the ??? pokemon. I also cannot change what he says, it always loads back up to the other trainer, even after i change the text, save, and compile again.

I am bad at this...

In AdvanceMap, after you copy the offset to the person in the 'Script Offset' box, look up three more boxes and you should see a 'Trainer' box. You need to change that box to $01. This tells AdvanceMap that the event is a trainer.

Next, look for a box called 'View Radius', and set that number to however many blocks away you want the trainer to catch you for a battle. So if you put 4 blocks in his radius, the trainer's line of sight will only be four blocks long.

Hope this helps.

-----------------------------------------------------------------------------------------------------------------------------------------------------

Okay, so I'm almost completely new to scripting itself, much less PKSV. Although I do have one high school semester's worth of web design and javascript, so that's helped me through some of the way, and really I'm just messing around so far.

My problem today is that I am trying to make an event where you walk up to a man, he talks back to you, and at the end of the message he gives you an item (in my case it's a nugget). After this is completed, you can't receive another nugget from him. Instead, he just gives you another, yet different, message.

Seems like this can be easily solved with flags, right? You would think, and I don't think the flag is the problem here. My problem is that I can't get the 'ITEM OBTAINED!' text to show up properly. Instead of saying, "Obtained the NUGGET!" it says, "Obtained the ?????????". It's probably because I don't know the ID for nugget in PKSV, but it does give me a nugget so I don't know.

If anybody could help with this, that would be great.

Oh and if it helps;

This is my script before I compile/paste offsets:


#dynamic 0x740000
#org @main
lock
faceplayer
checkflag 0x201
if 0x1 jump @done
msgbox @before
callstd MSG_NORMAL
additem NUGGET 1
callstd MSG_OBTAIN
setflag 0x201
release
end

#org @done
message @after
callstd MSG_NORMAL
release
end

#org @before
= Are you going against\nTeam Rocket?\pReally?\nAll by yourself?\pHere, let me help you out.\nThis should sell for a pretty \ppenny at Viridian's Pok\emart.

#org @after
= Beat those morons for me, okay?


And this is my script after I compile/paste offset:


#org 0x8740AD1
'-----------------------------------
lock
faceplayer
checkflag 0x201
if true jump 0x8740AF0 ' Flag is set
msgbox 0x8740AF9 ' Are you going agains...
callstd MSG_LOCK ' Built-in lock command
additem NUGGET 1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x201
release
end

#org 0x8740AF0
'-----------------------------------
message 0x8740B8D ' Beat those morons ...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x8740AF9
= Are you going against\nTeam Rocket?\pReally?\nAll by yourself?\pHere, let me help you out.\nThis should sell for a pretty \ppenny at Viridian's Pok\emart.

#org 0x8740B8D
= Beat those morons for me, okay?

SporreKing
April 18th, 2012, 11:17 AM
Great tutorials! But i have a request, you learned us how to GIVE a pokemon but not how to TAKE a pokemon. exmaple: 'do you want to trade your ____ for my _____'
I would appreciate that a lot!

shahariko5
April 20th, 2012, 12:15 PM
I have a question.
I want to edit a game but how can am I edit the first map in emerald/ruby/sapphire ( the van , how I write new start? )

darkjordanx
April 28th, 2012, 05:16 PM
Really good tutorial, but I'm having problems with the "money" command in the PKSVUI script editor. Whenever I type it in and compile it, all that comes out of it is junk (a lot of "raw").

bctincher15
June 21st, 2012, 11:03 AM
How do I make an over world Pokemon disappear permanently after beating/catching it. I would beat/catch it and after I take a step, It will show up again. Can someone help, Please.

Nonono
June 25th, 2012, 08:55 AM
Hi everyone, I'm new to scripting and was hoping someone could help me. I've got most of the scripts figured out except the pokemon battles one (i'm hacking ruby, if that helps). I'm trying to insert new legendary battles.

So, for instance, I'm trying to put a battle with Articuno in. So i insert the sprite in advance map as a person event, no problem, and open up the script at offset $00740000. At that point, the script looks like this:

#org 0x8740000
'-----------------------------------
#raw 0xFF
#raw 0xFF
#raw 0xFF
#raw 0xFF
...and so on.

Then I insert the battle script from the generator, and it looks like this:
#dyn 0x740000
#org @start
special 0x187
compare LASTRESULT 2
if == jump 0x81A7AE0
special 0x188
lock
faceplayer
checksound
cry ARTICUNO 2
waitcry
pause 0x14
playsound 0x156 0x0
battle ARTICUNO 15 NONE
setflag 0x807
special 0x138
waitspecial
clearflag 0x807
special2 0x800D 0xB4
compare LASTRESULT 1
if == jump 0x8162558
compare LASTRESULT 4
if == jump 0x8162561
compare LASTRESULT 5
if == jump 0x8162561
setflag 0x201
release
end

...which I believe is correct, since i got it from the generator.
I press compile, and copy the offset, which is at $00740001, into advance map. i change the person ID to $0201 as well. but then when i open the script again, it looks like this:


#org 0x8740001
'-----------------------------------
special INIT_STEPCOUNT
compare LASTRESULT 0x2
if == jump 0x81A7AE0 ' Equal To
special GET_STEPCOUNT
lock
faceplayer
cry 0x30 0x290
nop0 ' #raw 0x0
waitcry
pause 0x14
playsound 0x156
battle ARTICUNO 15 NONE
setflag RS_BADGE_1
special BATTLE_PIXELLATE
waitspecial
clearflag RS_BADGE_1
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if == jump 0x8162558 ' Equal To
compare LASTRESULT 0x4
if == jump 0x8162561 ' Equal To
compare LASTRESULT 0x5
if == jump 0x8162561 ' Equal To
setflag 0x201
release
end

#org 0x81A7AE0
'-----------------------------------
#raw 0xC9
#raw 0xDC
#raw 0xB8
nop0 ' #raw 0x0
CMD_C3 0x0
#raw 0xE7
#raw 0xD9
#raw 0xD9
setdoorclosed 0xADAD 0xCDFB
#raw 0xE8
#raw 0xDD
#raw 0xE0
#raw 0xE0
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xD6
#raw 0xD9
#raw 0xDD
#raw 0xE2
#raw 0xDB
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xDC
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE7
#raw 0xDD
#raw 0xE0
#raw 0xD9
#raw 0xE2
#raw 0xE8
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xED
#raw 0xE4
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xDD
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xE0
#raw 0xE7
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xD7
#raw 0xE3
#raw 0xE3
#raw 0xE0
#raw 0xB8
CMD_FE 0xDD
#raw 0xE7
#raw 0xE2
givetocoincase 232 ' Bear in mind, it's not in hex
#raw 0xDD
#raw 0xE8
setdooropened 0xC3FB 0xDC00
#raw 0xE3
#raw 0xE4
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
givetocoincase 57568 ' Bear in mind, it's not in hex
nop0 ' #raw 0x0
#raw 0xDB
#raw 0xDD
#raw 0xEA
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE1
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xDC
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE3
#raw 0xE4
#raw 0xE4
#raw 0xE3
#raw 0xE6
#raw 0xE8
#raw 0xE9
#raw 0xE2
#raw 0xDD
#raw 0xE8
#raw 0xED
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
CMD_FE 0xE7
#raw 0xDC
#raw 0xD5
#raw 0xE6
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
#raw 0xE6
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xDC
#raw 0xE3
#raw 0xE9
#raw 0xDB
#raw 0xDC
#raw 0xE8
#raw 0xE7
nop0 ' #raw 0x0
#raw 0xD5
#raw 0xDB
#raw 0xD5
#raw 0xDD
#raw 0xE2
tempspriteface 0xFF 0xC3
givetocoincase 57568 ' Bear in mind, it's not in hex
nop0 ' #raw 0x0
#raw 0xD6
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xE0
#raw 0xE3
#raw 0xE3
#raw 0xDF
#raw 0xDD
#raw 0xE2
#raw 0xDB
nop0 ' #raw 0x0
#raw 0xDA
#raw 0xE3
#raw 0xE6
#raw 0xEB
#raw 0xD5
#raw 0xE6
#raw 0xD8
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xED
#raw 0xE3
#raw 0xE9
#raw 0xE6
nop0 ' #raw 0x0
#raw 0xE2
#raw 0xD9
#raw 0xEC
#raw 0xE8
CMD_FE 0xD6
#raw 0xD5
#raw 0xE8
#raw 0xE8
#raw 0xE0
#raw 0xD9
tempspriteface 0xFF 0xD3
#raw 0xD9
#raw 0xD5
#raw 0xDC
tempspriteface 0xFE 0xC3
#raw 0xE8
givetocoincase 231 ' Bear in mind, it's not in hex
#raw 0xBC
comparehiddenvar 0xBB 0xC9D0
nop0 ' #raw 0x0
checkobedience 0xBBCC
CMD_C3 0xC8
#raw 0xBF
comparehiddenvar 0x0 0xDDE8
#raw 0xE1
#raw 0xD9
tempspriteface 0xFB 0xCE
#raw 0xE3
#raw 0xD8
#raw 0xD5
#raw 0xED
#raw 0xB8
nop0 ' #raw 0x0
#raw 0xEB
#raw 0xD9
givetocoincase 55782 ' Bear in mind, it's not in hex
nop0 ' #raw 0x0
#raw 0xDB
#raw 0xE3
#raw 0xDD
#raw 0xE2
#raw 0xDB
nop0 ' #raw 0x0
#raw 0xE8
#raw 0xE3
nop0 ' #raw 0x0
#raw 0xE4
#raw 0xE6
#raw 0xE3
#raw 0xDA
#raw 0xDD
#raw 0xE0
#raw 0xD9
nop0 ' #raw 0x0
#raw 0xFD
end

#org 0x8162558
'-----------------------------------
nop0 ' #raw 0x0
setmaptile 0x6 0x11 0x252 0x0
setmaptile 0x9 0x4 0x24A 0x1
setmaptile 0x9 0x5 0x252 0x0
setmaptile 0x9 0x7 0x24A 0x1
setmaptile 0x9 0x8 0x252 0x0
setmaptile 0xC 0xD 0x24A 0x1
setmaptile 0xC 0xE 0x252 0x0
setmaptile 0xC 0x10 0x24A 0x1
setmaptile 0xC 0x11 0x252 0x0
return

#org 0x8162561
'-----------------------------------
nop0 ' #raw 0x0
setmaptile 0x9 0x4 0x24A 0x1
setmaptile 0x9 0x5 0x252 0x0
setmaptile 0x9 0x7 0x24A 0x1
setmaptile 0x9 0x8 0x252 0x0
setmaptile 0xC 0xD 0x24A 0x1
setmaptile 0xC 0xE 0x252 0x0
setmaptile 0xC 0x10 0x24A 0x1
setmaptile 0xC 0x11 0x252 0x0
return

.... and then, in the game, the battle obviously freezes up. I feel like i'm missing something really simple here, can anyone help? thank you so much.

iPika
June 29th, 2012, 06:51 AM
How do you make someone give you more than one Pokemon?

Zidca
June 30th, 2012, 10:47 AM
How do you make someone take away your Pokemon?

Samuraiskyshot
July 12th, 2012, 05:07 PM
Im a newb, to scripting, and i finally have gotten pksv to work, only one thing im suggesting or well asking. Can you explain flags better. I understand what they are but not how to use them. And i also dont no how to use the jump command and such, really to a newbie scripter all youve done under the flags part was give a example and then define the flags, not how to use them

BlueEon
July 14th, 2012, 12:29 AM
Someone mind telling me what PKSV stands for?

Pinta77
July 15th, 2012, 10:45 PM
@Zidca (http://www.pokecommunity.com/member.php?u=304905)
As far as I know, it is pretty much impossible. I've never seen a tutorial for removing pokemon, and any time i tried to do it from scratch, it didn't work.

@Samuraiskyshot (http://www.pokecommunity.com/member.php?u=332754)
A flag makes it so something can no longer happen. Use this script as an example:
#dyn 0x740000
#org @start
lock
faceplayer
checkflag 0x1001
if true jump @flag-2

//Flag has not been activated
msgbox @flag-1-msg
callstd MSG_NOCLOSE


setflag 0x1001
release
end

#org @flag-2

//Flag has been activated:
msgbox @flag-2-msg
callstd MSG_NOCLOSE


release
end

#org @flag-1-msg
= The flag hasn't been set yet.

#org @flag-2-msg
= Now it has.


When you first talk to the person, the flag (0x1001 in this case) has not been set yet. So according to this script, the person will say "The flag hasn't been set yet." However in this script, flag 0x1001 is set after you talk to the person. the command "checkflag 0x1001" checks to see if the flag has been set yet. So if you talk to them again, the person will say "Now it has." If you remove the "setflag 0x1001" part, then you can talk to this person over and over again and they will continue to say "The flag hasn't been set yet."

You could make a completely separate script for a different person and include "setflag 0x1001". Then if you go back to the first person, they will say "Now it has."

Every time you use a flag, you have to use a different number. If you use the same number for two different scripts, then once the flag is set, it will be set for both scripts. So you have to be careful. Use a different flag number every time UNLESS you want it to work out that way.

I hope that helps out. If it does, great :) if not, sorry. Try youtube. Normally there are lots of tutorials on flags.

I have a question though. (And I'll be honest, I haven't looked through all of the posts yet, my computer is really slow.)

Is there a way to script movement for ruby/sapphire in PKSV? The movements provided on the first post only seem to work on fire red. On ruby they either move the person the wrong way or freeze the game.

I figured out and mastered movement for ruby/sapphire. I need help with the green box script events. I CANNOT figure it out. I need the player to step on the script event and for a message to be displayed. That's it. Can anyone help?

ArthurWaine
July 26th, 2012, 02:19 AM
I'm sorry if anyone has asked this before, but can anyone tell me how to make a custom trade happen in a FireRed Hack? I know the game uses a couple of pre-sets to define the trades, but is there a way to, say, check for a pokemon, remove it if desired, and then give a new pokemon? Or something along those lines? Any and all help would be greatly appreciated.

TorWallin
August 7th, 2012, 05:25 AM
Hello! I am new with coding so i have some questions:)

I am trying to get the Player to "auto-walk" and talk when you walk on a special point of the ground.
This is my code

#dyn 0x740000
#org @start
lock
applymovement PLAYER @a
release
end

#org @a
m walk_up end

I have set the script with advance map and set it on the right coords.
But the game freezes when i walk on that spot. WHAT is the problem?
Do i have to set the var number?
Do i have to change the script?
Please ansver...

Gyaradoseforwin
June 8th, 2013, 11:25 AM
hey maybe you can help me out. I been working of editing the script when Pro Oak stops you in fire red and i used pksv and i got the script i think but when i copy and past the offset into a-maps i get this message "No script editor defined. do you know what this means and/or how to fix it

AtecainCorp.
June 8th, 2013, 11:45 PM
I have and question for you. How can I change FLAGS in Pokemon Ruby Rom? When I open Pokemon Ruby. And click in PKSV FLAGS editor it show me list for FRLG. And I need change flags for Pokemon Ruby. Becouse I want add JOHTO BADGES headers to my rom.

Sceptylos
June 15th, 2013, 12:31 PM
I've been on this for about 2 days and I'm starting to lose hope, what I'm trying to do is make a Team Rocket Grunt escort the player to a little corner in Viridian Forest then battle him but all I can do right now is make him talk, the movement script doesn't work (pretty sure I'm doing it wrong even though I copy/pasted and edited) and I haven't inserted the trainer battle yet.

#dynamic 0x74000
#org @start
lockall
checkflag 0x1227
if true jump :end
message @a3
callstd MSG_NORMAL
applymovement 0x13 @a1
applymovement 0x13 @a2
pauseevent 0x0
disappear 0x13
setflag 0x1227
:end
releaseall
end

#org @a3
= Hello young one, allow me to escort \nyou through this dangerous forest!

#org @a1
M look_up say_! end

#org @a2
M walk_left walk_left walk_left walk_left walk_left end

superluke
October 3rd, 2013, 02:58 PM
what is wrong with this script?
when ever I run no matter how much money I have it will take all my money away or,
it will just not work at all.

#dyn 0x740000
#org @Main
lock
faceplayer
showmoney 0x0 0x0
message @First
callstd MSG_Normal
paymoney 1000 0
pause 0xF
updatemoney 0 0 0
message @Second
callstd MSG_Normal
hidemoney 0 0
release
end

#org @First
= You lost money.

#org @Second
= Hahaha.

bitelaserkhalif
December 20th, 2013, 09:04 PM
Errm..Thanks for tutorial, most of them is working fine.

WAIT!
I have another question.
First, how to trigger script like in Rocket Hideout in Mahogany Town?(This meant stepping on scripted title will trigger wild pokemon battle.)
I had tried using script generator, and the game frozen even i had inserted release all, why?

Second, How to creating Interact to battle?(wild battle like articuno on FRLG, and it's on pokemon emerald; I dont know where is an unused flag ones in pokemon emerald).

TeunCornflakes
January 15th, 2014, 11:37 AM
Hey, tutorials like this are really great and everything, but I just don't know how to put it into the game.
Say, I just want to change what Mom says the first time in FireRed. I know what to write, but how to save it into the ROM?

DealNotTheDevil
April 16th, 2014, 10:59 AM
Hi guys!

Great tutorial!

Anyway,
I've found out how to change music for any battles I set
(example playsound 0x228 0x228),

But is there any way to change music for random wild battles.

(I intend to use to "load map" script).

I couldn't find it, even after using google. Thanks!

ContestTrainer
April 21st, 2014, 03:19 PM
Hey does anyone have any idea on how to fix my script I can't get Ethan to say the start of it and all he does is give me the egg (repetitively if i keep talking to him) and says please take care of it... also how do I get his text to fit in the box, all it does is mush over the first words! (What I want to happen with this is him say these lines msgbox 0x87558A1 msgbox 0x87558DE msgbox 0x8755910 then give egg then say #org 0x8755961 on repeat without saying anything else or giving me the egg)

#org 0x8755880
'-----------------------------------
lock
faceplayer
msgbox 0x87558A1 ' Ethan: O-Oh! Your \v...
msgbox 0x87558DE ' Then why are you her...
msgbox 0x8755910 ' Then take this Egg I...
giveegg 0x74
msgbox 0x8755961 ' Take good care of it...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87558A1
= Ethan: O-Oh! Your \v\h01, right? U-Uh... Hi! U-Um? Are you lost?

#org 0x87558DE
= Then why are you here? Just exploring? Well um...

#org 0x8755910
= Then take this Egg I found, My Mom said it needs to be with a trainer anyways...

#org 0x8755961
= Take good care of it ok? Please vist so I can see it!

~Thank You in advance!~

Christos
April 23rd, 2014, 01:55 AM
Hey does anyone have any idea on how to fix my script I can't get Ethan to say the start of it and all he does is give me the egg (repetitively if i keep talking to him) and says please take care of it... also how do I get his text to fit in the box, all it does is mush over the first words! (What I want to happen with this is him say these lines msgbox 0x87558A1 msgbox 0x87558DE msgbox 0x8755910 then give egg then say #org 0x8755961 on repeat without saying anything else or giving me the egg)

#org 0x8755880
'-----------------------------------
lock
faceplayer
msgbox 0x87558A1 ' Ethan: O-Oh! Your \v...
msgbox 0x87558DE ' Then why are you her...
msgbox 0x8755910 ' Then take this Egg I...
giveegg 0x74
msgbox 0x8755961 ' Take good care of it...
callstd MSG_LOCK ' Built-in lock command
release
end


#org 0x87558A1
= Ethan: O-Oh! Your \v\h01, right? U-Uh... Hi! U-Um? Are you lost?

#org 0x87558DE
= Then why are you here? Just exploring? Well um...

#org 0x8755910
= Then take this Egg I found, My Mom said it needs to be with a trainer anyways...

#org 0x8755961
= Take good care of it ok? Please vist so I can see it!

~Thank You in advance!~

You're going to need a "callstd" command after each msgbox command, otherwise the text won't show.
As for the text, you can use \n, \l and \p to divide it in lines, and boxes, check the first post for more information on that.

Now, for the egg to only be given to you once, you'll have to set a flag after the egg is given, and then check for the flag at the beginning of the script, so that it skips the giveegg part.

For example:
#org 0x800000
lock
faceplayer
checkflag 0x254
if 0x0 goto 0x[your script with a setflag 0x254 command in it]
msgbox 0x[text for the NPC when you talk to him again]
callstd MSG_NORMAL
release
end

The Void
April 23rd, 2014, 02:04 AM
Hi guys!

Great tutorial!

Anyway,
I've found out how to change music for any battles I set
(example playsound 0x228 0x228),

But is there any way to change music for random wild battles.

(I intend to use to "load map" script).

I couldn't find it, even after using google. Thanks!

AdvanceMap has this option in the Header option of any map.

faintster
April 25th, 2014, 12:42 PM
i need help i put followed every tutorial down to the t and when i talk to my person nothing happens it just beeps please help

nevermind i just need to update my programs this is getting easier just take time i guess i really need to
want to get this down

Whitney's Shaymin
April 30th, 2014, 05:22 AM
Hey guys, ive been trying to get a roadblock in the starting town but he won't talk to me. (all I hear is a beep) Here's my script.

#org 0x8740000
'-----------------------------------
#raw 0xFF
lockall
checkflag 0x291
if true jump 0x8740048 ' Flag is set
message 0x8740014 ' I'm sorry, the road ...
showmsg
waitbutton
releaseall
end

#org 0x8740048
'-----------------------------------
message 0x874005C ' I'm sorry, th-\pOh r...
showmsg
waitbutton
fadescreen FADEOUT_WHITE
closemsg
disappear 0x2C
setflag 0x291
fadescreen FADEIN_WHITE
releaseall
end


#org 0x8740014
= I'm sorry, the road is closed\nuntil further notice.

#org 0x874005C
= I'm sorry, th-\pOh right!\nThe construction just finished\lyesterday[.]

Oddball20007
May 23rd, 2014, 10:31 PM
Hello! Its 30 minutes till midnight here and I have had a very busy night, so I'm tired and can't be bothered with looking through pages 2-7 to check and see if this has been answered soooooo...
I use the automatic script generator, now in AdvanceMap there is an offset tab, but the 0x740000, or whatever it comes up with doesn't work in the tab, and when I try and imput something that makes sense to me (Like just 740000 or whatever, I do make sure its the correct numbers when I put it in BTW) It turns into 74000074 or something to that effect. If possible screenshots would be lovely, otherwise can you put it into terms that make it so easy a caveman can do it? (I had to get some sort of reference into my post. :3)

The Void
May 23rd, 2014, 10:50 PM
Hello! Its 30 minutes till midnight here and I have had a very busy night, so I'm tired and can't be bothered with looking through pages 2-7 to check and see if this has been answered soooooo...
I use the automatic script generator, now in AdvanceMap there is an offset tab, but the 0x740000, or whatever it comes up with doesn't work in the tab, and when I try and imput something that makes sense to me (Like just 740000 or whatever, I do make sure its the correct numbers when I put it in BTW) It turns into 74000074 or something to that effect. If possible screenshots would be lovely, otherwise can you put it into terms that make it so easy a caveman can do it? (I had to get some sort of reference into my post. :3)

If you're using the latest version of AdvanceMap, be sure to remove the first two zero's. Also, you should remove '0x' in the offset.

Taconinja
October 1st, 2014, 04:36 AM
Is PKSV still a good option? Whenever I post a thread in the beginners lounge asking for help on a pksv script, no one bothers to look at it, they just tell me "Use XSE it's much better lol" without a reason why.

AriArk
October 12th, 2014, 02:51 AM
How do you make an overworld sprite disappear?
I tried:
disappear 0x1

which didn't work.

Any help?

Percy
October 14th, 2014, 02:30 AM
How do you make an overworld sprite disappear?
I tried:
disappear 0x1

which didn't work.

Any help?

You need to set a flag, and paste the flag to the Person's ID in Advanced Map.

AkameTheBulbasaur
October 16th, 2014, 02:10 PM
Is PKSV still a good option? Whenever I post a thread in the beginners lounge asking for help on a pksv script, no one bothers to look at it, they just tell me "Use XSE it's much better lol" without a reason why.

PKSV is still a perfectly valid option, at least in my opinion. Honestly, after using both, I can't really say that XSE is better. Both of them do the exact same thing, so it really doesn't matter.

On a side note, it really, really, really bugs me when somebody asks for help on a PKSV script and all the answers they get are "OMG!!!1111 Y R U USIN PKSV JUST USE XSE!11111" Seriously people, it's like if somebody had a problem with their iPhone and instead of getting help, people just told them "Get a samsung it's so much better!" because brand loyalty (I guess.)

Personally for me, XSE doesn't work on my computer, so I physically cannot use it. If you can't help with the script because you don't know anything about PKSV, then just don't post. If you don't have anything helpful to say, then just be quiet.

Anyway, rant over. If you need any help with PKSV, you can ask me. I've used PKSV for years now, and I know a pretty good amount on how to use various commands and such.

Haile Selassie IV
November 3rd, 2014, 08:35 AM
I know this script is terribly wrong, but I can't figure out where I screw up. It doesn't move initially, but does set a flag somewhere, only to screw up the movement and text.
The compare playerfacing doesn't seem to work quite well :/

I'm using pksv and a FR ROM.

#dyn 0x740000
#org @start
lock
faceplayer
checkflag 0x1016
if 0x1 jump @try2
checkflag 0x1015
if 0x1 jump @home2
checkflag 0x1010
if 0x1 jump @upreturn
checkflag 0x1011
if 0x1 jump @downsea
checkflag 0x1012
if 0x1 jump @home1
checkflag 0x1013
if 0x1 jump @rightreturn
compare PLAYERFACING UP
if == jump @up
compare PLAYERFACING DOWN
if == jump @down
compare PLAYERFACING LEFT
if == jump @left
compare playerfacing right
if == jump @right
release
end

#org @up
applymovement 0x7 @upmov1
setflag 0x1010
release
end

#org @down
applymovement 0x7 @downmov1
setflag 0x1011
release
end

#org @left
applymovement 0x7 @leftmov1
setflag 0x1012
release
end

#org @right
applymovement 0x7 @rightmov1
setflag 0x1013
release
end

#org @upreturn
compare playerfacing up
if == jump @extraupreturn
applymovement 0x7 @upmov2
clearflag 0x1010
release
end

#org @downsea
compare playerfacing up
if == jump :end
applymovement 0x7 @downmov2
applymovement player @downmov21
msgbox @lure
callstd msg_normal
applymovement 0x7 @downmov3
msgbox @try
callstd msg_yesno
compare LASTRESULT YES
if 0x1 jump @yes
clearflag 0x1011
setflag 0x1016
:end
release
end

#org @try2
msgbox @try
callstd msg_yesno
compare lastresult yes
if 0x1 jump @yes
release
end

#org @yes
msgbox @fail
callstd msg_normal
applymovement 0x7 @downmov4
msgbox @fail2
callstd msg_normal
fadescreen 1
disappear 0x7
disappear 0x11
setflag 0x1014
fadescreen 0
release
end

#org @home1
applymovement 0x7 @leftmov2
clearflag 0x1012
setflag 0x1015
release
end

#org @home2
applymovement 0x7 @leftmov3
msgbox @sleep
callstd msg_normal
clearflag 0x1015
fadescreen 1
disappear 0x7
setflag 0x100b
fadescreen 0
release
end

#org @rightreturn
compare playerfacing right
if == jump @extrarightreturn
applymovement 0x7 @rightmov2
clearflag 0x1013
release
end

#org @extrarightreturn
applymovement 0x7 @rightmov21
clearflag 0x1013
release
end

#org @extraupreturn
applymovement 0x7 @upmov21
clearflag 0x1010
release
end

#org @upmov2
m walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow end

#org @upmov21
m say_? walk_left_vslow walk_right_vslow walk_right_vslow walk_down_vslow walk_down_vslow walk_left_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow end

#org @upmov1
m run_up run_up run_up run_up run_up run_up end

#org @downmov1
m run_down run_down run_down jump_up2 walk_down_vslow walk_down_vslow walk_left_vslow walk_left_vslow walk_down_vslow walk_down_vslow end

#org @downmov2
m walk_down_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_down_vslow walk_left_vslow walk_left_vslow jump_down1 end

#org @downmov21
m walk_down walk_down walk_left walk_left walk_left walk_down walk_left walk_left walk_down end

#org @downmov3
m walk_down_vslow walk_down_vslow walk_down_vslow look_left end

#org @downmov4
m walk_left walk_left end

#org @downnov5
m run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down end

#org @fail
= SLOWPOKE got scared and moved away[.]

#org @fail2
= \c\h01\h08Hehe excellent[.]\pYou're mine!

#org @lure
= \c\h01\h08????: Come here boy, don't be afraid hehe[.]

#org @try
= Maybe SLOWPOKE will notice you\nif you do something.\pThrow a rock?

#org @leftmov1
m walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow end

#org @leftmov2
m walk_left_vslow walk_left_vslow walk_down_vslow walk_down_vslow walk_left_vslow end

#org @leftmov3
m run_left walk_left walk_left_slow walk_left_vslow end

#org @rightmov1
m walk_right_vslow walk_right_vslow walk_down_vslow walk_right_vslow walk_right_vslow end

#org @rightmov2
m say_? say_? say_! walk_left_vslow walk_left_vslow walk_left_vslow walk_right_vslow walk_up_vslow walk_left_vslow say_? walk_left_vslow say_! end

#org @rightmov21
m walk_down_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow end

#org @sleep
= SLOWPOKE fell asleep[.]\pBetter grab it!

FBI agent
November 3rd, 2014, 01:28 PM
I know this script is terribly wrong, but I can't figure out where I screw up. It doesn't move initially, but does set a flag somewhere, only to screw up the movement and text.
The compare playerfacing doesn't seem to work quite well :/

I'm using pksv and a FR ROM.

#dyn 0x740000
#org @start
lock
faceplayer
checkflag 0x1016
if 0x1 jump @try2
checkflag 0x1015
if 0x1 jump @home2
checkflag 0x1010
if 0x1 jump @upreturn
checkflag 0x1011
if 0x1 jump @downsea
checkflag 0x1012
if 0x1 jump @home1
checkflag 0x1013
if 0x1 jump @rightreturn
compare PLAYERFACING UP
if == jump @up
compare PLAYERFACING DOWN
if == jump @down
compare PLAYERFACING LEFT
if == jump @left
compare playerfacing right
if == jump @right
release
end

#org @up
applymovement 0x7 @upmov1
setflag 0x1010
release
end

#org @down
applymovement 0x7 @downmov1
setflag 0x1011
release
end

#org @left
applymovement 0x7 @leftmov1
setflag 0x1012
release
end

#org @right
applymovement 0x7 @rightmov1
setflag 0x1013
release
end

#org @upreturn
compare playerfacing up
if == jump @extraupreturn
applymovement 0x7 @upmov2
clearflag 0x1010
release
end

#org @downsea
compare playerfacing up
if == jump :end
applymovement 0x7 @downmov2
applymovement player @downmov21
msgbox @lure
callstd msg_normal
applymovement 0x7 @downmov3
msgbox @try
callstd msg_yesno
compare LASTRESULT YES
if 0x1 jump @yes
clearflag 0x1011
setflag 0x1016
:end
release
end

#org @try2
msgbox @try
callstd msg_yesno
compare lastresult yes
if 0x1 jump @yes
release
end

#org @yes
msgbox @fail
callstd msg_normal
applymovement 0x7 @downmov4
msgbox @fail2
callstd msg_normal
fadescreen 1
disappear 0x7
disappear 0x11
setflag 0x1014
fadescreen 0
release
end

#org @home1
applymovement 0x7 @leftmov2
clearflag 0x1012
setflag 0x1015
release
end

#org @home2
applymovement 0x7 @leftmov3
msgbox @sleep
callstd msg_normal
clearflag 0x1015
fadescreen 1
disappear 0x7
setflag 0x100b
fadescreen 0
release
end

#org @rightreturn
compare playerfacing right
if == jump @extrarightreturn
applymovement 0x7 @rightmov2
clearflag 0x1013
release
end

#org @extrarightreturn
applymovement 0x7 @rightmov21
clearflag 0x1013
release
end

#org @extraupreturn
applymovement 0x7 @upmov21
clearflag 0x1010
release
end

#org @upmov2
m walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow end

#org @upmov21
m say_? walk_left_vslow walk_right_vslow walk_right_vslow walk_down_vslow walk_down_vslow walk_left_vslow walk_down_vslow walk_down_vslow walk_down_vslow walk_down_vslow end

#org @upmov1
m run_up run_up run_up run_up run_up run_up end

#org @downmov1
m run_down run_down run_down jump_up2 walk_down_vslow walk_down_vslow walk_left_vslow walk_left_vslow walk_down_vslow walk_down_vslow end

#org @downmov2
m walk_down_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_down_vslow walk_left_vslow walk_left_vslow jump_down1 end

#org @downmov21
m walk_down walk_down walk_left walk_left walk_left walk_down walk_left walk_left walk_down end

#org @downmov3
m walk_down_vslow walk_down_vslow walk_down_vslow look_left end

#org @downmov4
m walk_left walk_left end

#org @downnov5
m run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down run_down end

#org @fail
= SLOWPOKE got scared and moved away[.]

#org @fail2
= \c\h01\h08Hehe excellent[.]\pYou're mine!

#org @lure
= \c\h01\h08????: Come here boy, don't be afraid hehe[.]

#org @try
= Maybe SLOWPOKE will notice you\nif you do something.\pThrow a rock?

#org @leftmov1
m walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow end

#org @leftmov2
m walk_left_vslow walk_left_vslow walk_down_vslow walk_down_vslow walk_left_vslow end

#org @leftmov3
m run_left walk_left walk_left_slow walk_left_vslow end

#org @rightmov1
m walk_right_vslow walk_right_vslow walk_down_vslow walk_right_vslow walk_right_vslow end

#org @rightmov2
m say_? say_? say_! walk_left_vslow walk_left_vslow walk_left_vslow walk_right_vslow walk_up_vslow walk_left_vslow say_? walk_left_vslow say_! end

#org @rightmov21
m walk_down_vslow walk_left_vslow walk_left_vslow walk_left_vslow walk_left_vslow end

#org @sleep
= SLOWPOKE fell asleep[.]\pBetter grab it!


after every applymovement line, insert the line "pauseevent 0x0".
Also you don't need:
compare playerfacing right
if == jump @right
replace it with just "jump @right".

Haile Selassie IV
November 4th, 2014, 07:11 AM
Ah thanks, it worked. I've never had any trouble with movements and not using pauseevent. Thanks!