Important information: this site is currently scheduled to go offline indefinitely by December 1st 2023.
If you wish to donate to attempt the preservation of tools and software somewhere else before it goes down, check the GoFundMe

Krater (PC)

The Original Forum. Game archives, full of resources. How to open them? Get help here.
kalleoskar
beginner
Posts: 35
Joined: Thu Dec 25, 2008 3:17 pm
Has thanked: 12 times

Re: Krater (PC)

Post by kalleoskar »

i would like the scripts files :) Can you make changes, and the game still works?
User avatar
lostprophet
mega-veteran
mega-veteran
Posts: 202
Joined: Wed Apr 07, 2010 7:38 pm
Has thanked: 35 times
Been thanked: 7 times

Re: Krater (PC)

Post by lostprophet »

Game works with modified language file (I tried it with Steam).

On a sidenote: watch carefully, what you translate! As of now, I found

Code: Select all

[7]
Weapons
that SHOULD NOT be translated, since it is part of a variable. If you translate it, on some weapons it will screw up the description.
Hungarian translator | Previous translations: http://lostprophet.hu
Anton666
ultra-n00b
Posts: 1
Joined: Fri Jun 22, 2012 8:56 pm

Re: Krater (PC)

Post by Anton666 »

swuforce, thanks for the tool.

Tell me, where is stored the markup fonts?
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

lostprophet wrote:since it is part of a variable. If you translate it, on some weapons it will screw up the description.
this file contains only strings for localization, variable names are not there.
User avatar
lostprophet
mega-veteran
mega-veteran
Posts: 202
Joined: Wed Apr 07, 2010 7:38 pm
Has thanked: 35 times
Been thanked: 7 times

Re: Krater (PC)

Post by lostprophet »

hhrhhr wrote:
lostprophet wrote:since it is part of a variable. If you translate it, on some weapons it will screw up the description.
this file contains only strings for localization, variable names are not there.
Just try it :)
If you translate the word above (I translated it to Fegyverek), ingame move to cursor on top of a class-specific weapon, and instead of for example: "Medikus weapon", it'll say "sv_Fegyverek".
Hungarian translator | Previous translations: http://lostprophet.hu
xentaxus
ultra-n00b
Posts: 6
Joined: Wed Feb 16, 2011 7:59 am
Has thanked: 4 times

Re: Krater (PC)

Post by xentaxus »

hi all,

i used the quickbms script of aluigi to unpack one of the files in the data directory, file 46f4455f4676790b (it doesn't process any of the 2 *.stream files), i downloaded the luadec51_2.0_win32_bin.zip file from http://files.luaforge.net/releases/luad ... 32_bin.zip, i used the oggpack script of hhrhhr with it,

Code: Select all

C:\>"C:\lua.exe" "C:\oggpacklua" "C:\Krater\data\46f4455f4676790b_unpacked"
and it outputs this.

Code: Select all

C:\lua.exe: C:\oggpacklua:1: '=' expected near 'numOggs'.
either i'm doing something wrong, or the file doesn't contain any audio data, or both.

i'm interested in the music of the game.
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

xentaxus wrote:i'm interested in the music of the game.
script 1 - http://nopaste.info/591e95f801.html, save it as "unpack1.bms"
script 2 - http://nopaste.info/039f7ba9ec.html, save it as "unpack2.bms"

step 1:
quickbms.exe -f "*.oggpak" unpack1.bms path_to_exploded_database.db output

all packed oggs will be copied to the "output" directory in the current directory

step 2:
for /r %i in (*.oggpak) do quickbms.exe unpack2.bms %i ogg

all oggs will be unpacked to "ogg" directory

for example, ogg\(e2713844e4f23f47)(8658)\(fae5f25ba0f2d3cc).ogg - start screen theme.
xentaxus
ultra-n00b
Posts: 6
Joined: Wed Feb 16, 2011 7:59 am
Has thanked: 4 times

Re: Krater (PC)

Post by xentaxus »

thank you hhrhhr
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

i'm make some tools for fully automated export/import language files. i hope it will be usefull for translators.
  1. go to https://github.com/hhrhhr/Lua-utils-for-Krater/tags, download auto-import-export.zip and unpack it.
  2. edit _include.bat, change path to game and lang code:

    Code: Select all

    :: game directory
    set krater=f:\steam\steamapps\common\krater
    :: source language
    set src_lang=eng
    :: language number (not all known)
    set src_lang_num=0
    :: target language
    set tr_lang=rus
  3. run step0_convert_localization_to_txt.bat, it convert all localized strings to text files in _work directory. these files can be used as backup of original langs
  4. now run step1_unpack_lua_scripts.bat, ~1100 scipts are unpacked and decompiled in _script directory. do not pay attention to errors, not all scripts can be decompiled. errors log can be found in _work\unlua_errors.log
  5. then run step2_export_for_translators.bat, it make _work\for_translate\*.txt.
  6. now you can start translation. do not touch words like "#cooldown seconds", "#damage_multi{percent}", "#cast_time", etc. in result you get this:

    Code: Select all

    [7f18e972]
    id  = ability_cast_area_slow_optional_text
    eng = It's a trap!
    rus = Это ловушка!
    [7f18e972] - this is unique string hash, do not modify!
    id - ingame ID of string, where hash = MurmurHash(id)
    eng - original text
    rus (or your lang) - translated text
  7. when you done (or partially done), put all translated files (not necessarily all) in _work\translated directory and...
  8. ...run step3_import_translated.bat. check what file _work\game_strings_(your_lang).txt exist, this file contains only translated strings.
  9. and finally run step4_merge_lang_save_bin.bat and look on file _work\game_strings.(your_lang).bin. copy it as krater\data\64\6477 (in v1.0.8) and test in the game.
  10. if you don't backup your original 6477, then empty _work\game_strings_(your_lang).txt (make it 0 bytes) and run step4_merge_lang_save_bin.bat again. this file is not binary equal because i'm clean some tail whitespaces, otherwise it is fully correspond to the original.
p.s.
other .bat and .lua not ready for public :) now i'm work on automated font generation. manually we can change all font for russian translation (original fonts do not support cyrillic glyphs):
Image
User avatar
lostprophet
mega-veteran
mega-veteran
Posts: 202
Joined: Wed Apr 07, 2010 7:38 pm
Has thanked: 35 times
Been thanked: 7 times

Re: Krater (PC)

Post by lostprophet »

Need update on the tools, a huge update came out this week and since then I'm getting this:
Image
I have the game, so if you need the latest files (if you don't have them) please PM me.

Thanks in advance.
Hungarian translator | Previous translations: http://lostprophet.hu
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

now the game is using LuaJIT instead of the usual Lua-bytecode. i do not know the tools to decompile LuaJIT, so updates in this part will not.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Krater (PC)

Post by Ekey »

LuaJIT can with simple commands. -bl (Byte Code + Listing)

Code: Select all

luajit -bl megacool.lua megacool.dec
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

luajit -bl...
i know. but, old decompiled Lua-bytecode:

Code: Select all

BootCampArchetypes = {}
BootCampArchetypes.norrmalm = {
  price = {
    [2] = 10000,
    [3] = 20000
  },
  name = "bootcamp_norrmalm"
}
BootCampArchetypes.bootcamp = {
  price = {
    [2] = 3000,
    [3] = 20000
  },
  name = "bootcamp"
}
decompiled from LuaJIT:

Code: Select all

-- BYTECODE -- boot_camp_settings.lua:0-24
0001    TNEW     0   0
0002    GSET     0   0      ; "BootCampArchetypes"
0003    GGET     0   0      ; "BootCampArchetypes"
0004    TDUP     1   4
0005    TDUP     2   2
0006    TSETS    2   1   3  ; "price"
0007    TSETS    1   0   1  ; "norrmalm"
0008    GGET     0   0      ; "BootCampArchetypes"
0009    TDUP     1   7
0010    TDUP     2   6
0011    TSETS    2   1   3  ; "price"
0012    TSETS    1   0   5  ; "bootcamp"
0013    RET0     0   1
it is not easy to read and the more they can not be used.
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Krater (PC)

Post by Ekey »

LuaJIT can decompile only with bytecode. Here my old tut for manualy bytecode decompiling from Legend of Grimrock. Maybe useful for you.
hhrhhr
advanced
Posts: 62
Joined: Thu Mar 18, 2010 7:02 am
Has thanked: 1 time
Been thanked: 20 times

Re: Krater (PC)

Post by hhrhhr »

it's informative, but in the game is about a thousand scripts, i used less than a half to find the ID strings.
therefore without automatic decompiler here doing nothing.
Post Reply