PDA

View Full Version : .strings.bin converter



alpaca
12-16-2006, 16:21
Well, I wrote a small Python script that unpacks some of the .strings.bin files
The problem with these things is that there are two types of these files:

The first type is unfortunately untagged, and contains no useful info for conversion into a .txt file, so I ignored it (an example of this is strat.txt, all tags are lost when it's converted to a .strings.bin file).
The second type has tags though, and this is what I can convert.

A list of the files it can't convert:
battle.txt, battle_ed.txt, shared.txt, strat.txt, tooltips.txt

You'll need to install python before you can use the script, see the read-me for more specific info.

Well, I uploaded it to the TWC download section because I currently don't have a server at my disposal:

[12-28-06]
Version 0.72 (http://www.twcenter.net/forums/downloads.php?do=file&id=1006)

Jace11
12-17-2006, 01:07
I have used your converter alpaca. I converted a bin file to a text file, edited it and placed it mymod. I ran the game and a new bin is created but in the game all text is missing - it says MISSING PLACEMENT TEXT. In this caes it was the export_units.txt that I edited and all the unit descriptions were missing.

I had a look at the text files after they are converted using your Python program.

I found I could get battle_descriptions.txt to generate a working bin file (it showed my changes in game!) but I had to edit the txt file as follows:
Here is the first lines..


¬
{(1V1)_100YRS_WAR_MP_DESCR}A battle for 2 players. Somewhere in Northern France the Hundred Years War between the English and the French rages on. Outside a small town these two Medieval super powers are about to come head to head.



I added the ¬ symbol (though I dont know for sure this is necessary) and removed the tab between {(1V1)_100YRS_WAR_MP_DESCR} and the description that follows. The tab is present in all converted text files when using your program. Maybe this is importnat maybe not.

The only other change I made was replacing [][] symbols (two boxes) that appear where spaces should be. For some reason they seem to occur towards the end of the file. I replaced them all with a single "space" using find - replace and then when I tried the file it worked!!!!

So these 3 changes could be included in your converter so it gives out text files that can be edited and used in game. I do not know if all 3 are absolutely necessary, I saw these 3 differences from comparing texts generated by your converter with those that came from CA before the patch..

Hope this helps and makes sense...

Dearmad
12-17-2006, 04:38
It sorta makes sense... but you're not a scientist- change one variable a t a time! :)

So I did... it's the little magic symbol at the start that is important: ¬

Thanks for your earlier work on fixing this!

LorDBulA
12-17-2006, 09:34
So game generates bin form standard txt files?
Good news.

alpaca
12-17-2006, 12:14
Damn, I forgot that :P
Sorry guys, I didn't test this properly...
Here's the updated version.

http://www.twcenter.net/forums/downloads.php?do=file&id=948

alpaca
12-17-2006, 13:16
Damn this is getting out of hand...
That all just happens if you don't have private beta-tester-slaves :P

Version 0.7 is linked in the first post
Jace, this should fix your problem (the square characters), too.

Jace11
12-17-2006, 15:33
It sorta makes sense... but you're not a scientist- change one variable a t a time! :)

So I did... it's the little magic symbol at the start that is important: ¬

Thanks for your earlier work on fixing this!


?????????NOT A SCIENTIST??????????

that's exactly what I am - just a lazy one:laugh4:

the most important thing was to get it to work - once that is done, I can wonder why it it works later...

Thnks for fix alpaca - modders will be grateful for this little tool.,.

Kobal2fr
12-20-2006, 22:07
Okay...

converted exportVnVs into a regular .txt, made a test change, ran the game, the change doesn't appear. Oh, and the original .strings.bin is in another directory alltogether, in fact it's not even on the same drive so it's not an issue of reading it before the converted version

Do the .txt files have to be converted back into strings.bin to be taken into account by the game ? And if so, would you please code us a reconverter :sweatdrop: ?

EDIT : oh, I didn't unpack this particular installation of the game (so that I can drop modded files right into \data, or \data\text in this case, without using modswitch and losing videos/splashscreens in the process. I do run it with --io.file_first of course), so that may also be it

alpaca
12-21-2006, 00:07
What did you do exactly?
I don't think it has something to do with the file location.

Rhedd
12-21-2006, 04:56
I have the same problem as Kobal2fr.

I can even convert a file to .txt, make NO changes whatsoever, delete the original .bin, and run the game. No new .bin will be generated.

I'm running the modded game in the same way as Kobal (using the io.file_first .bat), and the .txt file I want to recompile is the only one in the /text directory.

Oddly enough, the game makes a new FactionIntroSubTitles.txt.strings.bin every time I run it, but it doesn't compile my export_ancillaries.txt.

Kobal2fr
12-21-2006, 11:15
I added a very visible, all caps swearword (what can I say ? It just came up :sweatdrop:) in all rank names and descriptions for the BasicDiplomatSkill (that is, the displayed name, not the rankname used in the actual code, obviously). Saved, fired the game, new campaign, create diplomat, end turn.

Diplo had the unmodded skill.

The game did not create a new .strings.bin either (but as I said, it's packed)

I thought about something else during the night : I have the French version of the game. Could it be that the cultural versions are hardcoded to only use the packed .strings.bin ? Wouldn't make sense, but it could explain it I guess.

alpaca
12-21-2006, 14:06
Try using a mod folder and see what happens, I only work in mod folders atm because I don't do any texture modding.

And I don't think the other language versions are handled differently than the English one.

alpaca
12-21-2006, 15:35
Well, released another update that converts without adding tabs ;)

Rhedd
12-22-2006, 06:01
Well, I've tried the new version of your converter, and also tried using a mod directory. Didn't work. I simply don't get new .bin files.

I also have a couple of mods that I've downloaded that include .txt files that are obviously supposed to compile, and they don't work, either. I assume they SHOULD work, since I don't see anyone complaining about them on forums, so it must not be your extractor, alpaca.

I wonder if you have to install the game in the default directory, or something for it to auto-compile the new files.

Kobal, are you still having the same trouble? Do you have your game installed to the default location? (I don't.)

Solo
12-22-2006, 09:25
Well, Kobal problem should be solved without tabs. I've tested an unpacked file (export_vnvs) before the release : works perfectly. I use a mod folder & a french edition (with tabs, I couldn't get the text ingame).
Doesn't need any special installation nope. You just have to put the unpacker in the directory where the packed files are, not the same directory for me.

alpaca
12-22-2006, 15:49
Well, I've tried the new version of your converter, and also tried using a mod directory. Didn't work. I simply don't get new .bin files.

I also have a couple of mods that I've downloaded that include .txt files that are obviously supposed to compile, and they don't work, either. I assume they SHOULD work, since I don't see anyone complaining about them on forums, so it must not be your extractor, alpaca.

I wonder if you have to install the game in the default directory, or something for it to auto-compile the new files.

Kobal, are you still having the same trouble? Do you have your game installed to the default location? (I don't.)
Then chances are you probably made some mistake with your config file or something else ;) Try following the steps for creating a mod folder exactly.

alpaca
12-22-2006, 21:43
A new entry has been added to Links and Downloads Manager

Description: This small tool converts most of the .strings.bin files in data/text that were unpacked from the archives by CA's unpacker tool

To check it out, visit Tool: .strings.bin converter (https://forums.totalwar.org/vb/local_links.php?linkid=311)

Rik_Vargard
12-28-2006, 15:59
Version 7.1 ain't working for me, I just get a quick dos box that appears and disappears, so I openen the .bat file I noticed it refers to verion 7_0 ..?

So I renamed the .py file, and it works, somehow... I get the files with a little square between all the letters, and I can't even edit the text file, If I copy/paste something, it's just blank...

I have python installed since I use your texture converter...

What am I doing wrong?

Thanks and keep those great tools coming :2thumbsup:

alpaca
12-28-2006, 16:34
Version 7.1 ain't working for me, I just get a quick dos box that appears and disappears, so I openen the .bat file I noticed it refers to verion 7_0 ..?

So I renamed the .py file, and it works, somehow... I get the files with a little square between all the letters, and I can't even edit the text file, If I copy/paste something, it's just blank...

I have python installed since I use your texture converter...

What am I doing wrong?

Thanks and keep those great tools coming :2thumbsup:
Oops. Yep, the batch file doesn't specify the right script.
Anyways, the little squares are probably a result of the encoding, but they shouldn't appear on screen. Which text editor do you use?

Rik_Vargard
12-28-2006, 16:59
Heh yeah lol, shows up fine with norepad :laugh4:

Great great it's working, just added my whole new province, thanks for this, mate! :2thumbsup:

rorarii
01-02-2007, 09:06
Is the link down? :skull:

R

alpaca
01-02-2007, 14:17
Is the link down? :skull:

R
Seems to work for me.
You may have to be signed up on the TWC though, not sure.

ramladu
01-06-2007, 02:02
I'm having trouble extracting the files from 0.72. It tells me "Unknown Comment Format" when I try to extract or double click any of the files and/or drag them. Is it possible my unzip program doesn't like the files?

:help:

alpaca
01-06-2007, 16:29
I'm having trouble extracting the files from 0.72. It tells me "Unknown Comment Format" when I try to extract or double click any of the files and/or drag them. Is it possible my unzip program doesn't like the files?

:help:
Could be, you need a program that can extract .rar archives (such as WinRAR)

Sir Dinadan
01-13-2007, 04:31
I believe 7zip also does and it is free:2thumbsup: (atleast mine does)

Thank you mate for this.

Jerek Kruger
01-28-2007, 08:24
Hi,

I used your .strings.bin converter to convert imperial_campaign_regions_and_settlement_names into a text file and add a new province in. However when I delete the original .strings.bin file no new one is created when I run the game. I'm using mod folders and until I tried this everything was fine. Anyone know what I'm doing wrong?

alpaca
01-28-2007, 12:14
Hi,

I used your .strings.bin converter to convert imperial_campaign_regions_and_settlement_names into a text file and add a new province in. However when I delete the original .strings.bin file no new one is created when I run the game. I'm using mod folders and until I tried this everything was fine. Anyone know what I'm doing wrong?
Check the error log please and see if you find anything there.

Jerek Kruger
01-28-2007, 23:01
Well I just re did everything as I did before but more carefully and it worked this time. I have a new province in England and the .strings.bin file rewrote. My guess is I made a mistake in the modding such that the game crashed before the point where it generated the new bin so it was never generated. Anyway thanks.

Re Berengario I
02-02-2007, 15:04
Now what would be useful is a bin maker tool so we won't have to use a fake moddir in case we're messing with the original files using the --io.file_first.
As you probably know the game doesn't recreate bin files from new text files sitting in the original data\text folder.

Hans Kloss
02-10-2007, 21:12
Still having problem with newly added names - no new BIN file is generated and there is nothing in log.Campaign loads OK but characters appear with blank spaces instead of names

EDITED:

problem solved, it turns out names BIN file was not an original one

Mighty Oggy
02-23-2007, 15:10
Hello,

I downloaded and installed Python 2.5 and the strings.bin converter. Yesterday everything went fine, but today I changed the location of python and it doesn't work anymore. I already tried reinstalling python several times. When I run convert_all.bat windows asks me what program to use to open the .py file. Then I select python.exe, and the .bat file closes. The imperial_campaign_regions_and_settlement_names.txt.strings.bin is still there, but no .txt file.

Suggestions? Thanks in advance.

Suraknar
03-06-2007, 07:58
Is the Conversion of these files absolutelly necessary?

I mean I do recognise export_units there, and in RTW that was the file with the Dictionary descriptions, but Alpaca you said in your download section that it is usefull for other languages than English...

Does that means that there is the same for english somewhere else this time and conversion of this is only necessary if we want to edit localised text?

Thanks

EDIT: Never mind please, we have to convert there isnt any other way. So for now I do not intend on making changes of descriptions, I gonna start playing with changing Unit/Building stats, but I got your tool thanks :)

*wonders why CA made it harder to change things in such a crucial moding file this time around*

Suraknar
03-06-2007, 08:32
Hello,

I downloaded and installed Python 2.5 and the strings.bin converter. Yesterday everything went fine, but today I changed the location of python and it doesn't work anymore. I already tried reinstalling python several times. When I run convert_all.bat windows asks me what program to use to open the .py file. Then I select python.exe, and the .bat file closes. The imperial_campaign_regions_and_settlement_names.txt.strings.bin is still there, but no .txt file.

Suggestions? Thanks in advance.

How did you change the location of python?

1- Did you uninstall it and then reinstalled it in another location...

or

2 - you cut/pasted or moved its folder in another location?

If you did #2 that is where your problem is..needs to be done with way #1, unless your savy with windows registry files ;)

alpaca
03-06-2007, 14:49
Suraknar: The English files were released quite a while ago (before we had the unpacker), and I'd rather use them because they are more eye-candy.
For other languages, there's no way except for converting or directly editing the strings bin files.

Suraknar
03-07-2007, 23:28
Oops! :shame:

I forgot to look the downloads section and only sticked to the forums :)

Thank you for reminding me :whip: Alpaca :2thumbsup:

TotalWarVet
03-10-2007, 18:48
I tried to download using the following link you alluded to

http://www.twcenter.net/forums/downl...do=file&id=948

All I get is an invalid file id and I can't seem to find your converter on twcenter.

Did it get moved?

Also how do i get python scripting tool for pc? I know it exists under unix but i've never used it. Just used to shell.

:help:

alpaca
03-12-2007, 01:07
Try the link in the first post.

FactionHeir
03-25-2007, 23:23
Is there any chance you will provide a txt to string.bin converter?
As the others posting here, I'm also using the io switch instead of a mod folder (I have very limited hard disk space), so now after I converted the original file into a text file using your program and spent a few hours rewriting most of it, I'm kind of left in the cold without a means to implement it into the game - the game won't recognize it if I simply put the text file in a newly created data/text folder.

Alternatively, can someone who uses mod folders implement my 2 texts and send them back to me as per game converted?
PM me in that case please

alpaca
03-26-2007, 02:00
Well all files you really need are the maps/world/base/map.rwm file, the maps/world/base/imperial_campaign folder and text/imperial_campaign_region_and_settlement_names.txt, all in all not more than a few mb of size, so it doesn't take too much hd space... You can delete some videos to compensate, who needs videos anyways :P

Anyways, I probably won't bother to write a .txt to .strings.bin converter, because the mod folder is supposed to work properly in 1.2, so using file_first should become obsolete (and I won't do anything to stop that :smash: )

FactionHeir
03-26-2007, 11:43
Thing is I tried using MedManager after posting the above and created a "mod" with all contents of the data folder except videos and sounds and historic battles and when running it, it did not even take into account my normal changed character traits file (i.e. characters still had same trait effects as vanilla instead of my modded one)

Figure you would mind giving me an address where I can send the 2 text files to so you can run your game and convert them to bin for me?

Edit:
I uploaded it here as a rar file if you would be so kind:
http://download.yousendit.com/062D46C0488F6661

alpaca
03-26-2007, 14:06
You know, the problem with that is if I do it for you this time, you'll ask for it again, when you next have to change something.
If letting the game generate it is too complicated, you can use this tool (http://www.twcenter.net/forums/downloads.php?do=file&id=993) to directly edit the bins.

dietre
04-02-2007, 03:19
so i tried that sting editor to change the city name Rheims, to Reims and the game crashes. I hate these text files.

Even mods that have text files with them wont work. WTF

alpaca
04-02-2007, 09:03
Try using a mod folder, mate.
The io.file_first method apparently doesn't generate .strings.bin files for some people (or everybody?)

Re Berengario I
04-02-2007, 12:47
Try using a mod folder, mate.
The io.file_first method apparently doesn't generate .strings.bin files for some people (or everybody?)

With the io.file_first method it seems that the game doesn't generate strings.bin files but if they are already there and you modify the relative txt files they are appended with the new stuff you write.

So you don't have to delete them as you'd do if you use the mod folder.

Ashdnazg
04-02-2007, 13:00
@alpaca: I think there should be an organised boycott on mods that won't use the mod folder after 1.2 is out.
That will probably force the mods to be a bit more GB friendly :D

Re Berengario I
04-02-2007, 14:16
@alpaca: I think there should be an organised boycott on mods that won't use the mod folder after 1.2 is out.
That will probably force the mods to be a bit more GB friendly :D

I actually had a lot more questions about installation by users when AD used the mod folder than now that installs on a vanilla folder.

If in 1.2 CA will fix the modfolder procedure to COMPLETELY override the files in the vanilla folder maybe this could solve the problem but, as I fear, some files will always be required to be in the vanilla folder I don't think it'll be easier to have some files in a mod folder, some others overwriting the ones of vanilla, etc...

Ashdnazg
04-02-2007, 14:27
A valid concern, but that depends on what 1.2 will bring. I guess we'll have to wait and see.

alpaca
04-02-2007, 19:00
Actually I guess that the expansion will run in a mod folder again (like BI), so I guess they'll have fixed the code properly this time (because they're likely to change most files with their add-on)

Mad_BOB
05-11-2007, 03:42
Ok, i converting the files with your converter, but it produces horrible formatting. I assume this is because it's meant for use with 1.1? How can i get the txt files?

Mad_BOB
05-11-2007, 10:36
Apologies, ignore previous post, seems to work now.

medieval2
07-19-2007, 14:21
Hello

I DL your file
I DL Python 2.5 and unziped it
I have folowed the read me and placed the .Bat and .py files in the data/text file. But when I open the .bat file it says that the files are dommaged or not somthing els.
Can someon help me please. I am not a very good modder:no: .

Thanks

alpaca
07-21-2007, 09:37
Hello

I DL your file
I DL Python 2.5 and unziped it
I have folowed the read me and placed the .Bat and .py files in the data/text file. But when I open the .bat file it says that the files are dommaged or not somthing els.
Can someon help me please. I am not a very good modder:no: .

Thanks
Which files does it say are damaged?

medieval2
07-21-2007, 21:41
It was all the files but I realised that my Python was a fake with a enormes number of Virus:furious3:


thanks

alpaca
07-23-2007, 00:04
It was all the files but I realised that my Python was a fake with a enormes number of Virus:furious3:


thanks
Uhm, you probably didn't download it at python.org then?

H Con
02-01-2008, 18:23
Well, I have no problems getting the program to work, but I have another problem. I know that to replace the original file, I have to delete it from the data/text folder, so that wanted to change the faction leader's title in Sicily from King to Don, but because most of the data files are in the packs only (included the one I want to replace), there is no expanded.txt.string.bin to delete, and therefore no expanded.txt.strings.bin to replace. Is there any programs that can convert the .txt file back to strings.bin?

I have also tried to copy the original expanded...bin to the data/text folder, then started the game, exiting, deleting it, and started again. No effect. :help:

FactionHeir
02-01-2008, 19:43
You have to put the txt file into the data\text folder of a mod folder - not of a switch mod of M2TW.
Use the stripped down or basic mod folder installation and it should work for you.

Calminion
03-19-2008, 09:54
Hey guys I have the latest python downloaded and the .strings.bin converter tool, and I still cannot get the export_units file to convert. I even tried editing the .bat file as you explained in your read me to convert only that file but it wont do it.

How exactly can I get this file.
or can I download the .txt version somewhere

thanks
Cal

Iñnsomñni
04-05-2008, 17:01
I installed the strings_bin_converter, and then i went to where i had saved it, and ran the convert_all.bat, and it flashed a command promp script, i was wondering what you have to do to get it to work??? I have done everything you asked so far, and i have only had problems with this part...

irishron2004
04-05-2008, 21:23
I installed the strings_bin_converter, and then i went to where i had saved it, and ran the convert_all.bat, and it flashed a command promp script, i was wondering what you have to do to get it to work??? I have done everything you asked so far, and i have only had problems with this part...

I don't think you did or it would work. Did you read the readme? Did you install the Python program mentioned in the readme? Did you put the convert_all.bat in the data/text folder? You have to answer yes to all three to get it to work.

alpaca
04-05-2008, 22:47
If you're using vista there might be some additional settings to do, I don't quite know. I don't officially support vista because I simply have no idea how it works.

Julius_Nepos
06-07-2008, 01:35
I think I'm missing something here, I've found the resource entry on this website, but I see no means to download the converter at all, has it been removed? What is it I'm not seeing here? Maybe I'm just having a temporary seizure or something, help will be appreciated.

alpaca
06-07-2008, 22:02
You can find a link in the first post.

Demeter
02-10-2009, 13:14
Hello here,

Yesterday i found out that .strings.bin editor does not add new entries correctly.
So I wrote *txt.strings.bin unpacker into text form (non unicode) and then packer back into binary yesterday night.
Its java based. Does it worth to share it or there is a packer already?

Btw file format of .strings.bin is very simple.
First 4 bytes is the header {0x02, 0x00, 0x00, 0x08};

Then the number of translation records low byte first, high last (little endian?)
Then all the translations in the UTF-16LE format.
2 bytes - length of name followed by UTF name itself
2 bytes - length of value followed by UTF value itself

Then the number of name records low byte first, high last (little endian?)
Then all the names in the UTF-16LE format.
2 bytes - length of name followed by UTF name itself

Sometimes file ends with 2-4 trailing zero bytes.

taliesin
12-24-2009, 19:27
always share man!

ultra_topfeeder
08-05-2010, 06:47
I keep getting:
List Index out of range error

and thus I cannot convert the file, can anyone help me?

Asgard7783
08-16-2010, 02:48
anyway someone can post the text files for Kingdoms in winrar

ohoho
03-25-2013, 16:34
thanks mate !

username1999
11-08-2016, 18:43
It's not working... It just pop up a blank window for half a second and that's it... Files not converted... Nothing I can do... PLEASE HELP!!!

Stohrm
01-25-2017, 17:09
Well, I feel kind of weird asking this; as your original post was over 10 years ago; but...

I just downloaded your converter and then downloaded the newest version of Python, and then 7-Zip, etc. Followed your instructions and placed the bat and py files in my text directory and tried to convert all my bin files to txt files. No luck; as it just opened a dos window momentarily and closed it again.

So, I reread your readme file. Uninstalled the newest version Python, downloaded and installed the older version and tried it again. I got the same result as before.

Now I'm hoping your still around (or someone else in the know is and is paying attention); as I'd really like to resolve this issue as soon as possible.

Thanks,

SK

Stohrm
01-25-2017, 19:23
While I was unable to get the all feature to work; I did find that if I edited the bat file and made a separate python call to each bin file (example follows) the converter works.

ie.

strings_bin_converter.py battle_descriptions.txt
strings_bin_converter.py battle_event_subtitles.txt
strings_bin_converter.py building_battle.txt
...

So, my problem is resolved.

If I had the time, (and I may eventually), I'd dig out my book on writing batch files and fix the batch so that it's the one that finds the file(s) and such. There'd even be an option to confirm (or skip) each file (which would prevent the DOS screen from simply disappearing with no clue as to what did or did not take place).

Unless, of course this is a moot point and I'm the only one still experiencing the afore mentioned problem.

SK

Ludens
01-25-2017, 23:37
Unless, of course this is a moot point and I'm the only one still experiencing the afore mentioned problem.

No idea if it is, but thanks for letting us know, anyway.

allotaire
06-19-2017, 16:58
I've a probleme. I do the modification step by step. But when i want to launch a great capain, the game don't launch.