Jump to content

patch.xp3 won't read - old Kirikiri game


wildpawz

Recommended Posts

I'm working with a very old Kirikiri game - 2003. It has no data.xp3. Besides the .exe, all it has is a "savedata" folder, extrans.dll, wuvorbis.dll, and a read me file. Using GARbro I can look into the .exe file and extract all its contents. All its scenarios are .ks. Here's the .exe file's contents:

 26rJW4p.png

I've translated some text on artworks and text in .ks files as a test, but every time I try to get the results to appear, nothing happens. 

Is it because all the data is from INSIDE the .exe, instead of outside? So when i put "patch.xp3" in the folder with the game, it won't run?

Assuming that ISN'T the case, my only other clue is the startup.tjs file. It reads as this:

Spoiler

// startup.tjs - スタートアップスクリプト
// Copyright (C) 2001, W.Dee  改変・配布は自由です


// このスクリプトは一番最初に実行されるスクリプトです
Scripts.execStorage("system/Initialize.tjs"); // system/Initialize.tjs を実行

Initialize.tjs is in the "system" folder of the .exe. So, I took a look:

Spoiler

// Initialize.tjs - システムの初期化
// Copyright (C)2001-2003, W.Dee  改変・配布は自由です

/*
    Debug.message へのショートカット
*/

var dm = Debug.message; // これで dm("message"); でコンソールに message を表示できる


/*
    パスの設定
    後に指定した物が、より優先されて使用される
*/


function useArchiveIfExists(name)
{
    // name が存在していたらそのアーカイブを使う
    var arcname;
    if(Storages.isExistentStorage(arcname = System.exePath + name))
        Storages.addAutoPath(arcname + "#");
}

Storages.addAutoPath(System.exePath + "video/"); // exePath 以下の video/
Storages.addAutoPath("video/"); // video フォルダ
Storages.addAutoPath("others/"); // その他
Storages.addAutoPath("rule/"); // ルール画像フォルダ
Storages.addAutoPath("sound/"); // 効果音フォルダ
Storages.addAutoPath("bgm/"); // BGM フォルダ
Storages.addAutoPath("fgimage/"); // 前景画像フォルダ
Storages.addAutoPath("bgimage/"); // 背景画像フォルダ
Storages.addAutoPath("scenario/"); // シナリオフォルダ
Storages.addAutoPath("image/"); // そのほかの画像フォルダ
Storages.addAutoPath("system/"); // システムフォルダ

// パッチアーカイブの検索と使用
// もしこれらの名前を持ったアーカイブが実行可能ファイルと
// 同じ場所にあった場合、それを優先して使う
useArchiveIfExists("video.xp3");
useArchiveIfExists("others.xp3");
useArchiveIfExists("rule.xp3");
useArchiveIfExists("sound.xp3");
useArchiveIfExists("bgm.xp3");
useArchiveIfExists("fgimage.xp3");
useArchiveIfExists("bgimage.xp3");
useArchiveIfExists("scenario.xp3");
useArchiveIfExists("image.xp3");
useArchiveIfExists("system.xp3");

useArchiveIfExists("patch.xp3");

// 追加のパッチ用アーカイブの検索
for(var i = 2; ; i++)
{
    // パッチ用アーカイブ patch2.xp3, patch3.xp3 ... がある場合はそちらを
    // 優先して読み込むように
    if(Storages.isExistentStorage(System.exePath + "patch" + i + ".xp3"))
        Storages.addAutoPath(System.exePath + "patch" + i + ".xp3#");
    else
        break;
}

delete useArchiveIfExists; // useArchiveIfExists は使い終わったので一応消しておく

/*
    システムバージョン
*/
var kagVersion = "3.18 release rev.2";
Debug.notice("OS : " + System.osName + " (" + System.platformName + ")");
Debug.notice("KAG : " + kagVersion);
Debug.notice("Kirikiri : " + System.versionString);

/*
    ( デバッグ ) 時間計測
*/

var parseStartTick = System.getTickCount();


/*
    スクリプト読み込みラッパー
*/

function KAGLoadScript(name)
{
    var start = System.getTickCount();
    Scripts.execStorage(name);
    dm(name + " を読み込みました(" + (System.getTickCount() - start) + "ms)");
}


/*
    Config.tjs 読み込み
*/
if(Storages.isExistentStorage("Config.tjs"))
{
    KAGLoadScript("Config.tjs");
}
else if(Storages.isExistentStorage("Config.~new"))
{
    System.inform("Config.tjs が見つかりません。\nsystem フォルダにある "
        "Config.~new ファイルを Config.tjs に改名してください。");
    System.exit();
}
else
{
    throw new Exception("Config.tjs が見つかりません。");
}

/*
    Config.tjs バージョンチェック
*/

if(typeof global.config_version == "undefined" || config_version != kagVersion)
{
    KAGLoadScript("UpdateConfig.tjs");
}

/*
    二重起動のチェック
*/

// 実行可能ファイルのパスをキーにしてロックを行う
if(!System.createAppLock(System.exePath.replace(/[^A-Za-z]/g, '_')))
{
    // すでに起動している
    System.inform(System.title + "はすでに起動しています");
    System.exit();
}


/*
    オン・デマンド・ローディングを行うための定義
*/


property askYesNo { getter() { KAGLoadScript("YesNoDialog.tjs"); return global.askYesNo; } }
property CheckBoxLayer { getter() { KAGLoadScript("CheckBoxLayer.tjs"); return global.CheckBoxLayer; } }
property ButtonLayer { getter() { KAGLoadScript("ButtonLayer.tjs"); return global.ButtonLayer; } }
property EditLayer { getter() { KAGLoadScript("EditLayer.tjs"); return global.EditLayer; } }
property KAGPlugin { getter() { KAGLoadScript("Plugin.tjs"); return global.KAGPlugin; } }

/*
    各システム読み込み
*/
dm("KAG System スクリプトを読み込んでいます...");

KAGLoadScript("Utils.tjs");
KAGLoadScript("KAGLayer.tjs");
KAGLoadScript("HistoryLayer.tjs");
KAGLoadScript("BGM.tjs");
KAGLoadScript("SE.tjs");
KAGLoadScript("Movie.tjs");
KAGLoadScript("Conductor.tjs");
KAGLoadScript("AnimationLayer.tjs");
KAGLoadScript("GraphicLayer.tjs");
KAGLoadScript("MessageLayer.tjs");
KAGLoadScript("Menus.tjs");
KAGLoadScript("DefaultMover.tjs");
KAGLoadScript("MainWindow.tjs");
if(Storages.isExistentStorage("Override.tjs"))
    KAGLoadScript("Override.tjs");
if(Storages.isExistentStorage(System.exePath + "Override2.tjs"))
    KAGLoadScript(System.exePath + "Override2.tjs");


/*
    ( デバッグ ) 時間計測
*/
dm("スクリプトの読み込みに " + (System.getTickCount() - parseStartTick) + "ms かかりました");
parseStartTick = System.getTickCount();

/*
    ( デバッグ ) VM コードのダンプ
*/

// Scripts.dump();

/*
    ( デバッグ ) 時間計測
*/

parseStartTick = System.getTickCount();


/*
    KAG メインウィンドウの作成
*/

var kag;
kag = new KAGWindow();


/*
    グローバルから簡単にアクセスできるように、いくつかの
    変数の別名を作成
*/

var f = kag.flags;   // ユーザ変数 (フラグ)
var sf = kag.sflags; // システム変数 (システム)
var tf = kag.tflags; // 一時変数 (一時フラグ)

property mp
{
    getter { return kag.conductor.macroParams; }
}

/*
    ( デバッグ ) 時間計測
*/
dm("KAGMainWindow のコンストラクタで " + (System.getTickCount() - parseStartTick) + "ms かかりました");
delete parseStartTick;


/*
    AfterInit.tjs が存在すれば実行
*/
if(Storages.isExistentStorage("AfterInit.tjs"))
    KAGLoadScript("AfterInit.tjs");
if(Storages.isExistentStorage(System.exePath + "AfterInit2.tjs"))
    KAGLoadScript(System.exePath + "AfterInit2.tjs");

/*
    コマンドラインパラメータとして -ovr が指定されていれば
    そのパラメータを TJS 式として実行
*/
{
    var ovr = System.getArgument('-ovr');
    if(ovr !== void && ovr != 'yes') ovr!;
}

/*
    first.ks の実行
*/

kag.process("first.ks");


 

I highlighted with blue what I believe was the important part of the text. As it suggests in Japanese, I placed the patch in the same folder as the .exe - didn't work. named it different things (i.e. "scenarios.xp3") and put it in different folders. Nothing worked. To be honest, the patch.xp3 itself only has the modified first.ks file in it for a test, so maybe that's what's making it not work...?

Please let me know how to fix it. Everything else has been going smooth, I just don't know how to get the game to read the patch.xp3. (btw, this is my first time ever doing something like this, so excuse if this is a noob question. I just couldn't find an answer online.)

Link to comment
Share on other sites

I've patched old Kirikiri games that had no data.xp3 before, so it is possible. (Technically, there is a data.xp3, but it's part of the executable, as you saw. If you hex edit the exe, you can see it sitting there at the end of the file with all the proper xp3 headers and everything.)

Not enough to go on from your description so far, so here are some possible troubleshooting steps:

  • Try altering just one of the PNGs instead to narrow down if the issue is with the whole xp3 or just your ks script.
  • Check the text encoding of your ks script. With a game of that era, it likely needs to be saved out as Shift-JIS.
  • What program are you using to generate your patch.xp3? Sometimes, a different tool just seems to work better on certain games. In addition to GARbro, you might want to explore KrkrExtract and kiririki.
  • Is the game expecting an encrypted patch.xp3? If so, you may want to see if GARbro has that game's encryption as an option or use KrkrExtract to create a Universal Patch.
Link to comment
Share on other sites

Thank you so much!! Your suggestion was a lifesaver!!

I used kirikiri to repackage instead of GARbro, and it worked like a charm! (Note: I tried also with KrkrDEV_232r2EN but the .xp3 didn't read - I think the program may be a bit too modern for this game, mayhaps.)

For anyone else having this issue with old games:

I downloaded kirikiri2-archive-3 and extracted the rar kr2_218. Then, in the kirikiri2 folder, I opened krkrrel.exe and chose the file to turn into a .xp3. (note: for multiple files to be turned into one .xp3, I made a folder with the .ks and images and whatnot and sealed it into a .rar, and converted that. It worked for me.)

Also, in the same kr2_218, I went into the graphconv folder and opened the .exe. Any images I needed modified (usually TLGs), I'd extract as .JPEGs from GARbro and then turn them back to .TLGs using this program once I edited them, so the game could read them again.

I don't know how I never thought to do this, but you pointing it out saved SO much time. Thank you!!!!!!!

Link to comment
Share on other sites

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...