User blog:RealKingPiggy/Plants vs Zombies 2 Hex Edit Tutorial! Editing Zomboss fight zombies and plants!

From Plants vs. Zombies Wiki
Jump to navigation Jump to search

THIS IS A TUTORIAL THAT IS GETTING UPDATED, MORE WILL BE ADDED SOON. I WILL ALSO TRY TO FIND A WAY TO DO THIS EASY ON IOS ASWELL.

Preparing for editing

There are many things you have to do before we can get to the editing.


The first thing is a few requirements:

An Android Device or Emulator. A file explorer app, such as Es File Explorer, PVZ2 game, na or row, (this will be explained later) a way to transport your edited file to your game The second is obtaining an Editable OBB:

IMPORTANT NOTE BEFORE WE GET STARTED: obb's before 3.4 do not need to be made "editable", this means if you are using an old version under 3.4, you do not have to get an editable obb for that version. just edit the one from the downloaded one.

In the pinned post, there should be a link that reads "Editable obb", and give you a file called main.(#).com.ea.game.pvz2_(row/na).obb.

QUICK NOTE: If you have an apk that is for na, and an obb for row, just rename the obb to "na" instead of "row". Basically, The "row" version is an international version of the app on the google play store. The "na" is a soft release, or beta version.


To check which version you have, In your file explorer, go to /sdcard/Android/obb/com.ea.game.pvz2_(row/na). Which ever version is there, "na" or "row", use that for the obb instead.

Now that you have your obb, there is 3 ways you can edit.

If you would like to edit on the go from your android device, you can download an app called "Hex Editor" from the google play store.

If you would like to edit on a Windows computer, use HXD Hex editor, which can be downloaded here.

If you would like to edit on a Mac computer, use IHex from the mac app store, this is one of the best I could find.

>Now that you have a way to edit, we can finally begin!

Open your file at the target path with your app/program.

Now you should see some code say 1bsr and a bunch of random symbols after that.

Next, I'm going to explain a few things before i get too far. The only things we really know about editing zomboss fights, are editing what zombies he spawns, and what plants are on the conveyor belt aswell as a few properties about the conveyor belt.


EDITING PLANTS

First you need to find which zombot you want to edit. Currently this can only be done with 4 legged ones. This includes: zombossmech_egypt, zombossmech_pirate, zombossmech_cowboy, zombossmech_future,

Take one of those codes without the comma, and search for it. I use zombossmech_future as an example. There are multiple results, the first result should be: 3IMAGE_UI_ALMANAC_PACKETS_ZOMBIES_ZOMBOSSMECH_FUTURE. This is not correct. search again. you should go to another zombossmech_future under this ^. Search one more time. then you should get a result with "ZombossMechType' before it. 

Then, scroll up. you should see a bunch of plants, and the words "initial plant list" This is the list of plants in the conveyor belt. PLEASE NOTE THAT SOME PLANTS ARE NOT BY THERE ACTUAL NAME. THERE ARE CODE NAMES INSTEAD. EXAMPLE: Infi-nut is codeworded as holonut. SOME ALSO HAVE _ IN THERE NAMES. EXAMPLE: CherryBomb's codename is cherry_bomb. a list of these plants codenames can be found here .

Now you edit them! If anybody knows how to add bytes to the names, please let me know. Whenever I do, the game crashes :/    Anyway, let me give an example: the plant is "holonut". holonut has 7 letters. You cannot change to plants with a higher number of letters in the codename without adding bytes, which you can do, but i dont know how on some devices, and my game crashed when i did. if you change holonut to "stunion" that is ok. if you change holonut to "citront" that is not ok. you need to NULLIFY the t. This can be done by taking the hex numbers of the "t" and make them "00"

For example. 68 6F 6C 6F 6E 75 74 holonut --->

63 69 74 72 6F 6E 74 citront --->

63 69 74 72 6F 6E 00 citron. (the period is a dot representing the code "00")

you can use the list above to get the codenames. AGAIN: if anybody knows the deal with inserting bytes, please let me know :D

ADVANCED EDITS: 

How much of each plant:

[1]

This is the dollar sign before holonut which the byte after it is how many can appear at once. In this case, it is 3.

This is the dollar sign before holonut which the byte after it is how many can appear at once. In this case, it is 3. First, you need to open the level. Now, try to plant everyone of each plant without defeating zomboss. See how many of each plant that you have when the conveyor belt stops giveing you that plant. I will put some pictures here showing soon. To basically explain this, i will be using infinut in future zomboss battle. There are a maximum of 3 available at a time. For every plant that you find the maximum of, There will be this number in hex after a $. This dollar sign for that plant will always be one before the plants name. For example: Citron is 0A or 10, blover is 1, and both tool_powertile_beta and tool_powertile_alpha are 3. 


EDITING ZOMBIES

This is a little bit different than the one before. 

Search for "ZombossSpawnJump" untill you get to whatever time of zombies. AGAIN: YOU CAN ONLY EDIT EGYPT, PIRATE, COWBOY, AND FUTURE ZOMBOSSES. The others will crash your game if edited.

Use these zombies codenames to find ones that corespond to what zomboss your editing. click HERE for them.

For example, if you were editing Future Zomboss, You would search ZombossSpawnJump untill you see future_armor1 and similar names with it.

Another example: Search for ZombossSpawnJump untill you find some list of pirate_armor1 and similar names with it.

Then, Edit them with the codenames I gave you. This is similar to the plants one, read the plants examples for further information if you havent read it already.


Once your finished, save your obb in your program and export it to your device/emulator if nesesscary.


COMMENT IF THERES ANYTHING I MISSED ANY YOU WANT TO KNOW, AND EDIT IF YOU FEEL YOU KNOW SOMETHING TO ADD TO THIS GUIDE! Thanks!


One more thing, I made a custom zomboss fight too, Here is one example: