• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Setting Scripts on Tiles

ep!c

Banned
124
Posts
11
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.

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..

Spoiler:


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:

Spoiler:


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:


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:


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

Spoiler:


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.

Spoiler:


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:


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.

Spoiler:


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!
 
36
Posts
10
Years
  • Age 32
  • Seen Jan 2, 2014
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

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
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.
 

socko

[i]VERY ANGER!!![/i]
361
Posts
11
Years
  • Age 25
  • Seen May 18, 2020
So this tutorial can work with rock climb right?
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Nope, as there is a variable, where the player-facing is stored. :)
-> You need only 1 script with 4 different checks!
 
36
Posts
10
Years
  • Age 32
  • Seen Jan 2, 2014
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 :\
 

M.L

Invisible
761
Posts
13
Years
  • Seen Dec 21, 2017
This is a great way to incorporate mini games aswell as other things in the game thanx ;)
 

kearnseyboy6

Aussie's Toughest Mudder
300
Posts
15
Years
  • Seen Jun 22, 2019
Unfortunately this doesn't work with JPAN's hacked engine since he removed and moved most tile behaviours :(
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Researching JPANs new tile-behaviours should be no problem..
Maybe I develop JPANs engine too, when I have more free time.
 
215
Posts
11
Years
  • Seen Jul 14, 2020
Hey just curious do you know how to edit previous Behaviour bytes? Because I need to change almost all of them! :p
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
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:
[0F][00][Pointer][03][02]
msgbox @text;callstd 3;end =)

 
27
Posts
10
Years
  • Seen May 23, 2015
How can I make a script tile works?
When I step on it. It works but its work again and again.
 
Last edited:

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
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
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
You can use all script-editors for your script, just be sure that your start-offset isnt dynamic.
 
Back
Top