World of Banished

MODS Garage => Tips and Help => Topic started by: tuggistar on April 05, 2018, 01:46:13 PM

Title: Modkit Help mods translation
Post by: tuggistar on April 05, 2018, 01:46:13 PM
Do tell how banished Modkit to make and combine in one mod sets of String tables to make the translation of mods. I did not understand how to make the translation itself in Modkit training, and the mod which I enjoyed no longer translates anything from 1.0.7.  What training on this site I look for, and then there are quite a lot of them. :(
Title: Re: Modkit Help mods translation
Post by: Discrepancy on May 02, 2018, 02:12:21 AM
**I answered this on the Black Liquid website (http://blackliquidsoftware.com/index.php?/topic/1821-please-help-me-with-banishedkit/) but thought it beneficial to also add it here:




To translate a mod. You will need to alter the stringtable files.

in vanilla Banished there is the main game stringtable located within the resource folder of the modkit:

Dialog/StringTable.rsc

the game displays the text highlighted within the code: String _text = "";   so that is what will need to be translated first.

This stringtable is the most important as it is connected with most elements of the gameplay.

The other are within the Game folder, they are for the in-game help reference material (Game\Help\), and for the tutorial game options (Game\Scenario\).



Make a new folder within your modkit root folder and give it the name of your mod  (C:\BanishedKit\**your Mod Name here**)

It might be easier to copy all of the folder and files that are part of the example translation mod: example/translation

if you are also going to translate mods, you will need to also create a 'UI' folder.

Your folder structure should look like this:

C:\BanishedKit\**your Mod Name here**\Dialog\
       - StringTable.rsc                 *** this will require editing/translating

C:\BanishedKit\**your Mod Name here**\Font\
       - CharacterSet.rsc                 *** this will require editing/translating
       - Font.rsc
       - FontLarge.rsc
       - FontLargeTexture.rsc
       - FontMedium.rsc
       - FontMediumTexture.rsc
       - FontSmall.rsc
       - FontSmallTexture.rsc
       - FontTexture.rsc

C:\BanishedKit\**your Mod Name here**\Game\Help\
       - **too many to list - check the translation example mod or copy from the resource folder**

C:\BanishedKit\**your Mod Name here**\Game\Scenario\
       - **too many to list - check the translation example mod or copy from the resource folder**

C:\BanishedKit\**your Mod Name here**\Texture\
       - UITexture.rsc

C:\BanishedKit\**your Mod Name here**\UI\


It is important that you include all the folders and files above.

If applicable for your mod, the file 'CharacterSet.rsc'  will need added any other font characters that are needed to display your translation.



Translate all the stringtable files, as I said earlier altering the text within: String _text = "**translate this text**" ;

If translating mods, download the available stringtables,

You will find most of the mods will have them within the UI folder, but you should check each mod by loading it up in game and looking at the mod info in the mod list and scroll through the list of included code files and note down the location and names of the stringtables. (most will be in UI folder: UI/MODNAMEStringTable.rsc, others might also have them within the Dialog folder: Dialog/MODNAMEStringTable.rsc)

Ensure you place them within the same named corresponding folders in your mod.



Create/Copy and edit your Package.rsc folder (located: C:\BanishedKit\**your Mod Name here**\Package.rsc)

on line# 1 of the code it is best to give the mod the same name as what the folder is called:

PackageFile **your Mod Name here**
{
String _name = "**your full Mod Name here**";
String _author = "tuggistar";
String _description = "This is a translation mod by tuggistar.";
String _icon = "icon.png";
String _preview = "preview.jpg";
int _userVersion = 1;

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

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


complete the rest of the Package.rsc file.

Below the above part is where you must call up all the stringtable files you have altered:

ExternalList list
{
External _resources
[
"Font/Font.rsc"
"Font/FontMedium.rsc"
"Font/FontSmall.rsc"
"Font/FontLarge.rsc"

"Game/Scenario/TutorialCommon.rsc:tutorialGeneral"
"Game/Scenario/TutorialFood.rsc:tutorialStrings"
"Game/Scenario/TutorialGettingStarted.rsc:tutorialStrings"
"Game/Scenario/TutorialSurvival.rsc:tutorialStrings"
"Game/Scenario/TutorialTrade.rsc:tutorialStrings"

"Game/Help/HelpTopics.rsc"

"Dialog/StringTable.rsc:achievement"
"Dialog/StringTable.rsc:autoSave"
"Dialog/StringTable.rsc:citizenActions"
"Dialog/StringTable.rsc:climate"
"Dialog/StringTable.rsc:clothing"
"Dialog/StringTable.rsc:common"
"Dialog/StringTable.rsc:disaster"
"Dialog/StringTable.rsc:diseases"
"Dialog/StringTable.rsc:events"
"Dialog/StringTable.rsc:gameDialogs"
"Dialog/StringTable.rsc:gameKeys"
"Dialog/StringTable.rsc:general"
"Dialog/StringTable.rsc:globalNames"
"Dialog/StringTable.rsc:graphKeys"
"Dialog/StringTable.rsc:graphTypes"
"Dialog/StringTable.rsc:graphYears"
"Dialog/StringTable.rsc:inventorySort"
"Dialog/StringTable.rsc:inventoryType"
"Dialog/StringTable.rsc:keyNames"
"Dialog/StringTable.rsc:loadingDetails"
"Dialog/StringTable.rsc:mainMenu"
"Dialog/StringTable.rsc:merchant"
"Dialog/StringTable.rsc:multiSample"
"Dialog/StringTable.rsc:objects"
"Dialog/StringTable.rsc:orderTypes"
"Dialog/StringTable.rsc:productionYears"
"Dialog/StringTable.rsc:professions"
"Dialog/StringTable.rsc:purchaseTypes"
"Dialog/StringTable.rsc:rawMaterial"
"Dialog/StringTable.rsc:reflectionQuality"
"Dialog/StringTable.rsc:scenario"
"Dialog/StringTable.rsc:seasons"
"Dialog/StringTable.rsc:shadowDetail"
"Dialog/StringTable.rsc:shadowResolution"
"Dialog/StringTable.rsc:startConditions"
"Dialog/StringTable.rsc:terrainSize"
"Dialog/StringTable.rsc:terrainType"
"Dialog/StringTable.rsc:textureFilter"
"Dialog/StringTable.rsc:toolBar"
"Dialog/StringTable.rsc:toolType"
]
}


Even though you do not alter the files: Font.rsc, FontMedium.rsc, FontSmall.rsc, FontLarge.rsc, you must call them as they individually call up the CharacterSet.rsc file themselves, and depending on how many characters added, you might need to alter the size code within those files: int _sheetWidth = 256;    int _sheetHeight = 128; (when trying to build the mod you will be given a warning if size is too small).



I think for better translating and seeing some of the changes occur in game, you might find it easier to build and package your mod in stages and play through modkit before packaging.

you will need to make 3 TextDocument.txt files, you will then rename them, along with the file name extension:

in the first text document file, insert and edit the following code (once again substituting **your Mod Name here** with the folder name you made earlier):

..\bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../**your Mod Name here** /pathdat ../**your Mod Name here**/bin
pause


now rename the file to: 01build.bat



the next text file:

..\bin\x64\Application-x64-profile.exe /ref Package.rsc:list /pathres ../**your Mod Name here** /pathdat ../**your Mod Name here**/bin
pause


rename to: 02run.bat



the last text file:

..\bin\x64\Tools-x64.exe /mod Package.rsc:**your Mod Name here** /pathres ../**your Mod Name here** /pathdat ../**your Mod Name here**/bin
pause


rename to: 03package.bat



Now you can build your mod by double clicking on the 01build.bat file you created, and if done correctly it should build with no errors.

If you then run the file 02run.bat it will start the modkit game environment, where you can run the game and see if your changes have worked and displaying correctly. If you pause the game and Alt-Tab out of the game you should be able to make translation changes while the game is playing in background allowing you to see changes right after you make and save them.

Once happy with what you have done. it is best to delete the bin and build folder and contents that the 01build.bat made. Then re-build the mod again by double clicking 01build.bat .

make your mod icon.png image (48x48px icon displayed in modlist) and if adding mod to steam the preview.jpg image (360x360px image, displayed on steam workshop)

you can now skip 02, and go straight to 03package.bat, double-click and it will package your mod into the .pkm mod file. once packaged you will find it located within the folder:

C:\BanishedKit\bin\WinData\



Title: Re: Modkit Help mods translation
Post by: tuggistar on May 02, 2018, 01:23:48 PM
Really thank you very much for helping discrepancy. ;D I didn't know where else to ask. Good luck with your mod developments and thanks. :) How time will do.
Title: Re: Modkit Help mods translation
Post by: RedKetchup on May 02, 2018, 01:37:46 PM
you are very welcomed Tuggi. here, mostly you will always find someone to help you, although we are individually not good at everything, we all have our strenght :)
Title: Re: Modkit Help mods translation
Post by: Redblock69 on October 28, 2018, 06:53:29 PM
Hello everyone !  :)

I start create a french translation because previous french translation were not update but i have a problem with the 03package.bat file.

When i double-click on 03package.bat, i have no errors but when i go to the bin folder, i d'ont have any .pkm file ?  ???

Do you know where it can come from?

Thank you in advance ! Redblock69  ;)
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 01:33:49 AM
tell us what contain your 01.bat and 02 bat and 03 bat and your package.rsc
Title: Re: Modkit Help mods translation
Post by: kid1293 on October 29, 2018, 01:36:44 AM
There is one bin folder in mod directory
and there one bin folder in ModKit directory.

Maybe you are looking at the wrong place?
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 02:06:29 AM
Quote from: kid1293 on October 29, 2018, 01:36:44 AM
There is one bin folder in mod directory
and there one bin folder in ModKit directory.

Maybe you are looking at the wrong place?

yeah do you have a WinData folder there ? if not , this is because you dont look inside the good bin folder.
Title: Re: Modkit Help mods translation
Post by: Redblock69 on October 29, 2018, 05:14:46 AM
Hi !

I looked in the bin folder of the ModKit and in the bin folder of my mod but in both cases, no .pkm file appeared.


Here is the content of my .bat files :

01build : ..\bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../FrenchTranslation /pathdat ../FrenchTranslation/bin pause
02run : ..\bin\x64\Application-x64-profile.exe /ref Package.rsc:list /pathres ../FrenchTranslation /pathdat ../FrenchTranslation/bin pause
03package : ..\bin\x64\Tools-x64.exe /mod Package.rsc:FrenchTranslation /pathres ../FrenchTranslation /pathdat ../FrenchTranslation/bin pause



And here is the content of my Package.rsc :


PackageFile FrenchTranslation
{
   String _name = "Traduction Française Banished";
   String _author = "Redblock69";
   String _description = "Ce mod est une traduction française de Banished crée par Redblock69. Cette traduction est compatible avec Banished Version 1.0.7 Build 170910. Cette traduction est susceptible de causer des problèmes si vous l'utilisez avec d'autres mods. Bon jeu !";
   String _icon = "icon.png";
   String _preview = "preview.jpg";
   int _userVersion = 1;

   // all files in resource directory
   String _includeList
   [
      "*"   
   ]
   
   // exclude package files, mod files, file used for building packages
   String _excludeList
   [
      "Package_*.crs"
      "*.pkg"
      "*.pkm"
   ]
}

ExternalList list
{
   External _resources
   [
      "Font/Font.rsc"
      "Font/FontMedium.rsc"
      "Font/FontSmall.rsc"
      "Font/FontLarge.rsc"

      "Game/Scenario/TutorialCommon.rsc:tutorialGeneral"
      "Game/Scenario/TutorialFood.rsc:tutorialStrings"
      "Game/Scenario/TutorialGettingStarted.rsc:tutorialStrings"
      "Game/Scenario/TutorialSurvival.rsc:tutorialStrings"
      "Game/Scenario/TutorialTrade.rsc:tutorialStrings"

      "Game/Help/HelpTopics.rsc"

      "Dialog/StringTable.rsc:achievement"
      "Dialog/StringTable.rsc:autoSave"
      "Dialog/StringTable.rsc:citizenActions"
      "Dialog/StringTable.rsc:climate"
      "Dialog/StringTable.rsc:clothing"
      "Dialog/StringTable.rsc:common"
      "Dialog/StringTable.rsc:disaster"
      "Dialog/StringTable.rsc:diseases"
      "Dialog/StringTable.rsc:events"
      "Dialog/StringTable.rsc:gameDialogs"
      "Dialog/StringTable.rsc:gameKeys"
      "Dialog/StringTable.rsc:general"
      "Dialog/StringTable.rsc:globalNames"
      "Dialog/StringTable.rsc:graphKeys"
      "Dialog/StringTable.rsc:graphTypes"
      "Dialog/StringTable.rsc:graphYears"
      "Dialog/StringTable.rsc:inventorySort"
      "Dialog/StringTable.rsc:inventoryType"
      "Dialog/StringTable.rsc:keyNames"
      "Dialog/StringTable.rsc:loadingDetails"
      "Dialog/StringTable.rsc:mainMenu"
      "Dialog/StringTable.rsc:merchant"
      "Dialog/StringTable.rsc:multiSample"
      "Dialog/StringTable.rsc:objects"
      "Dialog/StringTable.rsc:orderTypes"
      "Dialog/StringTable.rsc:productionYears"
      "Dialog/StringTable.rsc:professions"
      "Dialog/StringTable.rsc:purchaseTypes"
      "Dialog/StringTable.rsc:rawMaterial"
      "Dialog/StringTable.rsc:reflectionQuality"
      "Dialog/StringTable.rsc:scenario"
      "Dialog/StringTable.rsc:seasons"
      "Dialog/StringTable.rsc:shadowDetail"
      "Dialog/StringTable.rsc:shadowResolution"
      "Dialog/StringTable.rsc:startConditions"
      "Dialog/StringTable.rsc:terrainSize"
      "Dialog/StringTable.rsc:terrainType"
      "Dialog/StringTable.rsc:textureFilter"
      "Dialog/StringTable.rsc:toolBar"
      "Dialog/StringTable.rsc:toolType"
   ]
}

--------------------------

Thank you in advance ! Redblock69  :)
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 06:23:32 AM
Quote from: Redblock69 on October 29, 2018, 05:14:46 AM
I looked in the bin folder of the ModKit and in the bin folder of my mod but in both cases, no .pkm file appeared.

everything you wrote seems fine.

the only thing is that sentence above : it is not in the bin folder of the Modkit but it is in the /Bin/WinData folder of the Modkit
Title: Re: Modkit Help mods translation
Post by: Redblock69 on October 29, 2018, 06:31:20 AM
Hi !

I put you in an attachment what I get in the cmd.

I double click on 03package.bat, the cmd opens and execute a command and that's all, then when I go to the bin/WinData folder, there is no .pkm file created.

Redblock69
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 06:35:02 AM
ok.

try this :

remove the _1.0.7.170910 of your BanishedKit name of your folder
call it just "BanishedKit" only
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 06:36:15 AM
also redo operation 1 too

run 01build.bat and then after run 03package.bat
Title: Re: Modkit Help mods translation
Post by: Redblock69 on October 29, 2018, 06:44:27 AM
Hi !

Thank you so much ! Now everything is working properly and I have the .pkm file. The problem was simply the name of the BanishedKit folder.  :D

I wish you a pleasant day and thank you again!  :)
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 06:47:58 AM
GREAT I'm so happy you resolved it :)
Le toolkit n'aime vraiment pas les caractères étranges et spéciaux. hehe

you too. i wish you a Great Day !!

Passe une très belle journée :)
Title: Re: Modkit Help mods translation
Post by: Redblock69 on October 29, 2018, 07:55:36 AM
Hi.

I also have another question: Do you know if it is possible to decompile a .pkm file to see what it contains, to translate texts, etc ...?

Redblock69
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 10:18:37 AM
Quote from: Redblock69 on October 29, 2018, 07:55:36 AM
Hi.

I also have another question: Do you know if it is possible to decompile a .pkm file to see what it contains, to translate texts, etc ...?

Redblock69

no , impossible to extract . the .pkm are compressed and crypted by a Luke's personal encryption compressor.
Title: Re: Modkit Help mods translation
Post by: RedKetchup on October 29, 2018, 10:21:21 AM
Quote from: Redblock69 on October 29, 2018, 07:55:36 AM
Hi.

I also have another question: Do you know if it is possible to decompile a .pkm file to see what it contains, to translate texts, etc ...?

Redblock69

the way to go is you ask the stringtables to the modders, they generally agree to do. you take the stringtables and you translate them, and then you do a new .pkm calling these stringtables. and you offer those mini .pkm's to your people so they can put above and get the mod translated.