World of Banished

MODS Garage => Tips and Help => Topic started by: bagi576 on June 01, 2019, 05:13:00 PM

Title: Need a help with main game translation mod :-/
Post by: bagi576 on June 01, 2019, 05:13:00 PM
Hello there. I'm new here and will be honest and cut my speech.
First things first, i've already translated few games into my native language ( Mongolian ). i bought this game when it released on steam. Last month played again The Banished ( guess after 4-5 years ) and saw there many mods which called translations. I was like wtf yolod and started translating. Now i'm facing with some confusing problems with some characters. builtExpample.bat gives me error with Unexpected character '*' or ';' or 'E' or ':' etc. So it is my problem #1. Can't figure it out how the heck it's happening even it's already in CharacterSet file. Also FontSheet gives me error as well
Please see CharacterSet.rsc CharacterSet resource
{
// notes
// this file needs to be UTF16 little endian if it contains characters over index 255
// fonts that use this character set need to support all the characters listed here
// ~ is a special escape character, so ~~ is required to add tilde to the set, ~" is needed for quotation marks

String _characters = "

// Special escape characters
~~ ~"

// Punctuation
`!@#$%^&*()_+-={}|[]\:;'<>?,./©

// Numbers
01234567890

// characters for English
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqustuvwxyz
// additional characters
АБВГДЕЁЖЗИЙКЛМНОӨПРСТУҮФХЦЧШЫЭЮЯ
абвгдеёжзийклмноөпрстуүфхцчшьыэюя

";
}



Here is my result when i run BuildExamples.bat

Batch runs then gave me error #1 (please see the attached pic1

(https://i.ibb.co/YBWKWmy/Unexpected-character-toolkit-1-0-7.png)

when i click on Ignore button gives me about 3 same error with characters ( like i said '*' ';' ':' )
then gives me error #2 (please see the attached pic2

(https://i.ibb.co/cyFy5wQ/unexpected-token-while-looking-for-type.png)

again, i clicked Ignore for another error #3 ( please see the attached pic3

(https://i.ibb.co/z5NPGT7/End-of-file-found-while-parsing-array.png)

then gives me error #4 (please see the attached pic4)

(https://i.ibb.co/dgp0xjq/End-of-file-found-while-parsing-user-defined.png)

by clicking Ignore button batch runs about 5 seconds and it closes.

Problem #2

Assert: Sprite Sheet 'Build\FontSheet.rsc:resource' isn't large enough to hold all sprites

I will put here my CharacterSet.rsc, Font.rsc, FontLarge.rsc, FontMedium.rsc, FontSmall.rsc files.

CharacterSet.rsc

CharacterSet resource
{
// notes
// this file needs to be UTF16 little endian if it contains characters over index 255
// fonts that use this character set need to support all the characters listed here
// ~ is a special escape character, so ~~ is required to add tilde to the set, ~" is needed for quotation marks

String _characters = "

// Special escape characters
~~ ~"

// Punctuation
`!@#$%^&*()_+-={}|[]\:;'<>?,./©

// Numbers
01234567890

// characters for English
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqustuvwxyz

// additional characters
АБВГДЕЁЖЗИЙКЛМНОӨПРСТУҮФХЦЧШЫЭЮЯ
абвгдеёжзийклмноөпрстуүфхцчшьыэюя

";
}



Font.rsc

Font resource
{
CharacterSet _characterSet = "Font/CharacterSet.rsc";
String _fontName = "Arial";
int _fontHeight = 24;
String _sheetName = "Build/FontSheet.rsc";
int _sheetWidth = 256;
int _sheetHeight = 128;
String _materialName = "Font/FontMaterial.rsc";
String _imageName = "Build/uiFontImage.png";
}


FontLarge.rsc


Font resource
{
CharacterSet _characterSet = "Font/CharacterSet.rsc";
String _fontName = "Arial";
int _fontHeight = 48;
String _sheetName = "Build/FontLargeSheet.rsc";
int _sheetWidth = 512;
int _sheetHeight = 256;
String _materialName = "Font/FontLargeMaterial.rsc";
String _imageName = "Build/uiFontLargeImage.png";
}


FontMedium.rsc


Font resource
{
CharacterSet _characterSet = "Font/CharacterSet.rsc";
String _fontName = "Arial";
int _fontHeight = 18;
String _sheetName = "Build/FontMediumSheet.rsc";
int _sheetWidth = 256;
int _sheetHeight = 128;
String _materialName = "Font/FontMediumMaterial.rsc";
String _imageName = "Build/uiFontMediumImage.png";
}


FontSmall.rsc


Font resource
{
CharacterSet _characterSet = "Font/CharacterSet.rsc";
String _fontName = "Arial";
int _fontHeight = 14;
String _sheetName = "Build/FontSmallSheet.rsc";
int _sheetWidth = 128;
int _sheetHeight = 128;
String _materialName = "Font/FontSmallMaterial.rsc";
String _imageName = "Build/uiFontSmallImage.png";
}


Every opinions will helpful to me. I already fighting with this *.rsc files and with errors almost week. Couldn't find any solution in internet even Google couldn't help.

Thank you for advance and i will update if something happens. Cheers !
Title: Re: Need a help with main game translation mod :-/
Post by: Tom Sawyer on June 02, 2019, 03:12:34 AM
Your character set looks right. The error messages tell about syntax errors in StringTable.rsc line 2688 etc.. Probably you missed there some ; or ". Such mistakes also can be in lines before the compiler notice an error. So you have to look through your translation and fix it.

The second problem is a sprite sheet to small to hold all your additional characters. Just increase it to a bigger value. 512 x 512 should be enough. To set in your font..rsc files as sheetWidth and sheetHeight = 512.
Title: Re: Need a help with main game translation mod :-/
Post by: bagi576 on June 02, 2019, 04:06:27 AM
Thank you for reply. In the line 2688 is character '*' thats gave me error (i already attached picture as well above and also other characters such as ';' ':' also gaves me error. Will try bigger value as you recommend and let you know. Many thanks again Tom Sawyer
Any ideas would be helpful best regards
Title: Re: Need a help with main game translation mod :-/
Post by: Tom Sawyer on June 02, 2019, 01:49:41 PM
You can copy the lines here where you still get errors, so we can look what exactly is wrong. Or via PM.
Title: Re: Need a help with main game translation mod :-/
Post by: bagi576 on June 02, 2019, 02:45:28 PM
Dear Tom, thanks to you i already made it and checking bugs.
Many thanks to whoever saw this topic. I just increased value of up to 512 as you recommended, result was great any of *.bat didn't gave me error. Everything went without error.
Problem was there where is some miss characters " (it's hard to notice if you already scrolling up and down between 5000 line strings). So i checked everything again and it worked.
Many thanks and best regards.
Title: Re: Need a help with main game translation mod :-/
Post by: RedKetchup on June 02, 2019, 04:21:32 PM
sweet !
i was following your post. i was hoping to be some kind of utility... but i am total noob in translations structure and i know i wouldnt be able to post anything usefull..
so i am happy you fixed it. maybe who knows, you can become our expert on this ^^ many people ask advice on this.....
Title: Re: Need a help with main game translation mod :-/
Post by: bagi576 on June 03, 2019, 12:43:28 AM
Hello RedKetchup,
Funny thing is i followed your topic too. And found there useful things :)

If there is anyone who stuck at translating i'd like to help as well. Just one damn character " ' " can ruin all stringTable things :)

So i've checked everything 100% then i run BuildExample.bat ( it runs without error if there is no character error and fontsheet size is large enough )
Then i used the commands which used for compiling i found here (http://worldofbanished.com/index.php?topic=2339.msg48545#msg48545) on  Discrepancy (http://worldofbanished.com/index.php?action=profile;u=4163)'s post as 03Package.bat

bin\x32\Tools-x32.exe /mod Package.rsc:***Your mod name*** /pathres ../***Your mod folder*** /pathdat ../***Your mod folder***/bin
pause


You have to pay attention here:

***Your mod folder*** - this folder name must be same as where your translation and package.rsc, icon.png, preview.png located.

***Your mod name*** - must be same as PackageFile *NAME* in Package.rsc (see below, in my case my translation mod will be named Mongolian)



PackageFile Mongolian
{
String _name = "Your mod name";
String _author = "Your name";
String _description = "Your mod description
";
String _icon = "icon.png";
String _preview = "preview.jpg";
int _userVersion = 9;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"