Jump to content
Sign in to follow this  
Tensho

Gen 6 (XY) Trainer Editor

Recommended Posts

Hey there,

So I noticed in the latest commit that the Trainer Editor (specifically the "Current Appearance") tab had been updated a bit.

I was testing some changes I could make onto the female trainer in XY, and I found out that I could change some of the makeup values so that it would stay permanent outside of the PR Video Makeup Room.

This is wonderful news to me, however I keep running into a problem with the "Lips" option. Every other make up option has a color setting tied to it as well, except for the Lips. Ultimately I'm looking to change the lipstick color to the "Wine Red" option, however any value above "1" resets the trainer appearance to the stock female character option available as one of the three options at the start of the game.

I was wondering if anyone else has had any success in changing the lip color? Perhaps the next commit of PkHex could include a lip color option as well? I'll add a screenshot of the menu Im talking about, as well as the values which are allowed to be changed.

 

Thanks! 

Makeup Options XY.PNG

Share this post


Link to post
Share on other sites

Per the source code, the "Lips" value is two bits (0-3), however, if invalid values cause the game to panic and reset, there's nothing the Save Editor can do to avoid that:


    public class Fashion6Female : TrainerFashion6
    {
        public Fashion6Female(byte[] data, int offset)
            : base(data, offset) { }

        public uint Version  { get => GetBits(data0,  0, 3); set => data0 = SetBits(data0,  0, 3, value); }
        public uint Model    { get => GetBits(data0,  3, 3); set => data0 = SetBits(data0,  3, 3, value); }
        public uint Skin     { get => GetBits(data0,  6, 2); set => data0 = SetBits(data0,  6, 2, value); }
        public uint HairColor{ get => GetBits(data0,  8, 3); set => data0 = SetBits(data0,  8, 3, value); }
        public uint Hat      { get => GetBits(data0, 11, 6); set => data0 = SetBits(data0, 11, 6, value); }
        public uint Front    { get => GetBits(data0, 17, 3); set => data0 = SetBits(data0, 17, 3, value); }
        public uint Hair     { get => GetBits(data0, 20, 4); set => data0 = SetBits(data0, 20, 4, value); }
        public uint Face     { get => GetBits(data0, 24, 3); set => data0 = SetBits(data0, 24, 3, value); }
        public uint Arms     { get => GetBits(data0, 27, 2); set => data0 = SetBits(data0, 27, 2, value); }
        public uint _0       { get => GetBits(data0, 29, 2); set => data0 = SetBits(data0, 29, 2, value); }
        public uint Unused0  { get => GetBits(data0, 31, 1); set => data0 = SetBits(data0, 31, 1, value); }

        public uint Top      { get => GetBits(data1,  0, 6); set => data1 = SetBits(data1,  0, 6, value); }
        public uint Legs     { get => GetBits(data1,  6, 7); set => data1 = SetBits(data1,  6, 7, value); }
        public uint OnePiece { get => GetBits(data1, 13, 4); set => data1 = SetBits(data1, 13, 4, value); }
        public uint Socks    { get => GetBits(data1, 17, 5); set => data1 = SetBits(data1, 17, 5, value); }
        public uint Shoes    { get => GetBits(data1, 22, 6); set => data1 = SetBits(data1, 22, 6, value); }
        public uint _1       { get => GetBits(data1, 28, 2); set => data1 = SetBits(data1, 28, 2, value); }
        public uint Unused1  { get => GetBits(data1, 30, 2); set => data1 = SetBits(data1, 30, 2, value); }

        public uint Bag           { get => GetBits(data2,  0, 5);      set => data2 = SetBits(data2,  0, 5, value); }
        public uint AHat          { get => GetBits(data2,  5, 5);      set => data2 = SetBits(data2,  5, 5, value); }
        public bool Contacts      { get => GetBits(data2, 10, 1) == 1; set => data2 = SetBits(data2, 10, 1, value ? 1u : 0); }
        public uint Mascara       { get => GetBits(data2, 11, 2);      set => data2 = SetBits(data2, 11, 2, value); }
        public uint EyeShadow     { get => GetBits(data2, 13, 2);      set => data2 = SetBits(data2, 13, 2, value); }
        public uint Cheek         { get => GetBits(data2, 15, 2);      set => data2 = SetBits(data2, 15, 2, value); }
        public uint Lips          { get => GetBits(data2, 17, 2);      set => data2 = SetBits(data2, 17, 2, value); }
        public uint ColorContacts { get => GetBits(data2, 19, 3);      set => data2 = SetBits(data2, 19, 3, value); }
        public uint ColorMascara  { get => GetBits(data2, 22, 3);      set => data2 = SetBits(data2, 22, 3, value); }
        public uint ColorEyeshadow{ get => GetBits(data2, 25, 3);      set => data2 = SetBits(data2, 25, 3, value); }
        public uint ColorCheek    { get => GetBits(data2, 28, 3);      set => data2 = SetBits(data2, 28, 3, value); }
        public uint Unused2       { get => GetBits(data2, 31, 1);      set => data2 = SetBits(data2, 31, 1, value); }
    }

 

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Kaphotics said:

Per the source code, the "Lips" value is two bits (0-3), however, if invalid values cause the game to panic and reset, there's nothing the Save Editor can do to avoid that:



    public class Fashion6Female : TrainerFashion6
    {
        public Fashion6Female(byte[] data, int offset)
            : base(data, offset) { }

        public uint Version  { get => GetBits(data0,  0, 3); set => data0 = SetBits(data0,  0, 3, value); }
        public uint Model    { get => GetBits(data0,  3, 3); set => data0 = SetBits(data0,  3, 3, value); }
        public uint Skin     { get => GetBits(data0,  6, 2); set => data0 = SetBits(data0,  6, 2, value); }
        public uint HairColor{ get => GetBits(data0,  8, 3); set => data0 = SetBits(data0,  8, 3, value); }
        public uint Hat      { get => GetBits(data0, 11, 6); set => data0 = SetBits(data0, 11, 6, value); }
        public uint Front    { get => GetBits(data0, 17, 3); set => data0 = SetBits(data0, 17, 3, value); }
        public uint Hair     { get => GetBits(data0, 20, 4); set => data0 = SetBits(data0, 20, 4, value); }
        public uint Face     { get => GetBits(data0, 24, 3); set => data0 = SetBits(data0, 24, 3, value); }
        public uint Arms     { get => GetBits(data0, 27, 2); set => data0 = SetBits(data0, 27, 2, value); }
        public uint _0       { get => GetBits(data0, 29, 2); set => data0 = SetBits(data0, 29, 2, value); }
        public uint Unused0  { get => GetBits(data0, 31, 1); set => data0 = SetBits(data0, 31, 1, value); }

        public uint Top      { get => GetBits(data1,  0, 6); set => data1 = SetBits(data1,  0, 6, value); }
        public uint Legs     { get => GetBits(data1,  6, 7); set => data1 = SetBits(data1,  6, 7, value); }
        public uint OnePiece { get => GetBits(data1, 13, 4); set => data1 = SetBits(data1, 13, 4, value); }
        public uint Socks    { get => GetBits(data1, 17, 5); set => data1 = SetBits(data1, 17, 5, value); }
        public uint Shoes    { get => GetBits(data1, 22, 6); set => data1 = SetBits(data1, 22, 6, value); }
        public uint _1       { get => GetBits(data1, 28, 2); set => data1 = SetBits(data1, 28, 2, value); }
        public uint Unused1  { get => GetBits(data1, 30, 2); set => data1 = SetBits(data1, 30, 2, value); }

        public uint Bag           { get => GetBits(data2,  0, 5);      set => data2 = SetBits(data2,  0, 5, value); }
        public uint AHat          { get => GetBits(data2,  5, 5);      set => data2 = SetBits(data2,  5, 5, value); }
        public bool Contacts      { get => GetBits(data2, 10, 1) == 1; set => data2 = SetBits(data2, 10, 1, value ? 1u : 0); }
        public uint Mascara       { get => GetBits(data2, 11, 2);      set => data2 = SetBits(data2, 11, 2, value); }
        public uint EyeShadow     { get => GetBits(data2, 13, 2);      set => data2 = SetBits(data2, 13, 2, value); }
        public uint Cheek         { get => GetBits(data2, 15, 2);      set => data2 = SetBits(data2, 15, 2, value); }
        public uint Lips          { get => GetBits(data2, 17, 2);      set => data2 = SetBits(data2, 17, 2, value); }
        public uint ColorContacts { get => GetBits(data2, 19, 3);      set => data2 = SetBits(data2, 19, 3, value); }
        public uint ColorMascara  { get => GetBits(data2, 22, 3);      set => data2 = SetBits(data2, 22, 3, value); }
        public uint ColorEyeshadow{ get => GetBits(data2, 25, 3);      set => data2 = SetBits(data2, 25, 3, value); }
        public uint ColorCheek    { get => GetBits(data2, 28, 3);      set => data2 = SetBits(data2, 28, 3, value); }
        public uint Unused2       { get => GetBits(data2, 31, 1);      set => data2 = SetBits(data2, 31, 1, value); }
    }

 

Oh I see.

I've noticed something else as well. If I try to enter a value above 3 (lets say 4 in this instance), it resets to 0.

However, if I enter in the value 5, it changes it to 1.

It does this for every subsequent value after 5 (i.e 6=2, 7=3, 8=0, etc.)

Is there a reason behind why it does that? I'm sorry if this question seems a bit stupid, I don't really understand all of this too much.

Share this post


Link to post
Share on other sites
10 hours ago, Sabresite said:

That is a common technique. It is getting the modulo (remainder from integer division) to keep the values within range.  5 % 3 = 1, 6 % 3 = 2, etc.

Ahh I see. Thank you for your input!

Share this post


Link to post
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
Sign in to follow this  

×