How to modify game1_10.dat to change the seed packages that appear in the top bar

plants-vs-zombies

I wanted to make a Python program that modifies which seed packets appear on the top bar in "Roof Survival (hard)".

The file where the level is saved is called "game1_10.dat". I googled how to do it, but didn't find anything. Is it possible to make this modification to a save file? How do I do it?

I've already tried opening the file with Notepad. I leave a fragment of what appears:

   ­Þíþ   Ùd\V                                                                                                                                                                                                                                       

According to the Plants vs Zombies wiki, the user1.dat file must be modified with a hex editor, so I assumed that in the case of game1_10.dat it would be the same. Learning how to edit it manually would be my first step before doing it with Python.

Best Answer

Editing a .dat file is pretty straightforward - all you need is a text editor (Notepad or Notepad++ for example).

  1. Right click the file and select "Open With"
  2. Choose your text editor
  3. Edit away
  4. Once done, make sure you save it in the same format.

Note: do not use Word or similar programs - these are not text editors.

As to how to specifically edit the values in the .dat file to achieve what you want, you might need to fiddle around with that first (so make sure you make a backup first!!). There are a few save game Editors out there already like this one so you might be able to work off that.

This one is for PvZ 2, but it is a gitHub project (which gives you the source code to look at), which might be more help.