Blocks That Matter

Blocks That Matter

49 ratings
TUTORIAL CUSTOM LANGUAGE
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
32.937 KB
Oct 8, 2012 @ 8:09am
1 Change Note ( view )

Subscribe to download
TUTORIAL CUSTOM LANGUAGE

Description
Tutorial: How to add a custom text database to the game:

----
1/ RUN IN WINDOWED MODE
To ease the use of such a feature, it will be easier to run the game in Windowed Mode. You can choose "Res.80% (Win)" from the "Options" menu and hit enter.
http://steamcommunity.com/sharedfiles/filedetails/?id=101562455
----
2/ GO INTO YOUR GAME FOLDER
Go to your game folder (C:\Program Files (x86)\Steam\steamapps\common\blocks that matter by default in Win7/Vista).
You can read the "custom_languages/how_to/README.txt" that will do exactly what we are going to describe in the next lines :)
----
3/ COPY THE TEMPLATE FILES
Copy "custom_languages/how_to/Template/xx/" into "custom_languages/datas/".
----
4/ CHOOSE LANGUAGE ID
My example is "ws", so I renamed the "xx" folder into "ws".
----
5/ EDIT TEXT.XML
Reuse an existing xml tag (by renaming it) or add a new xml tag for each text you cant to translate (using your language ID as xml tag, in this example "<ws")
http://cloud.steampowered.com/ugc/560954765820814167/D122E7783900BDB1F5717FB6875D837289C3253C/
----
6/ RUN THE TEXT EDITOR
Make sure the game is using your custom language ID (set it up like in 1).
http://steamcommunity.com/sharedfiles/filedetails/?id=101583707
Then make sure the "Font.xml" file got a xml tag "Debug" on 1 (<Debug value="1" />) and restart the game. The Text Editor will show up (with a spoiler alert)
http://steamcommunity.com/sharedfiles/filedetails/?id=101583398
----
7/ ITERATE!
Bring modifications to your "Text.xml", and hot reload the changes in the Text Editor (Ctrl+R). You can also go to the game menus by hitting Ctrl+Enter (use F1 in the Editor for a full list of shortcuts)
----
8/ SUBMIT IT TO THE WORKSHOP!
Once your Text.xml is content ready, complete the Empty field in "Font.xml" (Title, Desc, Author), save them.
When you are in the text viewer editor: hit F5 to submit to the workshop.
A yellow text "Submitting to the Workshop" will appear. Wait until it's done.
Once the text disappeared, your item should be on the Workshop! congratz!
To check your item, you can press F6 to open a Steam Overlay on your item. You can edit the description, add some images or rename the title to suit your needs!
----
9/ SUBSCRIBE TO LANGUAGE FILE
You can subscribe to the language file you've just submitted by going into the "Options", then highlight the Language entry and press the key to open the Workshop.
http://steamcommunity.com/sharedfiles/filedetails/?id=101583299

Now you can subscribe to any language item.
http://steamcommunity.com/sharedfiles/filedetails/?id=101583201
----
10/ CUSTOMIZE FONT
If the language you want to use need a custom font, you can tweak the "Font.xml" file by removing the <!-- --> around the "<Name value="deffont.ttf" />" and "<AdditionalGlyphRange from="32" to="255" />".
Then you'll have to make sure the deffont.ttf (or any name you want) is a real existing file containing the font you want to use.

For example, in this picture:
http://cloud-2.steampowered.com/ugc/560955325150964916/394301335C31A4BBD561CE46314842A6FB7380B2/

I'm using using the font "Pixel Cyr" to test some Cyrillic character. Here is what I have done to achieve this:
a/ I removed the existing deffont.ttf from the folder (which is the Nokia Cellphone font).

b/ I pasted the "pixelcyr.ttf" in my testing "ru" folder.

c/ I edited the "Font.xml" file by removing the <!-- --> around
<Name value="deffont.ttf" /> and <AdditionalGlyphRange from="32" to="255" />

d/ I tweaked those 2 xml tags, so they become:
<Name value="pixelcyr.ttf" /> and <AdditionalGlyphRange from="1025" to="1169" />

Note: the 1025 / 1169 additional glyph range was given by a table I found on the internet, describing the glyph table for the font "Pixel Cyr Normal" I was using. (you can see these table on the left of the screenshot). There are Hexadecimal or Decimal values in top of each characters, you have to report the Decimal one into the "Font.xml"

If you want to use various glyph ranges, you can add any number of line you like in the Font.xml, for example:
<AdditionalGlyphRange from="1025" to="1169" />
<AdditionalGlyphRange from="2000" to="3000" />
<!-- etc -->
----
11/ DEBUGGING
It's easy to make a mistake in the "Texts.xml" file. As a consequence, when you try to select your custom language in the "Options" menu, the game might re-select the "en" default language.
To have hints on the errors that occur, you can run the game in "Console Mode".

To do so, start the game by using the "BTM_DBG_launcher_win_bis.bat" situated in the game folder (C:\Program Files (x86)\Steam\steamapps\common\blocks that matter).
Then, when an error occurs, it will be logged in the Console. For example, if I made a mistake in my "Texts.xml" file, an error will pop in the Console when I try to select my language in the Options.

The image below recaps the process:
http://cloud.steampowered.com/ugc/560955325130213675/E1CEF4B7279FC77360EA5D48148ED8442BB5F6E6/
----
43 Comments
minipol Oct 27, 2012 @ 5:02am 
Hi nitram!

I tried the other two computers. The same symptoms.
My own attempt, but did not vary in a number of ways.

Other way unless the existing methods can not.

The file is uploaded to my blog.
Those who want to will be able to be downloaded through the search.

I personally regret.
I had vainly bother you.
And Thank you.
minipol Oct 25, 2012 @ 8:45am 
Hi nitram!

You said "workshop_donotdelete" folder did not exist.

I did all the things you described.
Nevertheless, the situation is the same.

I link to the translated files.
http://www.datafilehost.com/download-a35e05d4.html

I'll try again on a different computer.
Then I'll tell you again.
nitram  [author] Oct 25, 2012 @ 6:47am 
minipol, can you also check that you don't have any firewall that could avoid the game to send data to the Internets.

To check that, you can try to run the game in windowed mode (choose "Res 80% (win)" from the options and press Enter.

Then while the game is trying to send some data to the Workshop, maybe a window will pops out, asking you to authorize some operations from the application.

You can also try to run the game in administrator mode: right click on icon/shortcut > "Run as Administrator"

Sorry for all those bugs :/ Can't wait to subscribe to your work!

You can also send me your zipped language folder, so I can run test on it (but I don"t think that the problem comes from your files).
nitram  [author] Oct 25, 2012 @ 6:39am 
Hi minipol,

Thanks for your tests!

1/ Can you tell me if you ahve a "workshop_donotdelete" folder in your language folder?
(C:\Program Files (x86)\Steam\steamapps\common\blocks that matter\custom_languages\datas\ko) (assuming that "ko" is the tag you choose).

2/ If "workshop_donotdelete" exists, what's inside the folder? (name of the files)

3/ If it exists, you can try to remove the "workshop_donotdelete".

4/ Can you try again by double clicking the "BTM_DBG_launcher_win_bis.bat" in
C:\Program Files (x86)\Steam\steamapps\common\blocks that matter, instead of double cliking the desktop icon?
Then re-submit your language (with the "workshop_donotdelete" folder deleted before you submit)
minipol Oct 25, 2012 @ 3:27am 
Hi nitram!

1"BTM_launcher_win.exe" or "javaw.exe" or "java.exe" no running processes => OK

2 I run the game icon on the desktop.
Of course, the steam client on the state.

3 Steam overlay
http://steamcommunity.com/sharedfiles/filedetails/?id=104572527

Result: Same

On my computer, the problem does not seem to
But I do not know why not.

Something else cause the problem exist?
nitram  [author] Oct 25, 2012 @ 12:56am 
Part2 (it wasn't fitting in the 100 characters limit)

NO ID TEXT FOUND errors:
Those errors are "normal".
In fact it's due to the Dialog Database not being cleaned correctly.
Since you don't have access to this database, it's not your fault.
I should clean the Dialog Database, because it tries to reference texts IDs that are not existing anymore. Hopefully those "dialog referencing outdated texts IDs" are not used in the game.

Thanks for pointing that out! I'll remove those dialog from the database!
nitram  [author] Oct 25, 2012 @ 12:54am 
Hi minipol!

It's a weird issue you have.

Can you try to:
1/ Make sure that there is no "BTM_launcher_win.exe" or "javaw.exe" or "java.exe" in your running processes (accessible with Ctrl+Shift+Escape) when the game is not launched. If there are any of them, just kill them!

2/ Make sure the Steam Client is launched. If you are using the .bat to launch the game, I think you can access the Texts/Dialog debug viewer without being connected to Steam.
So maybe the the game is not connected and then it thinks the item has been submitted to the Workshop.

3/ Make sure you have access to the Steam Overlay while in the Texts/Dialog viewer editor (Shift+Tab by default). If you have not access to the Overlay, shutdown the game, try restarting the Steam Client, and relaunch the game after that.
minipol Oct 24, 2012 @ 11:06pm 
Hi nitram!

hit F5 and in the middle of the screen is displayed as "Submitted to Workshop! Press F6 to see Workshop page."

However, by pressing F6 does not work.

Below the "NO ID TEXT FOUND" will be displayed on the editor.

"DLG_TEST_PORTRAITS" (49/58)
"DLG_THANKS_1" (51/58)
"DLG_THANKS_2" (52/58)
"DLG_UPGRADE_DRILL1" (53/58)
"DLG_UPGRADE_DRILL2" (54/58)
"DLG_UPGRADE_DRILL3" (55/58)
"DLG_UPGRADE_PUZZLE" (56/58)
"TXT_DLG_TEST" (57/58)
"TXT_DLG_TUTO_01_STEP_01" (58/58)

But, 'Text.xml' do not have this dialog.
nitram  [author] Oct 24, 2012 @ 5:27am 
Great Bennievv!

That's our fault, the editing system is not very cool because you have to take care of the syntax.
We will do better tools for next games!