Setting Scripts on Tiles
View Single Post
October 13th, 2013 (8:52 PM).
Join Date: Mar 2013
Setting Scripts on Tiles
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
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
with another pointer with free space..
In my tutorial, I will use the offset
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
But keep in mind, that we must use
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
I want to make another Tile-Script.
This time, I use
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
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.. ^.^
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
(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
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..
View Public Profile
Find all posts by ep!c
Find threads started by ep!c