ep!c
Banned
- 124
- Posts
- 12
- Years
- Seen Jan 4, 2015
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.
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.
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..?
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..
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tutlpakr.png)
In my tutorial, I will use the offset 0xA60000 as new table-offset.
Setting up the table
Then I have to put this script FIRST in 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.
For example, I want to make a script on behaviour-byte 0x81.
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:
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut1jazog.png)
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..
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut2oya6i.png)
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...
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut3r3bhr.png)
Now reopen the ROM-file in your hex-editor and we again see what changed.
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut4byb1e.png)
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..
Now you're in the block-editor.
Select the tile, which you want to set the behaviour-byte on.
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut52mbxi.png)
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.
Spoiler:
(sorry that i made the screen wrong.. I inserted 0x81 of course.^^)
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut60axzu.png)
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..
Gl&Hf!
Now go to a Map, where this tile is on, and click the A-button.
Spoiler:
![[PokeCommunity.com] Setting Scripts on Tiles [PokeCommunity.com] Setting Scripts on Tiles](https://abload.de/img/tut7atxn3.png)
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..
Gl&Hf!