You may have noticed that some specific tiles run scripts without having a green script tile or any sort of event there in Amap. For instance, Pokemon Centre's PC, Stack of books, T.V. in Player's house etc.
So here's a tutorial on how to execute the same effect!
1)
Paste the provided HexTable (at the end) in an 4-aligned free space.
2)
Goto 0x6D1F0 and place there;
Here, XXXXXX is pointer to the HexTable with endian format (reverse).
NOTE: Don't add +1 in the pointer.
The table consists of 256 entries, 4 bytes each, which are pointers to the script that will be executed on interaction.
To find a specific behavior pointer offset; Use the following Formula:
(Calculation is all in hex),
For example;
I wanna use BehaviorByte 0xAF, so 0xAF * 4 = 0x2BC, and suppose I placed the HexTable at 0x990000, so I'll do 0x990000 + 0x2BC = 0x9902BC.
Place pointer to your script or asm there and then you can assign that Behavior Byte to a tile so that it runs the corresponding Script/Routine.
P.S. > You can use Behavior Bytes from 0xA4 - 0xCF and 0xD2 - 0xFF safely as they are unused in a vanilla FR rom.
HexTable: