• 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?".
  • 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.

Creating custom Move-Tutors

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015


Creating custom Move-Tutors


Introduction

Here is another small research-thingie which I want to share with the community.
It's nothing special, but could still make a hack better, such as paying some money
or shards (like in DPP) for specific attacks. I will also provide a little script which contains
all extra-stuff like multichoice-boxes etc., but don't copy it 1:1 please! =)

Let's get started!

We need approximately three tools. A hex-editor, Advance-Map to insert the script and
XSE (eXtreme Script Editor) to create and insert the script. We will do the hex-editing first.

Open your hex-editor, load your ROM and jump to the offset 0x459B60.
On the first view, these bytes look very random. But they aren't.
Firstly, download the attack-list on my dropbox.
Compare some of the bytes in our ROM with some attacks in the list.
[05]..[0E]..[19].. these look like Mega Punch, Swords Dance and Mega Kick!!

But as you might noticed, the attacks are stored in half-words.
Thats logical, as there are attacks over the value 0xFF and must be stored in a byte-reversed half-word =)
The value 0x5 or 0x0005 (its the same) will get [05][00] then. 0xE will get [0E][00], etc.B

And what do we do with the attacks over 0xFF, such as 0x108, Focus-Punch?
Well, we do the same as above. 0x108 is the same as 0x0108.
0108 -> [01][08] and we reverse it -> [08][01].

So, if we insert 0801 instead of 0500 for example, the move-tutor with Index 0 will teach your
Pokémon Focus-Punch.

Spoiler:


You might as well complain about the space you are provided for the move-tutors.
Well, we simply repoint the table for more space.
Go to the offset 0x120BE4 and you see a pointer located there: [60][9B][45][08]
This pointer points to our previous offset 0x459B60 which we want to change of course!

For this tutorial I will take 0xA00000 as our new table, for example.
[A0][00][00] -> [00][00][A0]-[08].
Now we replace the string 609B4508 with our new string 0000A008.

Spoiler:


Setting up our table

For my tutorial, as I previously said, I will use the offset 0xA00000 for the new table.
Go there with your hex-editor and you will just see 0xFF bytes, which means free space.

The structure of the Move-Tutor table is actually damn-easy.

: [Attack_Word][Attack_Word][Attack_Word] ... ... :
: [Attack_Word][Attack_Word][Attack_Word] ... ... :

Yeah, it's just the bytereversed attacks, one after another.
Let's say I want headbutt as Index 0 and Eruption as Index 1.
We take our attack-list and we see:

Headbutt 0x1D ------ [1D][00]
Eruption 0x11C ------ [1C][01]

Spoiler:


Making the script!

The script is actually not as hard as many people might expect.
Basically you need:

setvar 0x8005 0x[Index]
special 0x18D
waitstate


If we insert this, it can be kinda .. ugly.
We should add some smooth fadescreens and cancel-checks.
What is a cancel check? When you cancel the move-tutor, the special returns 0x0 in LASTRESULT.
I will just show you an example of my move-tutor script in my hack.

Spoiler:

As you can see, if you press B or the Pokémon cannot learn the attack, it will jump
to @cancel. If everything is fine, it will jump to @pay_item.
Yeah.. and that basically was it! =D
Have fun and good luck with your hack!

~epic
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
This looks pretty good.

My question however is, by expanding this table to have more moves, how do you
create the compatibility.

For example if Gunk Shot is the new tutor move, how would you make it realise that
Charizard cannot learn it?
 

ShyRayq

Unprofessional Unprofessional
1,856
Posts
16
Years
  • Seen Apr 2, 2024
This looks pretty good.

My question however is, by expanding this table to have more moves, how do you
create the compatibility.

For example if Gunk Shot is the new tutor move, how would you make it realise that
Charizard cannot learn it?

I believe you would have to repoint and expand the compatibility table. It's stored in 16 bits (?) or 2 bytes I believes. So if you have more than 16 moves, you're gonna have to expand and repoint. Which would probably be a massive pain, ruining compatibility with some tools.
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Dude, when special 0x18D is called, and you want to teach Charizard, dunno, Surf.
It just won't work because the special accesses to a table of learnable moves, where
100 tools for editing exist, and if Charizard hasn't a specific byte, it can't learn the move.

However, if you want to have more than 16 attacks, learnable by move tutors, you
must simply repoint the table to free space where you can make up to 256 (0xFF) slots.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Dude, when special 0x18D is called, and you want to teach Charizard, dunno, Surf.
It just won't work because the special accesses to a table of learnable moves, where
100 tools for editing exist, and if Charizard hasn't a specific byte, it can't learn the move.

However, if you want to have more than 16 attacks, learnable by move tutors, you
must simply repoint the table to free space where you can make up to 256 (0xFF) slots.

Yeah that's what I was asking thanks, I knew there was a compatibility table for existing tutor moves, I just didn't realise it could be expanded so easily.

I believe you would have to repoint and expand the compatibility table. It's stored in 16 bits (?) or 2 bytes I believes. So if you have more than 16 moves, you're gonna have to expand and repoint. Which would probably be a massive pain, ruining compatibility with some tools.

Yeah it looks like an odd structure, it seems that each Pokemon has 2 bytes, where if every move is selected the value becomes FF FF (although that breaks, so more like FF 7F). It doesn't look that easy to change in all honesty without altering the actual routine.
 
Last edited:

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
Move tutor compatibilities are located at x459B80 (right after the tutor moves themselves actually), and are just a series of two-byte bitmaps, one for each mon. As such, having more than 16 tutors while retaining reasonable compatibilities isn't feasible without editing the ASM involved (although I can't imagine it'd be very hard). You would break support for all one of the tutor-editing tools I know of though.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Move tutor compatibilities are located at x459B80 (right after the tutor moves themselves actually), and are just a series of two-byte bitmaps, one for each mon. As such, having more than 16 tutors while retaining reasonable compatibilities isn't feasible without editing the ASM involved (although I can't imagine it'd be very hard). You would break support for all one of the tutor-editing tools I know of though.

Yeah there seem to be two routines involved specifically, one that loads the list of moves, and one that checks compatibility, this may mean, that it could be possible to check an extra condition and if that's the case load a separate tutor and compatibility table, this would seem easier to me than rewriting the move compatibility table entirely. Though I'll give both a go in the future.
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
I may support this too and expanding the tutorial.
But if you want to teach specific moves for a specific Pokémon (like the super attacks in DPP) you will be fine with this already.
 
35
Posts
10
Years
  • Age 37
  • Seen Jul 27, 2016
so with this tuto i can make more that the 16th move tutors, can't i? or is tu change what the already (or maybe a new ones) move tutors can teach to pokemons (wich is only 15 in FR).
 

haven1433

Modder / Programmer
42
Posts
10
Years
  • Age 35
  • Seen Jan 16, 2024
Great tutorial, gives me exactly what I need for a small number of tutors. I assume the "100 tools to edit compatibility" comment is incorrect, and the "2 bytes per pokemon limits to 16 tutors" forms a hard limit. But it does leave me wondering - given that one of the tutors teaches you 1 of 3 moves, how does compatibility work for that one? Is it possible to do something similar to combine multiple moves into a single tutor?
 
242
Posts
6
Years
  • Age 30
  • Seen Apr 3, 2023
Sorry for bumping this, but I need help with changing tutor moves in my game. I can change the tutor move, but I don't know how to make it so the new move is learned by the appropiate Pokemon. How do I do this? I tried the 'change move tutor' tool in PGE, but it only changes the move, not the compatible Pokemon for the move.

Move tutor compatibilities are located at x459B80 (right after the tutor moves themselves actually), and are just a series of two-byte bitmaps, one for each mon. As such, having more than 16 tutors while retaining reasonable compatibilities isn't feasible without editing the ASM involved (although I can't imagine it'd be very hard). You would break support for all one of the tutor-editing tools I know of though.

This helps a little but I don't understand how to find the bitmaps.
 
192
Posts
5
Years
The tutorial works, but in my case i inserted more move tutors ( a total of 65)
I really change the pointers using the examples in the tutorial, it works fine to me.
But in the move tutor compatibility stuck the feature. I'm using PGE to do this, without errors
The tool loads the new compatibility table, but the game loads the old table. How to fix this?
The only thing that prevents the tutorial from being extremely effective is this: Show how to expand the compatibility table if I increase the number of tutors
PS: Oh, and a script from a new tutor would go very well.
 
Last edited:

Black_Fragrant

Finishing up my Firegold
101
Posts
5
Years
The tutorial works, but in my case i inserted more move tutors ( a total of 65)
I really change the pointers using the examples in the tutorial, it works fine to me.
But in the move tutor compatibility stuck the feature. I'm using PGE to do this, without errors
The tool loads the new compatibility table, but the game loads the old table. How to fix this?
The only thing that prevents the tutorial from being extremely effective is this: Show how to expand the compatibility table if I increase the number of tutors
PS: Oh, and a script from a new tutor would go very well.

i am also facing the same problem, have you solved it? i would appreciate some help
 
192
Posts
5
Years
The key is simply. Just use HexManiacEditor! I will create a tutorial right now about you expand your move tutor table and tutor compatibility.
 
Back
Top