[PC] Text editor - touphScript (v1.4.0)

  • Thread starter Thread starter luksy
  • Start date Start date
Status
Not open for further replies.
Hey I almost don't dare to ask but do you have the possibility to make the output files compatible to Poedit?
 
i have a problem when i press d or e, I get a message saying Cannot Open the registry
 
So, it's possible with Touphscript by this way to have the game traduced same with MO installed ?
I don't understand all, but I only have dialogs traduced in fr( for me ), after selecting the French translation at bootleg's installation.
 
Hello luksy

I have a few minor problems with touphScript.

The prehistory.
I have the German version of FF7 and am already registered here for a while.
I wanted to check what mods can use it for my FF7 and how to best integrate.
Some smoothly, with some others you have to cheat a little, but then it goes.
DLPB's Game Converter sounded like a project that could be useful.
Since I can deal with some hex editor, I thought, rib the text from the German exe and paste it into the prefabricated of DLPB table.
As easy as I thought it was not that.
Some of the lines I had never seen before in the game, the table, where you can name the character is longer, the German keyboard layout is a bit different, ...
I then integrated the English EXE in my game, renamed a few files, and tested whether the game runs.
It seems to run.
Then I have figured out how to expand the table for naming by one column, so that German special characters can be used.
After a few attempts, I then made ​​a translation whereupon DLPB asked me if you can use them now with touphScript.
Then I got me first your touphScript


German, French & Italian exes will not work with touphScript.
I read this and understand why. If you want to change that, perhaps I can help.
But now I had the English EXE.
The dump of the texts worked (in a few 0_scene.bin.txt appeared "encount error"), but I was shocked at the number of text files.
Then I first set all parameters in the INI to 0.
That didn't helped; touphScript still has extracted all text.


My first question: Could you fit a way with which you can edit only certain files?
In the INI could be something like the following to be present
convert_flevel.lgp = yes
convert_world_us.lgp = yes
convert_scene.bin = no
.
.
.


I then replaced the English 0_ff7.exe.txt with my 0_ff7.exe.txt.
D:\_Entpacktes\touphScript>touphScript e

Encoding flevel.lgp
729Fatal error: Couldn't copy file C:\Users\[Username]\AppData\Local\Temp\ts4E86.tmp to C:\Spiele\Final Fantasy VII\data\field\flevel.lgp
After some experimenting I found out then that the write protection flag was set.
In the German version, almost all files are installed with write protection, do not ask me why.
Remove write-protection solves the problem

Couldn't encode exe: Unexpected continuation byte: 2
touphScript seems not like the German special characters, although in the other texts were all right there.
Without these characters, the game is not really correct.
Can you possibly allow these special characters?

EDIT: Convert it into UTF8 format seems to fix that, sorry my fault ::)


0_ff7.exe.txt line n.89 4294967292 char(s) too long
I then checked with Notepad + +, line 89 contained only 2 letters.
I then removed one letter, the same error.
Then I removed in line 90 characters, now it worked (at least at this point).

Obviously starts touphScript count the lines from 0 instead from 1


0_ff7.exe.txt line n.154 4294967292 char(s) too long
I wanted there to insert Num. +, but it had to N. + Cut before touphScript was satisfied (4 characters).
If I want to change the keyboard layout and some advices on this button, N. + Num. 1 is displayed.
At this point the EXE, the keys are all completed with an additional 0x00, otherwise the text is displayed to the Nearest 0.
In the example above, so are only 3 letters allowed, it must be followed by the 00th


Although touphScript obviously had integrated all text came at the end the following message:
Couldn't encode exe: Unexpected continuation byte: 9
Unfortunately, I do not understand this message. But I'll try next.
EDIT: Convert it into UTF8 format seems to fix that, sorry my fault ::)


I hope I could help a bit, and await your answer.

Greetings Kompass63
 
Last edited:
I have already discussed this with Luksy.  You have to make sure the 0_ff7.exe.txt file is saved in UTF8 format.  The other error is correct that the length is too long to fit into ff7 english (you will have to reduce the size.  Wait for me.  I have already got a list of what needs doing), it just gets the length wrong.
 
Edit:

That seems to help a bit, I must let the convert, not only save....
 
Last edited:
There must be a character there that ts doesn't like.  Do you think you can figure out the offending character?
 
Periodic Report to Dr. Luksy

CONFIDENTIAL

Code: [Select]
Code:
1.  Because menu overhaul is now moving to memory, some values needed by ts will no longer be read (all the ones in ff7.exe that ts uses).  If possiblets needs to support these values in ini.Possibly if values exists in ini, they will override the exe values.Hopefully this will not be too difficult to do.  2.  ts needs to support skipping of files when theircorresponding text file is not present.   If scene.bintxt file is missing, kernels table would also be leftalone.  World map, ff7.exe and kernel2 wouldall be skipped as well if corresponding text file missing.  Sometimes a modder may only want toupdate 1 file or not update others.3. ts is missing entry in ff7.exe.txt due to my ownerror.  Entry is BOARD between OFF and SLEIGHat 555804, 8 chars.  OFF is 4chars at 555800.  A note of this will need to be made tomodders so they can add the line to their existingwork if updating ts.4.  Certain lines when wrong length are beingreported with wrong number of chars over limit.5.  Log should start with line number, then file,then char over limit in this format which is betterfor readability.  Note file name in square brackets.Line 762 [0_ff7.exe.txt]: 4 char(s) too long.As opposed to 0_ff7.exe.txt line n.762 4 char(s) too long6. The log should not pop up on simple    "script is not original" errors.7. ts does not work with 2012 FF7 version.    Unknown reason.  Crashes during decode/encode.   Flevel is same as 1998 version apart from some fixes.8. Model at gold saucer being wrong size and veryannoying needs fixing with script fix. Not priority.
 
Last edited:
My ff7 text file had MO chocobo names starting at line 737 (notepad++).  Seems ts wants it to start 766.

Has there been some alteration in newer ts revisions?
 
Last edited:
My ff7 text file had MO chocobo names starting at line 737 (notepad++).  Seems ts wants it to start 766.

Has there been some alteration in newer ts revisions?
???
The chocobo names starting at line 720 (notepad++) for me.
 
Yours are not the MO chocobo names (Menu Overhaul supports longer chocobo names and chocobo prize names).  TS supports both.  I will explain this at a later time.
 
in which order does TS encode the flevel files?
by ID? by name?
it always crashes at specific fields for me, so I can just replace them temporarily with vanilla editions
 
Just for those who'd like to compile the program from source themselves (I used MinGW and its included mingw32-make command to use the Makefile provided):

in the common.h file, line 134-156:

Code: [Select]
Code:
template<typename T>inline T get(istream& in) { T val; read(in, &val, sizeof(T)); return val;}inline void read(istream& in, void* const p, int const size) { in.read(static_cast<char* const>(p), size);}template<typename T>inline void read(istream& in, T& out) { read(in, &out, sizeof(T));}template<typename T>inline void read(istream& in, vector<T>& out) { read(in, out.data(), vsize(out));}template<typename T>inline void read(istream& in, vector<vector<T>>& out) { for (vector<T>& v : out)  read(in, v);}
You need to declare the get method after the read methods in order to be able to compile.

So you would have to replace previous code with:

Code: [Select]
Code:
inline void read(istream& in, void* const p, int const size) { in.read(static_cast<char* const>(p), size);}template<typename T>inline void read(istream& in, T& out) { read(in, &out, sizeof(T));}template<typename T>inline void read(istream& in, vector<T>& out) { read(in, out.data(), vsize(out));}template<typename T>inline void read(istream& in, vector<vector<T>>& out) { for (vector<T>& v : out)  read(in, v);}template<typename T>inline T get(istream& in) { T val; read(in, &val, sizeof(T)); return val;}
 
I tried using an altered touphscript program on the new ff7 2012 French files.
I altered the program so that it doesn't try to dump the ff7.exe file which is clearly not compatible without changes to the code and the definition of a new offsets table.
I also altered it so that it tries to dump the field.lgp file at the end after all the other files.

=> All files are dumped perfectly except from field.lgp.

I see some non blocking errors about blackbgb and blin67_2 files but this is not really too much of a problem.
But after that, a  fatal error (std::bad_alloc) occurs.

I looked into it a bit and it seems that when trying to read the crcin_1 file from field.lgp, a problem occurs in the following line of the field.cpp file when i=1:

Code: [Select]
Code:
out[i].resize(get<u32>(buf, pos));
I think we try to resize Code: [Select]
Code:
out[i]
which is of type vector<uint8_t> to a too big length : 2408550287.

Clearly we can't allocate the desired amount of memory.
 
Last edited:
OK so I removed some variables defined in the touphScript.exe.h file:

Code: [Select]
Code:
#define _WIN32_WINNT 0x0502#define WINVER _WIN32_WINNT#define NTDDI_VERSION 0x05010300
This was saying to the compiler that we were targeting WinXPSP3 (or WIN2003). As I am using Windows 7 x64, this would cause a conflict when compiling with the new compiler describe below.
By removing it, I let the compiler find out the Windows version used by itself.

I then installed tdm-gcc with the MinGW-w64 based version which would allow to compile the program in x64.
I recompiled the zlib library from source using this new compiler.
Then I recompiled the touphScript program.

I the error about bad_alloc is gone!

This was due to the 32 bit compilation limiting the allowed maximum memory usable by the program.
By using 64 bit compilation (with enough RAM), there is no more problem.
 
Got an error no matter what option I give: Fatal error (basic_ios::clear).
I'm running Win8 x64.
 
This might be a dumb question, but still...
The screenshots look nice, but for the people who have edited their games, are you going to post your config texts? I did some rom patching way back with SNES. I patched Harvest Moon and turned all of the "innocent girls" into foul mouthed, horny howlers. I think a rated R version of FF7 would be a riot.
 
ugh... may have sussed out the issue I had. I will check.

edit.

yup.  Once again Luksy wins ;)  This still needs to be edited though so it can work with 2012 flevel.   :evil:
 
Last edited:
Status
Not open for further replies.
Back
Top