Cannot import anything

About PR usage and development, and about the POP format.
Post Reply
mapsynth
Scholar Scribe
Scholar Scribe
Posts: 2
Joined: April 25th, 2017, 9:39 pm
Contact:

Cannot import anything

Post by mapsynth »

Hi, my name is Marco and I'm absolutely new here. I'm trying to make an Italian translation of the game Prince of Persia 2: The Shadow and The Flame, and I have used the Princed Resources (PR) editor to extract the DAT archives and get to the text strings no problem. They are usually in a .bin file, from what I recall.

However, as you might have guessed from the title of the topic, for some reason I can't import any file whatsoever in the DAT archives. I am using the 1.3.1-prerelease2 version (which I think is the latest one) and I have the pop2.xml resources file. I'll try to explain in detail what my problem is.

First of all, I think there is a serious bug with the -i / --import command. What I write in the prompt is:

Code: Select all

pr -spop2.xml -iresources ita\nis.dat
which is supposed to take files from the "resources" folder (according to what is written in the "pop2.xml" file) and put them in the "nis.dat" archive, which should be automatically generated in the "ita" folder. Instead, what happens is that the program creates an empty folder called "nis.dat" and nothing gets put anywhere.

This doesn't happen if the output file already exists, as in I already have a file named "nis.dat" in the "ita" directory and want to overwrite it. However, no matter what I do, every time I execute the command and try to overwrite the file I always have the same error multiple times:

Code: Select all

....
'filename.ext' has errors, skipped
'filename.ext' has errors, skipped
'filename.ext' has errors, skipped
....
Result: Success (0)
I have even tried to write the command with the "extended" instructions, like this:

Code: Select all

pr --resource=pop2.xml --import=resources ita\nis.dat
but nothing changed. Still same errors.

I thought "maybe my modifications to the files are doing something wrong", but even if I leave the files untouched and try to re-import them in the archives the same error appears every time for every single file. So, every modification I tried to do to the archives failed miserably. The only time it kinda did something to an archive it left me with an 8 bytes file which immediately crashed the game (the original "nis.dat" archive is 1059 kB). I have tried older PR versions (1.3 and 1.3.1-prerelease1) and I have the same errors (except with 1.3, but it doesn't work either).

I have tried recompiling the whole source code with dev-cpp, but that didn't do any good.

I figured "maybe PR doesn't work very well with POP2", so I tried importing something in a POP1 DAT archive using the "resources.xml" file instead of "pop2.xml". Nothing changed, I always get the "'filename.ext' has errors, skipped" thing for every single file, even if I didn't do any modifications to the files I want to import.

Also, someone on the internet used PR to translate POP2 to Spanish, so doing what I'm trying to do is perfectly possible. This guy provided a translation log explaining how he did certain things, but following his instructions still gave me "'filename.ext' has errors, skipped" and folders created instead of DAT archives.

I'm on the edge of giving up. I feel like I have tried everything I could and I don't know what to do anymore. If someone can help, please do, I really want to translate POP2 to Italian. I'm using Windows 10 with the latest Creator's Update if that is any relevant.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Cannot import anything

Post by David »

Hi Marco, and welcome!

I downloaded PR from the link below and it seems to work for me.
https://www.popot.org/other_useful_tool ... lease2.zip

I made a changed version of PR that shows a more concrete error message, after the "has errors, skipped" line.
Please try this, and tell me what does it say.
(This zip contains only the changed files.)
pr_verbose.zip
(46.65 KiB) Downloaded 113 times
mapsynth wrote: I'm using Windows 10 with the latest Creator's Update if that is any relevant.
You could try running PR or the command line as administrator.

Also, are there any special characters in the name of the PR's folder or one of its parent folders? (Just guessing...)
mapsynth wrote:

Code: Select all

pr -spop2.xml -iresources ita\nis.dat
Instead, what happens is that the program creates an empty folder called "nis.dat" and nothing gets put anywhere.
This doesn't happen if the output file already exists, as in I already have a file named "nis.dat" in the "ita" directory and want to overwrite it.
Strange. For me, it always creates a nis.dat file and never a directory.
(It will even create the ita directory if it does not exist.)
mapsynth wrote: I tried importing something in a POP1 DAT archive using the "resources.xml" file instead of "pop2.xml".
Nothing changed, I always get the "'filename.ext' has errors, skipped" thing for every single file, even if I didn't do any modifications to the files I want to import.
Also strange. It works for me correctly.

Code: Select all

pr -epop1 TITLE.DAT
pr -z7 -ipop1 TITLE.DAT
mapsynth wrote: Also, someone on the internet used PR to translate POP2 to Spanish,
It's here, if someone else is interested: http://popuw.com/download2.html
mapsynth
Scholar Scribe
Scholar Scribe
Posts: 2
Joined: April 25th, 2017, 9:39 pm
Contact:

Re: Cannot import anything

Post by mapsynth »

David wrote:I made a changed version of PR that shows a more concrete error message, after the "has errors, skipped" line.
Please try this, and tell me what does it say.
(This zip contains only the changed files.)
pr_verbose.zip
Thanks to this version I have figured out what the problem was. Right after "'filename.ext' has problems, skipped" it displayed either "File not found" or "Read permission denied" or something like that. Which is absurd, considering I had every single file I needed in the "resources" directory and none of them had any read restrictions.

So out of pure instinct I tried putting the files in a subdirectory, "resources\nis", and everything imported in the ita\nis.dat archive just fine. This also solved the "creating folders instead of archives" problem, only I have to name the archive I create with the subdirectory's name, and the subdirectory's name needs to be something that's specified in the pop2.xml I guess. I tried renaming both of them and it gave some errors.

Thank you so much David!! :D :D :D
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Cannot import anything

Post by David »

mapsynth wrote:So out of pure instinct I tried putting the files in a subdirectory, "resources\nis", and everything imported in the ita\nis.dat archive just fine.
The files are exported into a NIS subfolder, so you need to keep that when importing.
mapsynth wrote:Thank you so much David!! :D :D :D
You're welcome!
Post Reply