Jump to content

Tool Request - Pokemon Scouted Trainer Editor (Sun and Moon)


Recommended Posts

Hey! So I thought of an idea for a tool that players can use for Pokemon Sun and Moon.  You know how you can scout trainers at the Battle Tree? Well, I'd like to know if someone can make a tool that allows the player to modify the scouted trainer's Pokemon but only the ones they already added after the program reads the player's save data,. For example, if I opened the program and it reads my data, it'll only show the trainers that I scouted as you can see in the picture attached to this message but you can change their Pokemon to whatever Pokemon they use at the Battle Tree.

 

If you don't know all of the trainers, you can find the trainers from the battle tree from Serebii.net and search through the Trainer Catalogue. 

https://www.serebii.net/sunmoon/battletree.shtml

So if you're interested, please let me know. I'd like to make different Pokemon combinations.

Thank you!

 

 

DSC_0026.JPG

Link to comment
Share on other sites

From PKHeX's source code, the internal name of this Save Block is BattleInstSave:

/* 32 */ BattleTree     = 0x6B200;  // [1FC]    BattleInstSave

0x6B200 is the offset within the save file, 0x1FC is the total length of the save chunk.

0Q6ghhy.png

IsExistScoutTrainerData:

signed int __fastcall Savedata::BattleInstSave::IsExistScoutTrainerData(int a1, int a2)
{
  unsigned int v2; // r2@1
  int v3; // r3@4
  int v4; // r0@5
  signed int result; // r0@9

  v2 = a2 - 0xFFFF;
  if ( a2 != 0xFFFF )
    v2 = 0;
  if ( a2 == 0xFFFF )
    goto LABEL_12;
  while ( 1 )
  {
    v3 = a1 + 2 * v2;
    if ( *(v3 + 40) == a2 )
    {
      v4 = v2;
      goto LABEL_8;
    }
    if ( *(v3 + 42) == a2 )
      break;
    v2 += 2;
    if ( v2 >= 0x32 )
      goto LABEL_12;
  }
  v4 = (v2 + 1);
LABEL_8:
  if ( v4 == 50 )
LABEL_12:
    result = 0;
  else
    result = 1;
  return result;
}

IsFullScoutTrainerData:

_BOOL4 __fastcall Savedata::BattleInstSave::IsFullScoutTrainerData(int a1)
{
  unsigned int v1; // r1@1
  int v2; // r3@2
  signed __int16 v3; // r0@3

  v1 = 0;
  do
  {
    v2 = a1 + 2 * v1;
    if ( *(v2 + 0x28) == 0xFFFF )
    {
      v3 = v1;
      return v3 == 0x32;
    }
    if ( *(v2 + 0x2A) == 0xFFFF )
    {
      v3 = v1 + 1;
      return v3 == 0x32;
    }
    v1 += 2;
  }
  while ( v1 < 0x32 );
  v3 = 0x32;
  return v3 == 0x32;
}

Looks like 50 entries (2 bytes per?).

 

Hopefully this helps.

Link to comment
Share on other sites

2 hours ago, Kaphotics said:

From PKHeX's source code, the internal name of this Save Block is BattleInstSave:


/* 32 */ BattleTree     = 0x6B200;  // [1FC]    BattleInstSave

0x6B200 is the offset within the save file, 0x1FC is the total length of the save chunk.

0Q6ghhy.png

IsExistScoutTrainerData:


signed int __fastcall Savedata::BattleInstSave::IsExistScoutTrainerData(int a1, int a2)
{
  unsigned int v2; // r2@1
  int v3; // r3@4
  int v4; // r0@5
  signed int result; // r0@9

  v2 = a2 - 0xFFFF;
  if ( a2 != 0xFFFF )
    v2 = 0;
  if ( a2 == 0xFFFF )
    goto LABEL_12;
  while ( 1 )
  {
    v3 = a1 + 2 * v2;
    if ( *(v3 + 40) == a2 )
    {
      v4 = v2;
      goto LABEL_8;
    }
    if ( *(v3 + 42) == a2 )
      break;
    v2 += 2;
    if ( v2 >= 0x32 )
      goto LABEL_12;
  }
  v4 = (v2 + 1);
LABEL_8:
  if ( v4 == 50 )
LABEL_12:
    result = 0;
  else
    result = 1;
  return result;
}

IsFullScoutTrainerData:


_BOOL4 __fastcall Savedata::BattleInstSave::IsFullScoutTrainerData(int a1)
{
  unsigned int v1; // r1@1
  int v2; // r3@2
  signed __int16 v3; // r0@3

  v1 = 0;
  do
  {
    v2 = a1 + 2 * v1;
    if ( *(v2 + 0x28) == 0xFFFF )
    {
      v3 = v1;
      return v3 == 0x32;
    }
    if ( *(v2 + 0x2A) == 0xFFFF )
    {
      v3 = v1 + 1;
      return v3 == 0x32;
    }
    v1 += 2;
  }
  while ( v1 < 0x32 );
  v3 = 0x32;
  return v3 == 0x32;
}

Looks like 50 entries (2 bytes per?).

 

Hopefully this helps.

 

Okay. But how do I get it to work in-detail? Like, do I have to use a seperate program or something? If I could get it step-by-step, I'd appreciate it.

Edited by platinumlord1998
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...