ローカルテストをデスクトップモードで行う(vrchat-launcher)
概要
VRChat のローカルテストをデスクトップモードで起動できるようにするツールを作りました。ついでに単体で使用した際に開始前にワールドをメニューから選択できる機能を実装しました。
はじめに
先日の VRChat SDK のアップデート(VRCSDK-2018.01.26.13.13)で試作中のデータをサーバにアップロードせずに、手元のマシンに置いた状態でテストできるようになりました。(ログインは必要で完全にオフラインで動作するわけではない)(リリースノート "Local testing has been fixed" の項。この書き方からするとある時から壊れていた?)
アップロードの時間が削減されてさっと確認できるようになり便利になりましたが、必ずVRモードで起動するので少々不便なこともあります。(ちょっとした変更を確認したい時に HMD を装着してコントローラを手にするのはやっぱり億劫)そこでデスクトップモードでも起動できるようにするツールを作りました。
ついでに、このツールを Unity 経由でなく Windows エクスプローラから起動した時に、VRChat が起動する前に接続するワールドを選択できる機能を実装してみました。
インストール
- vrchat-launcher.vbs をダウンロードして任意の場所に置く。
- Unity menu > VRChat SDK > Settings を開く
- "VRChat client" の項の "Edit" ボタンを押し、ファイル選択画面を表示する。
- 画面右下の
exe(*.exe)
という表示フィルタ設定をAll files(*.*)
にする - ステップ1で置いたファイルを選択する。
機能・設定
- VRChat SDK の Build Control Panel でローカルテストを開始する(「Test」の下にある「Last Build」「New Build」を押す)と、このツールの機能により、VRChat クライアントがデスクトップモードで起動する。
- (ちなみに「New Build」は Unity での編集状態を新たに見れるようにする、 「Last Build」は最後に「New Build」した結果をそのまま表示する、という動作をする。)
vrchat-launcher.vbs
ファイルを Windows Explorer でダブルクリックする- VR モードとデスクトップ・モードの初期選択は
vrchat-launcher.vbs
中startWithVR
を書き換えることで選択可能。 vrchat-launcher.vbs
中のconfirmMode
を true にすると、 この VR モードの選択を VRChat SDK から起動する際にも行えるようになる。- 毎回選択しないと始まらないというデメリットはある。
- もし Windows Explorer でダブルクリックした時にも VRChat が起動しない場合、
' GetInstallPath = "C:\Program Files (x86)\Steam\steamapps\common\VRChat"
の部分を VRChat をインストールしている場所(VRChat.exe ファイルがあるフォルダ)に書き換えて、先頭の引用符「'」を取り除いてみてください。(報告いただけますと幸いです。)
アンインストール
- インストール作業と同様にファイル選択画面を表示する。
- キャンセルボタンを押す。
- 不要ならば vrchat-launcher.vbs ファイルを消す。
メモ
- VRChat 界隈はハッキング行為でごたついていることもあり、安心して利用できるよう、ファイルの中身を誰でも簡単に確認できる VBScript で実装しました。
履歴
- 2018/2/7 VRChat のインストール先をレジストリから読むように変更。
vrchatInstallFolder
変数は廃止 - 2019/6/11 レジストリからの読み込みが意図せず無効化されていたのを復活。上手くいかない場合の対処についてドキュメント
A tool to launch VRChat client in desktop mode for local testing (VRChat launcher)
- I made a small tool to use desktop mode while local testing.
- When invoked from Windows Explorer, It shows world selection menu to allow you seleting a world before starting VRChat client.
Install
- Download vrchat-launcher.vbs
- Open VRChat SDK Settings window (Unity menu > VRChat SDK > Settings)
- Press "Edit" button to client file selection dialog.
- Change file name filter (at right bottom of the window)
exe(*.exe)
toAll files(*.*)
- Select vrchat-launcher.vbs file (located step 1)
Functions and configurations
- When local testing started (from VRChat SDK "Last Build" or "New Build" button under "Test" section), VRChat client work in desktop mode.
- When
vrchat-launcher.vbs
is started from Windows Explorer, It shows world selection menu.- The list is witten in
vrchat-launcher.vbs
. It' plain text, so you can edit it. - If you enter zero (and return) , it toggles VR/desktop mode selection.
- The list is witten in
- Default VR/desktop mode is written as
startWithVR
in the file. Change it if you want. - If you change
confirmMode
totrue
, you can change VR/desktop mode when local testing invocation. - If VRChat doesn't start even if from Windows Explorer, try to edit this part
' GetInstallPath = "C:\Program Files (x86)\Steam\steamapps\common\VRChat"
pointing where you install VRChat (the folder where VRChat.exe file exists) and remove heading quotation mark (').
Uninstall
- like install step, show file selection dialog.
- Press cancel button.
- Delete
vrchat-launcher.vbs
if you want to do so.