The PokéCommunity Forums

The PokéCommunity Forums (
-   Tools, Tutorials & Resources (
-   -   Tutorial Setting Scripts on Tiles (

ep!c October 13th, 2013 8:52 PM

Setting Scripts on Tiles
Setting Scripts on Tiles

Hello everyone. :)
Today I gonna show you, how to set scripts on tiles and how to expand the table up to FF.
I'm sure you all know these behaviour bytes in the block editor of AdvanceMap.
We're gonna edit the behaviour bytes 0x81 to 0xFF.

Expanding the table

Open your hex-editor and go to the offset 0x06D244.
There is a pointer, which points to the scripts from tiles 0x81 to 0x8F.
As we want more than just 15 Scripts, we repoint this table.
Replace the pointer at 0x06D244 with another pointer with free space..

In my tutorial, I will use the offset 0xA60000 as new table-offset.

Setting up the table

Now we need to write our scripts, all next to each other at the table.
For example, I want to make a script on behaviour-byte 0x81.
Then I have to put this script FIRST in the table.
The SECOND is 0x82, the THIRD 0x83 ... etc.
Funny fact: These scripts must be next to each other without FF byte between them!

Open your XSE-Editor and load your ROM.
Write your script, for example, like this:

As dynamic offset for textes, applymovements etc we use 0xA80000.
But keep in mind, that we must use #org 0xA60000 and not a dynamic expression
like "#org @start"!

Compile your Script and open your hex-editor once again.
Jump again to position A60000 and see what changed..

Yeah, this is our Script, beginning with 0x23, the callasm command.
Now look after the script. The free space begins again at 0xA60010.
I want to make another Tile-Script.
This time, I use 0xA60010 as my starting offset...

Now reopen the ROM-file in your hex-editor and we again see what changed.

Right after our 0x81-Script, we made our 0x82-Script!
The free space begins at 0xA60019 and as you might guess, this is your next
Script-Offset for the 0x83-behaviour-byte.
I'm sorry that you must always reopen your file in the hexeditor and look which
script-offset you have to use next.. ^.^

Whats left..?

Using AdvanceMap for setting behaviour-bytes

So, open AdvanceMap and click on this purple puzzle picture.
Now you're in the block-editor.
Select the tile, which you want to set the behaviour-byte on.

I want to set my Tree-tile to a script.
Normally I would use a headbutt-script, but.. whatever ^.^
Look at the marked thing on your right.
These are the behaviour bytes.
For example, I want to set my first script on this tile, means 0x81.


(sorry that i made the screen wrong.. I inserted 0x81 of course.^^)

Save your file in AdvanceMap and..

Testing the result in VBA or No$GBA

Open your favourite emulator and load your ROM.
Now go to a Map, where this tile is on, and click the A-button.

Yay, we got it working :)

If you want to make requests for other ROMs or just have a problem/question
write it in this tutorial thread, please, and don't write me PMs..


AntiRellik1 October 14th, 2013 10:26 PM

This is very interesting. Have you located the script for Surf? Since all water tiles are surfable... I'm looking for a way to enable surf without a badge.

ep!c October 15th, 2013 2:20 AM

Hey, thx for this request.
Today I will search for surf and tomorrow I might tell you how to remove
the need of a badge.

AntiRellik1 October 15th, 2013 6:51 PM


Originally Posted by ep!c (Post 7883206)
Hey, thx for this request.
Today I will search for surf and tomorrow I might tell you how to remove
the need of a badge.

Thanks a lot. I'm also looking into it, but so far nothing.

Pinkish Purple October 15th, 2013 11:33 PM

So this tutorial can work with rock climb right?

GoGoJJTech October 16th, 2013 2:49 AM


Originally Posted by Pinkish Purple (Post 7884769)
So this tutorial can work with rock climb right?

You would probably need a script for each tile of rock climb since all rock climbs have a different amount of rocks

ep!c October 16th, 2013 4:15 AM

Nope, as there is a variable, where the player-facing is stored. :)
-> You need only 1 script with 4 different checks!

AntiRellik1 October 16th, 2013 7:43 PM


Originally Posted by ep!c (Post 7885012)
Nope, as there is a variable, where the player-facing is stored. :)
-> You need only 1 script with 4 different checks!

Have you discovered anything about surf? :) I haven't had the time to poke around with the rom, I was thinking of testing a bunch of checkflags to see if I could nail the one for surf. Maybe I'll find something over the weekend :\

loki123 October 26th, 2013 7:59 PM

hey dude i couldnt get this to work cani PM u?

M.L November 4th, 2013 10:34 AM

This is a great way to incorporate mini games aswell as other things in the game thanx ;)

kearnseyboy6 November 14th, 2013 1:35 AM

Unfortunately this doesn't work with JPAN's hacked engine since he removed and moved most tile behaviours :(

ep!c November 14th, 2013 5:13 AM

Researching JPANs new tile-behaviours should be no problem..
Maybe I develop JPANs engine too, when I have more free time.

awipe1 December 3rd, 2013 11:20 PM

Hey just curious do you know how to edit previous Behaviour bytes? Because I need to change almost all of them! :p

ep!c December 4th, 2013 11:51 PM

Yes of course thats possible:
Go to 0x06D244 and check the original pointer there.
It is: 06 76 1A 08.
[06][76][1A] -> [1A][76][06]
Go to the offset 0x1A7606 in your hex-editor and you will notice always the same structure:
msgbox @text;callstd 3;end =)

vongerbys10 December 19th, 2013 9:39 PM

How can I make a script tile works?
When I step on it. It works but its work again and again.

ep!c December 19th, 2013 10:04 PM

Script tiles aren't really related to this tutorial, as this tutorial is only useful for scripts on specific graphics, like a tree for headbutt for example, so you musn't make 100 signposts :D

bitelaserkhalif December 30th, 2013 3:13 PM

Is this tutorial also works for PKSV, but with different script?

ep!c December 30th, 2013 9:26 PM

You can use all script-editors for your script, just be sure that your start-offset isnt dynamic.

All times are GMT -8. The time now is 12:19 PM.

Like our Facebook Page Follow us on Twitter © 2002 - 2015 The PokéCommunity™,
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / Poké
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2015.