0

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.

1 Answer 1

1

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.

5
  • Thanks for your answer, but I have a couple of problems about it. But if I open the file with Notepad, a long nonsensical text appears. Here is a very short excerpt: "Þíþ Ù 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.
    – Dante S.
    Jun 14, 2021 at 1:28
  • Second, the editor you offered me does not modify a saved level. Only main saved game, which would be the one that contains the amount of money, the levels unlocked, the zen garden, etc.
    – Dante S.
    Jun 14, 2021 at 1:30
  • 1
    And in the end a third thing came to me regarding the answer. Modifying a Plants vs. Zombies 2 save MAY be different than in Plants vs. Zombies. For starters, both games were created by different companies (Pop Cap and EA). However, I will consider looking at the code, thanks!
    – Dante S.
    Jun 14, 2021 at 1:33
  • Thanks again for the answer and the intention to help!
    – Dante S.
    Jun 14, 2021 at 1:34
  • I edited the question adding the new information.
    – Dante S.
    Jun 14, 2021 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .