PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [release] ELEX string table [un]packer (lianzifu)



NicoDE
01.02.2018, 10:46
lianzifu (连字符) has been developed for Risen 3, but the binary string table format hasn't been changed for ELEX.

Main thread: [release] Risen 3 string table [un]packer (lianzifu)

Please use this thread for ELEX-related discussions.

ELEX-specific issues:

PB changed the STB version with a patch (from 6 to 7)
(the BIN isn't accepted by the game if the version doesn't match)
there is no string identifier hash map for ELEX yet
(ask Piranha Bytes to create them with lianzifu or create your own)
there were some damaged strings in the original BINs
(has been fixed by PB with one of the latest patches)

NicoDE
07.02.2018, 14:48
With the current patch (2955) the string tables are split into several files (still STB file format with version 7):

data/compiled/localization/de.str German(_Text|_StageDir)
data/compiled/localization/en.str English(_Text|_StageDir)
data/compiled/localization/fr.str French(_Text|_StageDir)
data/compiled/localization/it.str Italian(_Text|_StageDir)
data/compiled/localization/sp.str Spanish(_Text|_StageDir)
data/compiled/localization/pl.str Polish(_Text|_StageDir)
data/compiled/localization/ru.str Russian(_Text|_StageDir)
data/compiled/localization/cz.str Czech(_Text|_StageDir)
data/compiled/localization/ch.str Chinese(_Text|_StageDir)
data/compiled/localization/kor.str Korean(_Text|_StageDir)

It might make sense to add an optional column filter to lianzifu's --save-bin command...

NicoDE
09.02.2018, 11:34
It might make sense to add an optional column filter to lianzifu's --save-bin command...
done, has been added in version 2.1

NicoDE
09.02.2018, 15:34
Example script (lianzifu-unpack.elex.cmd) to unpack the current string tables:


@ECHO OFF
VERIFY OTHER 2>NUL
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
IF "%ERRORLEVEL%"=="0" GOTO BEGIN
ECHO.
ECHO This script requires command extensions and
ECHO delayed environment variable expansion [NT].
ECHO.
IF NOT "%1"=="--no-prompt" PAUSE
EXIT
:BEGIN
REM 'run as admin' and UNC paths require manually switching into the directory
PUSHD "%~dp0"

SET LIANZIFU_ARGS=--read-ini "data/ini/loc.ini"
REM load id name map files if present
FOR %%B IN ("%~dpn0*.csv") DO (
ECHO # found idmap file ^(%%~nxB^)
SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-map "%%~nxB"
)
REM read (old) full string table if present
REM (to include Korean strings if kor.str is missing)
FOR %%B IN (data/compiled/localization/?_strings.bin) DO (
ECHO # found full table ^(data/compiled/localization/%%~nxB^)
SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-bin "data/compiled/localization/%%~nxB"
)
REM read (new) language specific string tables if present
FOR %%L IN (de en fr it sp pl ru cz ch kor) DO (
IF EXIST "data/compiled/localization/%%L.str" (
ECHO # found lang table ^(data/compiled/localization/%%L.str^)
SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-bin "data/compiled/localization/%%L.str"
)
)

IF NOT "%1"=="--no-prompt" (
ECHO.
ECHO Existing data/raw/strings/*.csv will be overridden!
ECHO ----- press [Ctrl+C] to cancel this script -----
ECHO.
PAUSE
)

ECHO running lianzifu...
lianzifu.exe %LIANZIFU_ARGS% --save-csv --exit 1> "%~dpn0.log" 2>&1

SET /A EXITCODE="%ERRORLEVEL%"
IF NOT "%EXITCODE%"=="0" (
TYPE "%~dpn0.log"
IF NOT "%1"=="--no-prompt" PAUSE
)
POPD
ENDLOCAL && EXIT /B %EXITCODE%

Without a map file (lianzifu-unpack.elex.csv) all the strings will be in the data/raw/strings/strings.csv

NicoDE
13.02.2018, 20:38
Attached you'll find string identifier map files that include two-thirds of the current x64 release (the batch script from the previous post is also included).

46654

Put all the files and the lianzifu.exe (https://github.com/nicodex/lianzifu/releases) in the root directory of the game, extract the BIN and/or all STR into data/compiled/localization and run the lianzifu-unpack.elex.cmd .

Well, two-thirds is better that nothing. If you want a complete map, you'll have to ask PB (they could run lianzifu --read-ini data/ini/loc.ini --read-csv --save-map lianzifu-unpack.elex.[platform].csv for every platform).

ps: My map files contain more information than required (everything after the first | is ignored). To support later merging I included the hash value and the source file, where the string has been found.

STARK1LLER
20.06.2018, 16:40
I started to figure out in this, extracted strings to csv, & managed to write a cmd file to put it back to the bin. It worked in game, but I have a few questions about it, to be shoore everything is okey.

1) As I understand, everything which not present in map csv files, goes to strings.csv.
This file has a lot of empty lines with addres. Is it normal?

2) Order of text fields is different from the map csv. Mostly it just turned upside down. It makes uncomfortable to work with it, especially with dialogs. Could it be fixed somehow?

3) Here is my cmd script, is everything okey in it?

@ECHO OFF
ECHO Packing Elex (Windows 64-bit) string table...

CD /D "%~dp0"
lianzifu.exe ^
--read-ini "data/ini/loc.ini" ^
--read-csv ^
--save-bin x64 7 "data/compiled/localization/ru.str" ^
--save-map "#%~n0.csv" ^
--exit 1> "%~dpn0.log" 2>&1

IF ERRORLEVEL 1 (
TYPE "%~dpn0.log"
PAUSE
)
4) After pack string back to the bin, it's size is different from the original bin:
1.45 mb vs 1.55 (org). That part troubles me. Although the game works fine with it, I fear that something may be missed or assemble not properly. I'll put here an archive with this files & will be wait for your opinion.
elex_ru_loc.rar (https://drive.google.com/open?id=1ZtjHfg1Oq7mDoaL8Nvtxdc7fu0Q-pOit)

NicoDE
21.06.2018, 08:58
1) As I understand, everything which not present in map csv files, goes to strings.csv.
They are added to the first entry in the loc.ini.

For most users this is
[default]
prefix=default
csv=#G3:/Data/Raw/Strings/strings.csv
bin=#G3:/Data/Compiled/Strings/strings.tab
During testing I used:
[unknown]
prefix=unknown
csv=#G3:/Data/Raw/Strings/unknown.csv
bin=#G3:/Data/Compiled/Strings/unknown.tab

You are completely free to organize your CSVs. In the end the prefix doesn't matter for the game, because all CSV entries are merged into one big table with identifier hashes as rows and the language(s) as columns.

The map file feature is only present to restore the identifier strings from the hashes in the compiled BIN files.


This file has a lot of empty lines with addres. Is it normal?
Yes, there are a lot of empty values in the table. That's normal and expected.


2) Order of text fields is different from the map csv.
As mentioned above, the map files are only of interest for unpacking compiled BINs.
(usually you unpack the original BINs once and start working with the CSVs, and later to track the changes in the official patches - well, I don't expect that many in the future...)

The identifier hashes in the BINs have to be stored in descending order. There is no information left from which CSV the entry was read (in fact, for multi-language BINs the values for one identifier could be read from different CSVs).
I don't want to change the order on unpacking or map file export, because it would make it harder to track the changes (I recommend using a version control system like Subversion, Git, ...).


3) Here is my cmd script, is everything okey in it?
The script is fine.

But you can skip the map file export (you already have the CSVs with the identifiers - however, a map file would be useful for other users if you introduce new identifiers and want to share it with the community :)).

Since you're creating a single language BIN, you might add a column filter for the --save-bin. Add 9 (the current default compression level) and "Russian_Text" (AFAIK the game doesn't use the *_StageDir columns - the default is "*_Text;*_StageDir").


4) After pack string back to the bin, it's size is different from the original bin:
That's fine :)
I implemented several compression methods in lianzifu. The current default compression level is 9 (best), which usually results in a better compression ration than the method that PB used. The PB-like compression method is currently selected with level 4. However, to get the same out, you have to have the same CSV files in the same order as PB (with this method the encoding dictionary is full after 25% of the data and the following entries have to be encoded with this dictionary).

I'm working on an even better compression method, but don't expect a public release soon (currently it's too slow and I'm on vacation for several weeks).

STARK1LLER
21.06.2018, 15:23
Thanks for the reply. After my previous post, I started to fix some localization errors. It works fine.
I wonder how to add new text variables properly? As I understood, game uses text line addresses to identify them. And the most properer way is to declare new csv at the end of ini? For example:
[new]
prefix=new
csv=#G3:/Data/Raw/Strings/new.csv
bin=#G3:/Data/Compiled/Strings/new.tab
Then add new text variables to that csv file. And when it'll be pack to the bin, it should be at the end, and do not interfere with the rest data.
How much memory is available for this?

NicoDE
21.06.2018, 17:27
I wonder how to add new text variables properly?
You're free to put them everywhere. Of course it makes sense to create a my_mod.csv for your new strings.
The separation into different CSV files just helps finding things.
You could use a single CSV with all strings and all languages if you like.
For the game it doesn't matter: It loads the column for the selected language from the BIN on start, and when a localized string is requested, the hash of the identifier is calculated, and the value for the hash is read.

STARK1LLER
21.06.2018, 17:40
So it's a hash of a variable. I thought it some king of an address.
So knowing of the hash algorithm may help to restore missing string variable names?

NicoDE
21.06.2018, 18:01
So it's a hash of a variable. I thought it some king of an address.
So knowing of the hash algorithm may help to restore missing string variable names?
It's the DJB2 hash of the lower-cased string identifier (first column in the CSV).

Have a look at post #5.
Extract the latest BIN and all the latest STRs and run the script. This will create CSVs with all languages (and many hashes are resolved to identifier strings). The German_StageDir and English_StageDir might give you additional hints what the string is used for. Since all languages are included, you should specify the filter Russian_Text for the --save-bin command when creating the ru.str.

InnerMoon
02.01.2019, 22:10
Hello there.

I've managed to modify (and enhance) the Spanish text of the game (I've been fixing a lot of errors and things that were not translated correctly). Howeve I have a problem:

I tried to fix the subtitles of the intro video but the changes I made do not work. When I start a new game the subtitles of the intro video are still the vanilla ones (not the ones I change in the mod).

How can I fix this?

Asloner
03.01.2019, 00:57
Hello there.

I've managed to modify (and enhance) the Spanish text of the game (I've been fixing a lot of errors and things that were not translated correctly). Howeve I have a problem:

I tried to fix the subtitles of the intro video but the changes I made do not work. When I start a new game the subtitles of the intro video are still the vanilla ones (not the ones I change in the mod).

How can I fix this?

Здравствуйте..
Для того чтобы изменить субтитры в интро видео вам необходимо изменить их в следующем файле prologue.spanish.srt расположенном по следующему пути Elex\data\extern\video. Их можно изменить с помощью простого блокнота.

Yandex-Translation: Hello there.In order to change the subtitles in the Intro video you need to change them in the following file prologue.spanish.srt located on the following path Elex\data\extern\video.
They can be changed with a simple Notepad.

InnerMoon
03.01.2019, 23:20
Man, I love you. Thanks.

DarthNihilus
27.07.2020, 20:11
can someone tell me how to pack the changed csv files back to the game?

tombom81
27.07.2020, 20:50
Use the cmd file here:
https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25856902&viewfull=1#post25856902

(I used one different line, though: )
--save-bin x64 7 "#X64:/data/compiled/localization/w_strings.bin" ^

This post is useful, too.
https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25857507&viewfull=1#post25857507

(Maybe read the whole thread again?)

DarthNihilus
28.07.2020, 11:31
ok , i packed it, now i have a question about the new lines. how do i create a hash for a new line? can i simply write some unique value there?

tombom81
28.07.2020, 21:23
ok , i packed it, now i have a question about the new lines. how do i create a hash for a new line? can i simply write some unique value there?

Guess you're asking for strings.csv, do you?
lianzifu uses a djb2 hashing formula, so you don't need to care in case you provide
your own gCInfoLocString strings (with preceeding "INFO_").

Example for original one:
gCInfoLocString INFO_PANKRATZI7_00005699 is automatically converted to a hash (0x10115597) (but lower case: info_pankratzi7_00005699 is used, afaics)

The hash can be found in w_strings.bin (97551110).

DarthNihilus
10.08.2020, 21:18
*bumping the head into the table*
why why why my dialog strings stopped showing ingame?

tombom81
11.08.2020, 09:18
Which language? "Russian" worked for you, didn't it?
Might be possible that en.str works with the english ELEX version only.

(For me new (english) dialogues are working again. Had to rename w_strings.bin to en.str, as simple as this.)

(btw: having two paks with the same modded file/different contents was often causing errors for me.:D)

DarthNihilus
11.08.2020, 10:10
Which language? "Russian" worked for you, didn't it?
Might be possible that en.str works with the english ELEX version only.

(For me new (english) dialogues are working again. Had to rename w_strings.bin to en.str, as simple as this.)

(btw: having two paks with the same modded file/different contents was often causing errors for me.:D)

it stopped in both ! the infos are there. i checked everything i could. the russian worked. then i added 2 more lines ... and somewhere in between the dialogs stopped showing over the npc heads... only in the talk "menu". damn :) tried to put the str file in the mod and outside the mod.

ForNoReason
22.11.2021, 15:06
lianzifu (连字符) has been developed for Risen 3, but the binary string table format hasn't been changed for ELEX.

Main thread: [release] Risen 3 string table [un]packer (lianzifu)

Please use this thread for ELEX-related discussions.

ELEX-specific issues:

PB changed the STB version with a patch (from 6 to 7)
(the BIN isn't accepted by the game if the version doesn't match)
there is no string identifier hash map for ELEX yet
(ask Piranha Bytes to create them with lianzifu or create your own)
there were some damaged strings in the original BINs
(has been fixed by PB with one of the latest patches)



Can someone share CSVs for english, russian and chinese?

BrendanatorX
16.02.2022, 04:47
I'll be honest, all of this is extremely confusing to me, but I'm trying to figure out how to merge two or three different en.str that were used in mods which required their own version. For example 'Cold Dialogue Warnings' and 'Elex - Skills Descriptions and More'. However I haven't seen any way to do this listed anywhere yet, anyone got ideas?

tombom81
16.02.2022, 09:28
that were used in mods which required their own version.What do you mean by "their own version"?:dnuhr:
-----

Once you managed to successfully unpack/repack (for example en.str<>.csv files) there's a lot to do:

you need to compare all lines from the original infos.csv to
[mod1] infos.csv and [mod2] infos.csv
to find changed or new lines.

(And there's about 18 different csv files, quests.csv and other)

Then I'd strip all additional lines (compared to vanilla .csv files) into a my_mod.csv, >see (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25857823&viewfull=1#post25857823)<.
("from the BIN" means "from the .str" after the PB patch now, I guess)

(btw, as far as I understood it's very important for newly created string lines to give them a prefix like INFO_ or INFO_DESC_ in the concerning .csv files)

BrendanatorX
16.02.2022, 09:38
What do you mean by "their own version"?:dnuhr:
-----

Once you managed to successfully unpack/repack (for example en.str<>.csv files) there's a lot to do:

you need to compare all lines from the original infos.csv to
[mod1] infos.csv and [mod2] infos.csv
to find changed or new lines.

(And there's about 18 different csv files, quests.csv and other)

Then I'd strip all additional lines (compared to vanilla .csv files) into a my_mod.csv, >see (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25857823&viewfull=1#post25857823)<.
("from the BIN" means "from the .str" after the PB patch now, I guess)

(btw, as far as I understood it's very important for newly created string lines to give them a prefix like INFO_ or INFO_DESC_ in the concerning .csv files)

What I mean by "their own version" is that they each use the same file (en.str) but with differences/changes made inside from the vanilla version, and each unique to it's own mod, so you can only use one en.str file, otherwise you'd have to overwrite or find a way to merge them all into one file.
And unfortunately I don't know how to obtain the infos.csv for each mod.. I've been trying to figure all this out from what everyone has been writing and the instructions and readme's and example commands but I'm just having a hard time with it and I'm quite stuck.

tombom81
16.02.2022, 10:07
and the instructions and readme's and example commands but I'm just having a hard time with itSame on my side, when I started.§wink

But using the cmd file from Nicode is not that hard (there's a difference between simply "using" and "understanding all in detail", especially the hashes, agreed:D).

You need these things:

>The .cmd file for unpacking the string tables (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25733837&viewfull=1#post25733837)<
(It contains --save-csv and en.str as parameters)

- lianzifu.exe
and
- en.str for example

(For packing parameters are --save-bin and en.str)
(See Nicode's or starkiller's cmd files for the full parameter list.)

Then unpack and repack en.str
New packed size usually is smaller (depending on the compression level used).

BrendanatorX
16.02.2022, 10:13
Same on my side, when I started.§wink

But using the cmd file from Nicode is not that hard (there's a difference between simply "using" and "understanding all in detail", especially the hashes, agreed:D).

You need these things:

>The .cmd file for unpacking the string tables (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=25733837&viewfull=1#post25733837)<
(It contains --save-csv and en.str as parameters)

- lianzifu.exe
and
- en.str for example

(For packing parameters are --save-bin and en.str)
(See Nicode's or starkiller's cmd files for the full parameter list.)

Then unpack and repack en.str
New packed size usually is smaller (depending on the compression level used).

Yeah, yikes, I think I just finally figured it out and got the csv for each mod and vanilla one, all separated into different folders, the question now is just how best to separate the new stuff that was added in the mod.. what to do with all these .csv files now..

Edit: Okay, update, I managed to separate the new lines, add them each to their own mod-name.csv, I'm just not sure what the next step is.

BrendanatorX
16.02.2022, 11:38
(btw, as far as I understood it's very important for newly created string lines to give them a prefix like INFO_ or INFO_DESC_ in the concerning .csv files)

I'm not sure what you mean by this part..
Do I need to write this in the .csv files somewhere, or do you mean the names of the .csv file, or do you mean this needs to be added before every string line within the document?
Nobody else's mod includes this anywhere that I could see..

tombom81
16.02.2022, 12:07
My bad, I've no idea how exactly those mod en.str files you talked about look unpacked.
I meant lines like such (from infos.csv):

INFO_WEIDMANNX6_00009095|Der Rote Fluss ist der Bereich westlich der Ruinenstätte|We've had reports of Albs on the roads around there and out along the river by the World Heart.

There's a good chance that there's a hash instead of INFO_WEIDMANNX6_00009095 for example.

BrendanatorX
16.02.2022, 12:12
When I unpacked the .csv files, all were blank except for line 1 being "ID|English_Text|English_StageDir", but strings.scv remained filled.

In all the mod versions of en.str it was the same deal, albeit with edited strings.

I'm unsure if this means I unpacked them wrong, just that I managed to get something to work finally.

Either way, none of them have something like INFO_WEIDMANNX6_ at the start, every single line besides the first (ID|English_Text|English_StageDir) in strings.scv is similar to as follows:

ffb37b9b|What are you planning to do?|Commenting on player having dangerous magic, I'm cautious.
ff9a859d|Instructions|
ff930843|According to legend, this shield once belonged to the berserker Erik Eisenfaust.|

However now I'm also unsure how to successfully repack, I get an error when I try.

tombom81
16.02.2022, 12:25
What does the error message look like?
Did you use starkiller's cmd file for packing?

You'll need to replace
--save-bin x64 7 "data/compiled/localization/ru.str" ^
by
--save-bin x64 7 "data/compiled/localization/en.str" ^

>Here's about the hashing (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=26491089&viewfull=1#post26491089)<.
What I wrote about INFO_ etc applies to newly created lines only.

(btw, you can't "retranslate" from hash to string, afaik)

BrendanatorX
16.02.2022, 12:35
Unfortunately yes, used his cmd and changed ru to en

This is simply trying to repack the exact folder of things I got when I unpacked it in the first place, and it fails.

[data/ini/loc.ini]
default=#G3:/Data/Raw/Strings/strings.csv
document=#G3:/Data/Raw/Strings/documents.csv
focus=#G3:/Data/Raw/Strings/focus.csv
focus_unique=#G3:/Data/Raw/Strings/focus_unique.csv
info=#G3:/Data/Raw/Strings/infos.csv
infodesc=#G3:/Data/Raw/Strings/infodescs.csv
quest=#G3:/Data/Raw/Strings/quests.csv
questdesc=#G3:/Data/Raw/Strings/questdescs.csv
cutscene=#G3:/Data/Raw/Strings/cutscenes.csv
svm=#G3:/Data/Raw/Strings/svms.csv
skills=#G3:/Data/Raw/Strings/skills.csv
ui=#G3:/Data/Raw/Strings/ui.csv
item=#G3:/Data/Raw/Strings/items.csv
storyprints=#G3:/Data/Raw/Strings/storyprints.csv
mapinfo=#G3:/Data/Raw/Strings/mapinfo.csv
TUT=#G3:/Data/Raw/Strings/tutorial.csv
ACH=#G3:/Data/Raw/Strings/achievements.csv
PLAT=#G3:/Data/Raw/Strings/platwin.csv


[#G3:/Data/Raw/Strings/strings.csv]
modtime=2022-02-16T10:05:09
records=41449
unnamed=41449


[#G3:/Data/Raw/Strings/documents.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/focus.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/focus_unique.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/infos.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/infodescs.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/quests.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/questdescs.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/cutscenes.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/svms.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/skills.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/ui.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/items.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/storyprints.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/mapinfo.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/tutorial.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/achievements.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[#G3:/Data/Raw/Strings/platwin.csv]
modtime=2022-02-16T10:05:09
records=0
unnamed=0


[data/compiled/localization/en.str]
filter=*_Text;*_StageDir
;fail: (class std::runtime_error) failed to create binary string table

tombom81
16.02.2022, 12:59
well, strange, last time I compiled successfully is 18 months ago.

ok, is compilng, waiting...
ready!
[#G3:/ini/loc.ini]
default=#G3:/Data/Raw/Strings/strings.csv
document=#G3:/Data/Raw/Strings/documents.csv
focus=#G3:/Data/Raw/Strings/focus.csv
focus_unique=#G3:/Data/Raw/Strings/focus_unique.csv
info=#G3:/Data/Raw/Strings/infos.csv
infodesc=#G3:/Data/Raw/Strings/infodescs.csv
quest=#G3:/Data/Raw/Strings/quests.csv
questdesc=#G3:/Data/Raw/Strings/questdescs.csv
cutscene=#G3:/Data/Raw/Strings/cutscenes.csv
svm=#G3:/Data/Raw/Strings/svms.csv
skills=#G3:/Data/Raw/Strings/skills.csv
ui=#G3:/Data/Raw/Strings/ui.csv
item=#G3:/Data/Raw/Strings/items.csv
storyprints=#G3:/Data/Raw/Strings/storyprints.csv
mapinfo=#G3:/Data/Raw/Strings/mapinfo.csv
TUT=#G3:/Data/Raw/Strings/tutorial.csv
ACH=#G3:/Data/Raw/Strings/achievements.csv
PLAT=#G3:/Data/Raw/Strings/platwin.csv
[#G3:/Data/Raw/Strings/strings.csv]
modtime=2020-07-29T13:03:33Z
records=13437
unnamed=13437
[#G3:/Data/Raw/Strings/documents.csv]
modtime=2020-07-29T13:03:34Z
records=580
unnamed=0
[#G3:/Data/Raw/Strings/focus.csv]
modtime=2020-07-29T13:03:34Z
records=0
unnamed=0

...

column.18.name=Chinese_StageDir
column.19.name=Korean_StageDir
;writing...
;...done...
[#G3:/lianzifu-pack.elex.x64-en-str.csv]
idnames=28012

Since Nicode's tools work perfectly, always, afair, when the inputs are correct, there must be an error in your directory structure, input files whatever.

Here's the cmd file I used:

@ECHO OFF
ECHO Packing Risen 3 (Windows 64-bit) string table...

CD /D "%~dp0"
lianzifu.exe ^
--read-ini "#G3:/ini/loc.ini" ^
--read-csv ^
--save-bin x64 7 "#X64:/data/compiled/localization/en.str" ^
--save-map "#G3:/%~n0.csv" ^
--exit 1> "%~dpn0.log" 2>&1

IF ERRORLEVEL 1 (
TYPE "%~dpn0.log"
PAUSE
)
(Yeah, there's "Risen 3" in the ECHO line, but in fact I compiled for ELEX:D)

(See, you've strings.csv only, while it's several .csv files for me. No time to check this atm, sorry.)

BrendanatorX
16.02.2022, 13:04
That one worked for me too, thank you.

If I want to add my mod csv to that, since they aren't mentioned in the logs, do I have to add extra lines to the loc.ini? Or will they still work despite not being mentioned as one of the g3/loc.ini listings?

eg.

[quest]
prefix=quest
csv=#G3:/Data/Raw/Strings/quests.csv
bin=#G3:/Data/Compiled/Strings/quests.tab

[mod1]
prefix=mod1
csv=#G3:/Data/Raw/Strings/mod1.csv
bin=#G3:/Data/Compiled/Strings/mod1.tab

I don't know anything about these .tab files though.. so I'm not sure how I would add one for the mods if I was to do this anyway.

tombom81
16.02.2022, 13:19
To be honest, I didn't use my_mod.csv so far. I only saw Nicode mention it (first page of thread).

Guess, you need an entry in the loc.ini, yes.
Like the ones you showed.
But I'm not sure.

You don't need to care for the tab files, afaik.

If you want details I'd suggest to search in the Risen 3 forum. There is a thread about those things, afair.

BrendanatorX
16.02.2022, 13:25
Adding them to the loc.ini did get it mentioned at least, but it caused it to fail for some reason, yeah I'll have to do some digging, somewhere..

[#G3:/Data/Raw/Strings/cold_dialogue.csv]
modtime=2022-02-16T11:16:36
;fail: (class std::invalid_argument) invalid csv column name

nvm, silly me, forgot to put ID|English_Text|English_StageDir back at the top, that's what it was.

Now I'm running into the issue of the strings overlapping again.
I've separated the modded lines out into their own csv as mentioned, but as long as the original lines remain in strings.csv, there's a conflict.
There's just over 500 strings which need to be removed from the original strings.csv to allow the mod.csv files to use it's strings; OR I need to paste all the mod strings into strings.csv over the top of the 500 original strings one by one with the new ones.
I'd really like this automated or to be able to pick which .csv takes priority rather than conflicting, but this is now where I'm stuck at, right before the finish line.

tombom81
29.08.2022, 13:20
It compiles all the languages into every .str file and my question is, is it possible to rewrite the packing command so that it packs each language (|English_Text|, |Italian_Text| etc. lines) only to its own .str file? If it's not possible then I'll have to do it 1 by 1 for each language separately.

Thanks.Hi!
I usually get en.str (2.15 MB) in data\compiled\localization.

Maybe use one of these parameter lines only: --save-bin x64..

(When unpacking original en.str you get english related csv files only in raw\strings, don't you?)
strings.csv starts with ID|English_Text|English_StageDir.

NicoDE
29.08.2022, 19:29
Pass all options to --save-bin, the last param is the column filter (--help should display the param order and the defaults). Yes, this means you have to call --save-bin ones for each language (you can use every command multiple times).

NicoDE
30.08.2022, 15:25
Looks good (I neither used Windows, nor installed Elex for ages).

Since you already have the CSVs, there is no need to create a map file (--save-map is intended to share additional strings between projects or to restore multiple CSVs from original merged strings.bin).

IIRC the StageDir are only hints for the voice actors, so you might skip them for your releases.

M1S1
10.01.2024, 06:26
Dear All,
are there any possibilities to change the ingame text size (dialog text)?
I use hungarian localization. I got en.str (hu.str)
OR
I need to make new lines into the config files?
Thanks

tombom81
11.01.2024, 11:51
Dear All,
are there any possibilities to change the ingame text size (dialog text)?
I use hungarian localization. I got en.str (hu.str)
OR
I need to make new lines into the config files?
ThanksDear One,
I think it's a matter of fonts. So far elex2fnt files are not supported by the resman.
When you compare consolas_10_b (74 kB) to consolas_14_b (138 kB) it's obvious that you'll need to create a complete new fnt file for a bigger text size.

M1S1
11.01.2024, 19:47
Thx the info
I can not make any similar step :) I do not have knowledge of programing, making mod etc.
I think that is not easy to make if somebody write down the order step by step

oder? :)

tombom81
13.01.2024, 14:21
Since this is too offtopic we should continue here (https://forum.worldofplayers.de/forum/threads/1618231-Text-Fonts?p=27309992&viewfull=1#post27309992).

Cerulean
05.02.2024, 17:08
Hello, I'm sorry that this is written in English. German responses work fine, I can just translate them with Google.

I am trying to make a mod the keeps Ryan alive, including with newly added text.
The text is the only part remaining, but is the most difficult.

I have the latest version of Elex from GoG, but my unpacked c_1_na Localization folder only has w_strings.bin
I believe it is supposed to have $$.str files in this version and I can not find them anywhere

Using Lianzifu with the updated .cmd script for the STR files has only produced a single raw/strings/strings.csv file

What am I doing wrong? Are current Elex patches back to one single .bin file? If not, why am I missing the .str files for each language?

I have low technical understanding for this type of thing and it has been a learning journey. Don't feel like you need to explain in huge detail, but keeping things simple and straightforward will help my understanding.

tombom81
05.02.2024, 19:07
Using Lianzifu with the updated .cmd script for the STR files has only produced a single raw/strings/strings.csv fileThat's long ago but that's how it's supposed to be having a w_strings.bin as input file, iirc.
(You might read here (https://forum.worldofplayers.de/forum/threads/1513519-release-ELEX-string-table-un-packer-%28lianzifu%29?p=26490028&viewfull=1#post26490028) if you haven't done so so far.)

Cerulean
05.02.2024, 21:35
Thank you! I read everything again and got further...

I added an INFO line to the bottom of the relevant document and repackaged all the .csv files into a strings.bin using STARK1LLER's command script. But I get this error during packing and it fails. Any idea how to fix this?

;fail: (class std::invalid_argument) hash conflict in csv line 25027 (4027178617|info:INFO_SAVERYAN_00000001|)

tombom81
05.02.2024, 23:13
Wow, a hash conflict? It's too late atm but a first guess: to different lines result in the same hash.
Quick (and poor) workaround should be to remove said line (or modify it).

If you uploaded the zipped csv-files (or send them via PM) I could have a look at it tomorrow/today.

Good night.

Cerulean
08.02.2024, 20:11
For anyone coming into this thread in the future (like I did for some of the previous posts) I'll explain to you what happened in case you need help with your own mod. Thanks to Tombom who has been working on helping me with this for days figuring it out.

Using Lianzifu and Stark!ller's repack script, I successfully edited an unpacked infodesc.csv with a new line (which I named INFO_DESC_SAVERYAN_00000001). I then successfully repacked this, placed it properly with my other mod files I had edited, and used Elex Resman to turn it into a .pak file as a stand alone mod. I put this in the appropriate game folder and booted the game up.

Everything worked except the text.
There was a blank, clickable, space where it should be. But the mod worked otherwise.

So I checked everything; unpacking my modded w_strings.bin and using it as my base file. I was unpacking it and trying again using it. Here is the problem; where I had originally put a new string in the infodesc.csv, Lianzifu would never save the change in infodesc.csv (evidenced by packing, then unpacking again to check) so I assumed it had been deleted.

But it had not. It was converting properly to a string in the strings.csv file, but was 'deleting' my entry in the infodesc.csv file because Lianzifu comes with its own files to guide the unpacking process. Every string that gets unpacked to a specific .csv file is governed by these Lianzifu .csv files, so I had to edit lianzifu-unpack.elex.x64.infodesc.csv ...

Searching the strings.csv file, I found my added string and the hash number it converted to (ie. c94a3737 in my case). I then added my INFO_DESC prefix, the Hash number, and the standard write file (infodesc:INFO_DESC_SAVERYAN_00000001|c94a3737|#X64:/data/compiled/documents/w_info.hdr) to the lianzifu-unpack.elex.x64.infodesc.csv .

Now finally, Lianzifu would also unpack w_strings.bin and include my added string to the infodesc.csv because I had now told it to do so. But all along, the repacked w_strings.bin had successfully been packed (by way of strings.csv) with my change, Lianzifu just couldn't unpack it again in the exact same way without me telling it the line was there. But yes, it was there all along!

So the hash conflict was because I was constantly adding the same line to the infodesc.csv and packing it, forcing Lianzifu to try and duplicate it in the background (and in strings.csv), subsequently failing because it already existed - thus the hash conflict.

From there I realized my mod's issue was not a Lianzifu packing failure, but possibly a read failure by the game itself. Remembering an old post of Tombom's I simply changed the name of w_strings.bin in my mod to en.str and it works flawlessly now.

That's all - the game doesn't like w_strings.bin in mods, but is perfectly happy with en.str despite being the exact same file and in many versions of the game only using w_strings.bin in its own .pak files.

tombom81
08.02.2024, 20:45
@Cerulean: I really appreciate your contribution!§wink

I think it can help others in a similar situation.
(To be honest: I didn't think about problems that could arise, simply used lianzifu. But I still have the old patch using w_strings.bin.)

btw: my trick with the DynamicTeleport mod was to use an existing dialogue line, thus circumventing any problems that might arise. This way I could use the existing sound file, too.

Stay tuned!