Jump to content

Problem with csv files (kirikiri2)


yuyuko190

Recommended Posts

[Problem Solved]

I work on vietnamese translation for sengoku gensokyo (engine kirikiri2) but i got a problem. Here's error log

 

 

 
 
12:27:14 ==== An exception occured at _data-make.ks(328)[(top level script) global], VM ip = 16084 ====
12:27:14 -- Disassembled VM code --
12:27:14 #(328) f.thchara[48][3] = 0; f.thchara[49][3] = 0;
12:27:14 00016063 const %1, *820 // *820 = (int)0
12:27:14 00016066 gpd %2, %-2.*805 // *805 = (string)"f"
12:27:14 00016070 gpd %3, %2.*813 // *813 = (string)"thchara"
12:27:14 00016074 const %4, *821 // *821 = (int)48
12:27:14 00016077 gpi %5, %3.%4
12:27:14 00016081 const %6, *822 // *822 = (int)3
12:27:14 00016084 spie %5.%6, %1
12:27:14 -- Register dump --
12:27:14 %-3=(int)6  %-2=(object)(object 0x0012DACC:0x00000000)
12:27:14 %-1=(object)(object 0x00C68228:0x00C68228)  %0=(void)  %1=(int)0
12:27:14 %2=(object)(object 0x01503EC8:0x01503EC8)  %3=(object)(object 0x0EBA574C:0x0EBA574C)
12:27:14 %4=(int)48  %5=(void)  %6=(int)3  %7=(int)21  %8=(int)1  %9=(int)0  %10=(string)" 分 "
12:27:14 %11=(object)(object 0x01503EC8:0x01503EC8)  %12=(object)(object 0x0EAC8A14:0x0EAC8A14)
12:27:14 %13=(int)2  %14=(int)0  %15=(string)" 秒"  %16=(object)(object 0x01503EC8:0x01503EC8)
12:27:14 %17=(object)(object 0x0EAC8A14:0x0EAC8A14)  %18=(int)3
12:27:14 ----------------------------------------------------------------------------------------------
12:27:14 trace : 
12:27:14 エラーが発生しました
ファイル : _data-make.ks   行 : 473
タグ :  ( ← エラーの発生した前後のタグを示している場合もあります )
_data-make.ks の 行 4 から始まる iscript ブロックでエラーが発生しました。
( 詳細はコンソールを参照してください )
(void) から Object へ型を変換できません。Object 型が要求される文脈で Object 型以外の値が渡されるとこのエラーが発生します
It happen when i try convert csv files to USC2-Little endian. 
 
Anyone know how to fix this problem? I'm very thankful.
Link to comment
Share on other sites

Found a piece of code on the internet, so try this for me. Go to the file "_data-make.ks" and look for the line:

// #################### 東方キャラのデータCSVを読み込み ####################

And just after it paste the following code:

Plugins.link("csvParser.dll");
with(global.CSVParser) {
    .origParseStorage = .parseStorage;
    .parseStorage = function (filename, utf8) {this.parse([].load(filename).join('\n'));}; //for utf-16 CSV
    .initStorage = function (filename) {this.StorageBuffer = [].load(filename); this.StorageBuffer.reverse();};
    .getNextLine = function () {
        if (this.StorageBuffer!==void) {
            var retData=this.StorageBuffer.pop();
            if (retData!==void) return retData.split('\t');
        }
    };
};

Not sure it would work but worth a try... Found it here btw:

https://github.com/regomne/chinesize/blob/master/kirikiri2/csvParser.txt

Link to comment
Share on other sites

Yes, it works in _data_make, but i got error in other places

 

11:39:49 ---------------------------------------------------------------------------------------------

11:39:49 trace : mainwindow.tjs(4726)[(function expression) (anonymous)] <-- conductor.tjs(440)[(function) onTag] <-- conductor.tjs(104)[(function) timerCallback]
11:39:49 エラーが発生しました
ファイル : _data-event.ks   行 : 90
タグ : endlink ( ← エラーの発生した前後のタグを示している場合もあります )
(void) から Object へ型を変換できません。Object 型が要求される文脈で Object 型以外の値が渡されるとこのエラーが発生します
11:39:59 0
Link to comment
Share on other sites

  • 3 weeks later...

I have another idea. First, take the original "_data-make.ks" file (without the change I suggested earlier).

 

Change every:

initStorage("file_name")

To:

initStorage("file_name", true)

Where of course "file_name" is the file name written there (just keep it).

After you do that change all your csv files to use utf-8 encoding.

This should work... but if it doesn't I have one last change that might help (only try if the above doesn't work, and use this change in addition to the above one):

 

Change every:

CSVParser()

To:

CSVParser(,"\r\n")

Idea taken from the parser documentation:

http://www.geocities.jp/keep_creating/DojinDOC/krkrDefaultPlugins.html

 

Let me know if it helps :P

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...