Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I used the program to edit pp.dat Pvz2, but it did not open the game #14

Open
L-byte12 opened this issue Mar 13, 2021 · 6 comments
Open

Comments

@L-byte12
Copy link

Can it be used in pvz 2?
Sorry my english.
I used the program to edit( but I did not edit I wanted to see if the game would run, I did the same as the guy who asked you before).
I copy what he said

1. I copy pp.dat from android to my laptop
2. I run the rton executable file
  1. Pp.dat is recognised as a rton file. A new folder is created which contains a json file.
    (without editing the json file, to identify at which stage my issue is occurring)
    4. I again run the executable, now producing a .Rton file.
    5 I rename this file pp.dat
    6 I copy this version of pp.dat back to my android device
    On attempting to open pvz2, the screen goes black for a few seconds then back to the home screen.
    On replacing pp.dat with the old version, the app opens as usual

Sorry, sorry I'm not a programmer and I don't know much but I saw that they are different

I do not know if I am using it well, check the .dat and they are not the same. I attach a pdf https://drive.google.com/file/d/1lLbKhnEI5AT0dcHTfXGIm9YMnVFnb9Zp/view?usp=sharing

Thanks for your time

@h3x4n1um
Copy link
Owner

h3x4n1um commented Apr 8, 2021

If you can please upload your file, it's more useful than screenshot open in Notepad++

@webfussel
Copy link

Hello there,

I have the same issue.

-> copy pp.dat from phone to desktop
-> run rton2json
-> edit
-> run json2rton
-> rename to pp.dat
-> copy to phone
-> black screen, app shuts down

Used with the newest 3.1.2 release.

I've added my original pp.dat (pp_original.dat), the modified pp.json and the new pp.dat into this Google Drive.
Hope it helps.

Files - Google Drive

@nineteendo
Copy link

nineteendo commented Jun 7, 2021

Firstly RETON seems to have sorted the keys which is not supposed to happen, this might shuffle #comments around.
However a much bigger problem seems to be the fact that not the correct data types are used, this will require manual configuration and a major code rewrite ...
This is what my tool spits out (https://github.com/Nineteendo/PVZ2tools/tree/master/RTONS_PARSER, https://github.com/Nineteendo/PVZ2tools/tree/master/JSONS_PARSER):
pvz2-rton2json.zip

Conversions that happened (> = my tools, >RTON> = your tool):
Unmodified(pp_original.dat > pp_original.json > pp_original_from_rton.dat)
Modified(pp.json >RETON> pp.dat > pp_from_json.dat > pp_from_json_from_rton.dat)
Modified(pp.json > pp_from_rton.dat) webfussel should be able to use this if still interested

Note that my tool is not perfect, just a few bytes get changed.

@h3x4n1um
Copy link
Owner

Used with the newest 3.1.2 release.

Can you try it again with 3.1.3?

@h3x4n1um
Copy link
Owner

h3x4n1um commented Jun 29, 2021

Firstly RETON seems to have sorted the keys which is not supposed to happen, this might shuffle #comments around.
However a much bigger problem seems to be the fact that not the correct data types are used, this will require manual configuration and a major code rewrite ...
This is what my tool spits out (https://github.com/Nineteendo/PVZ2tools/tree/master/RTONS_PARSER, https://github.com/Nineteendo/PVZ2tools/tree/master/JSONS_PARSER):
pvz2-rton2json.zip

Conversions that happened (> = my tools, >RTON> = your tool):
Unmodified(pp_original.dat > pp_original.json > pp_original_from_rton.dat)
Modified(pp.json >RETON> pp.dat > pp_from_json.dat > pp_from_json_from_rton.dat)
Modified(pp.json > pp_from_rton.dat) webfussel should be able to use this if still interested

Note that my tool is not perfect, just a few bytes get changed.

About the sorted keys: it's a bug because I using std::map to save the json data when converting json to rton, it should be fixed by 3.1.3 release (I switch to nlohmann::fifo_map)

And the other part, the data type: this kinda headache because

  • We can't infer the data type from json format
  • By default, RETON using the upper bound limit of the data type (e.g use double for real number instead of float, use 8-byte RTON number for integer) to cover as widest range as possible
  • However, some specific RTON keys appear to have predefined data type, maybe I can try to implement this into RETON?

@nineteendo
Copy link

Well, I think the format is not so strict as first imagined.
You don't have to use the predefined datatype, but you do have to respect the RTON format.

Maybe it was just the fact that the keys were sorted, I will check at 17 hours which files are accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants