Tinkering #1: Changing Breed ID's in a Pet *images for days*
Jul 3, 2016 18:27:56 GMT
ReBOOccaMonkey 💌💘 and StoryMaker like this
Post by 🌠 Aubrey on Jul 3, 2016 18:27:56 GMT
Okay, kiddos. Time to put on those safety goggles and rubber gloves. It's time to tinker!
Today, we will learn how to change the breed ID # INSIDE of your beloved pet. *lightning strikes // mad laughter*
There have been numerous cases of ID changes in breed files when new versions of the breed is created, and sadly the older pet may not work properly with the new file. This can also cause crashing while breeding two pets of the same breed, with diff ID's or just crashing the game totally.
Well, good news! There is a fix! While it's easier to change the ID in the breed file, this may not be an option if you have pets that use BOTH ID's. SO, get yourself a handy-dandy hex editor and start a tinkerin'!
~~ The program I recommend is Hexplorer, and was used for this experiment. This will be for a basic 1st gen. pet. ~~
First, keep a backup of your pet someplace safe. I make a folder on the desktop just for the current project I'm working on and keep all the steps and backups inside here until I'm completely done. I also keep Notepad open, and make notes of what I need to change, and what I've already changed. >> this comes in handy when trying to keep up with all the numbers we've changed, and will need to compensate for >> more on than later....
Now, plop a copy of your pet in the hex editor. What we're looking for are all the instances of the breed ID number. Use the hex editors "find" feature and type in the text " YALP ". This will take you to the section of your pet that the game saves its memories, likes/dislikes, learned tricks, etc. What makes your pet act and behave uniquely is all in this section. (Btw, YALP is "play" spelled backward. xD)
Right above YALP is "p.f.magicpetzIII", that marks the very beginning of the section we'll look through. See all those FF's grouped on the left-hand side? As we scroll down, we'll see more groups of FF's, but what we need specifically is a strand of 00FF FFFF FF00 that is on its own...
The breed ID is 10 bytes after that singular 00FF FFFF FF00. So count 10 bytes after (remember, bytes are always in groups of two, so 00 is one byte, and FF is one byte... etc.), and we see EE03.
This is the breed ID, and I want to point out something quite interesting. If you highlight the whole ID as shown in the image, and look at the bottom where it says "word", this equals 1006. Which is the breed ID in decimal format as it's found in LNZPro for the old breed file.
SO. Now we need to change every instance of EE03 to the new breed ID in hex decimal format. We can get the hex format by looking at the new breed file your pet will use in LNZPro (this is found in RCData > 1003). This shows 997 as a number is E503 in hex:
Okay, easy enough. We only need to change the EE to E5 and the 03 part can stay the same. Let's change the first one in the pet...
Highlight the whole ID again, and check "word" at the bottom.. See how it equals 997?! :D
Now WAIT before you go through and change things all wimbly-nimbly... We first need to find the difference in byte size between EE and E5. Highlight an EE, and look at the bottom at "byte". It should show 238. Now do the same for E5, it's 229.
The difference between 238 and 229 is 9. (additionally, the difference in the two ID numbers is also 9, 1006 - 997 = 9) Neat, how it all adds up, eh? xD
You're thinking, "what does this mean?!". Well, by changing the EE to E5, we're essentially shorting the checksum by 9 for each instance we change. We'll need to keep note of how many EE's we change total and calculate the overall byte difference once we make all the changes. Pull out your handy-dany Notepad and keep a tally of how many EE's are changed.
Change every where you see EE to E5 from the first instance, all the way until you see "pfmagicpetzIII" again. *save at this point, but don't try to open to the pet, it will crash the game!*
For this pet, I found and changed 24 instances of EE, and each change was a difference of 9 bytes, so 24 x 9 = 216.
This means the file size is 216 bytes smaller than what it needs to be in order to work in the game.
So, the best place to compensate for the missing bytes is in the [Paint Ballz] info (Note, anything changed here can be easily fixed by copy/pasting the original [Paint Ballz] section over the edited one in LNZPro). To find this section fast, search for "[Paint". Remember, there are two sets of [Paint Ballz] in your pet; one for the adult LNZ and another for the puppy/kitten. So if you run out of numbers to change in one section, go to the next. c:
We'll need to add in those 216 bytes throughout this section to make the file size right again. We can't simply change one number to equal all 216 bytes, but we can change say, every 1 to a 9 and that will add in 8 bytes each time... we'll only need to change 27 1's to a 9 in order to equal 216. (216 / 8 = 27) Makes sense? :3
We can change any number 1 we see, these are the XYZ coordinates, and again can be fixed later... What I'm seeing here are more 2's than 1's.. so let's change those from 2 to 9. In that case, we'll need to change about 30..
However... 216 / 7 = 30.85...etc.. So.. time for a bit more math:
30 x 7 = 210. and we're still 6 bytes short, so we'll need to change a few more numbers around to compensate for that, but let's start with the 2's first...
Whew! I almost thought I'd run out of 2's xD... Now we just need to change a few more to add up to the remaining 6 bytes. Just above the last 2 I changed, I found a 1! So, change that to a 7, and now everything has been compensated for and the file size is now the same as it was in the beginning. c:
As long as the math is right, every instance found of the breed ID was changed and compensated for, then everything -should- turn out okay. :)
You can save your work, and open your pet in the game.
~~ That wasn't so bad, right?? Join us again for more Tinkerings (...if you dare!) ~~
Happy hexing.
Today, we will learn how to change the breed ID # INSIDE of your beloved pet. *lightning strikes // mad laughter*
There have been numerous cases of ID changes in breed files when new versions of the breed is created, and sadly the older pet may not work properly with the new file. This can also cause crashing while breeding two pets of the same breed, with diff ID's or just crashing the game totally.
Well, good news! There is a fix! While it's easier to change the ID in the breed file, this may not be an option if you have pets that use BOTH ID's. SO, get yourself a handy-dandy hex editor and start a tinkerin'!
~~ The program I recommend is Hexplorer, and was used for this experiment. This will be for a basic 1st gen. pet. ~~
First, keep a backup of your pet someplace safe. I make a folder on the desktop just for the current project I'm working on and keep all the steps and backups inside here until I'm completely done. I also keep Notepad open, and make notes of what I need to change, and what I've already changed. >> this comes in handy when trying to keep up with all the numbers we've changed, and will need to compensate for >> more on than later....
Now, plop a copy of your pet in the hex editor. What we're looking for are all the instances of the breed ID number. Use the hex editors "find" feature and type in the text " YALP ". This will take you to the section of your pet that the game saves its memories, likes/dislikes, learned tricks, etc. What makes your pet act and behave uniquely is all in this section. (Btw, YALP is "play" spelled backward. xD)
Right above YALP is "p.f.magicpetzIII", that marks the very beginning of the section we'll look through. See all those FF's grouped on the left-hand side? As we scroll down, we'll see more groups of FF's, but what we need specifically is a strand of 00FF FFFF FF00 that is on its own...
The breed ID is 10 bytes after that singular 00FF FFFF FF00. So count 10 bytes after (remember, bytes are always in groups of two, so 00 is one byte, and FF is one byte... etc.), and we see EE03.
This is the breed ID, and I want to point out something quite interesting. If you highlight the whole ID as shown in the image, and look at the bottom where it says "word", this equals 1006. Which is the breed ID in decimal format as it's found in LNZPro for the old breed file.
SO. Now we need to change every instance of EE03 to the new breed ID in hex decimal format. We can get the hex format by looking at the new breed file your pet will use in LNZPro (this is found in RCData > 1003). This shows 997 as a number is E503 in hex:
Okay, easy enough. We only need to change the EE to E5 and the 03 part can stay the same. Let's change the first one in the pet...
Highlight the whole ID again, and check "word" at the bottom.. See how it equals 997?! :D
Now WAIT before you go through and change things all wimbly-nimbly... We first need to find the difference in byte size between EE and E5. Highlight an EE, and look at the bottom at "byte". It should show 238. Now do the same for E5, it's 229.
The difference between 238 and 229 is 9. (additionally, the difference in the two ID numbers is also 9, 1006 - 997 = 9) Neat, how it all adds up, eh? xD
You're thinking, "what does this mean?!". Well, by changing the EE to E5, we're essentially shorting the checksum by 9 for each instance we change. We'll need to keep note of how many EE's we change total and calculate the overall byte difference once we make all the changes. Pull out your handy-dany Notepad and keep a tally of how many EE's are changed.
Change every where you see EE to E5 from the first instance, all the way until you see "pfmagicpetzIII" again. *save at this point, but don't try to open to the pet, it will crash the game!*
For this pet, I found and changed 24 instances of EE, and each change was a difference of 9 bytes, so 24 x 9 = 216.
This means the file size is 216 bytes smaller than what it needs to be in order to work in the game.
So, the best place to compensate for the missing bytes is in the [Paint Ballz] info (Note, anything changed here can be easily fixed by copy/pasting the original [Paint Ballz] section over the edited one in LNZPro). To find this section fast, search for "[Paint". Remember, there are two sets of [Paint Ballz] in your pet; one for the adult LNZ and another for the puppy/kitten. So if you run out of numbers to change in one section, go to the next. c:
We'll need to add in those 216 bytes throughout this section to make the file size right again. We can't simply change one number to equal all 216 bytes, but we can change say, every 1 to a 9 and that will add in 8 bytes each time... we'll only need to change 27 1's to a 9 in order to equal 216. (216 / 8 = 27) Makes sense? :3
We can change any number 1 we see, these are the XYZ coordinates, and again can be fixed later... What I'm seeing here are more 2's than 1's.. so let's change those from 2 to 9. In that case, we'll need to change about 30..
However... 216 / 7 = 30.85...etc.. So.. time for a bit more math:
30 x 7 = 210. and we're still 6 bytes short, so we'll need to change a few more numbers around to compensate for that, but let's start with the 2's first...
Whew! I almost thought I'd run out of 2's xD... Now we just need to change a few more to add up to the remaining 6 bytes. Just above the last 2 I changed, I found a 1! So, change that to a 7, and now everything has been compensated for and the file size is now the same as it was in the beginning. c:
As long as the math is right, every instance found of the breed ID was changed and compensated for, then everything -should- turn out okay. :)
You can save your work, and open your pet in the game.
~~ That wasn't so bad, right?? Join us again for more Tinkerings (...if you dare!) ~~
Happy hexing.