- Nov 24, 2019
- 283
- 260
A more step-by-step walkthrough for newbies:I got all Tyrano games I could test to run natively on Linux using nwjs-0.12.3, there might be a few menu glitches but nothing too serious. The game needs to be unpacked, use tyranocut.ps1 for that. Thank you for your script, Surgy!
You need to edit the getProcessPath function, in tyrano/libs.js
That makes it work on Windows and Linux, macOS should work too but I can't test that.JavaScript:$.getProcessPath = function(){ var path = process.execPath; var tmp_index = 0; var os = "linux"; if(path.indexOf(".app") !== -1){ os = "mac"; tmp_index = path.indexOf(".app"); }else if(path.indexOf(".exe") !== -1){ os = "win"; tmp_index = path.indexOf(".exe"); } if(os == "linux"){ return process.cwd(); } var tmp_path = path.substr(0,tmp_index); var path_index=0; if(os == "mac"){ path_index = tmp_path.lastIndexOf("/"); }else{ path_index = tmp_path.lastIndexOf("\\"); } var out_path = path.substr(0,path_index); return out_path; };
Upgrading to a newer nwjs version didn't work though.
I was also able to get all RPG Maker MV games to run on nwjs-0.45.6, again it needs to be unpacked, I used EnigmaVBUnpacker. If you are using an Intel GPU, run
in the game directory, where the package.json is. Upgrading nwjs from the ancient version the game is bundled with to a modern x64 release fixes some memory leaks for me. Works with Windows too, of course. As long as you don't mess with the .js files and plugins, upgrading the bundled browser should be safe.Code:MESA_GLSL_CACHE_DISABLE=true nw .
Setting the www/ directory case insensitive helps getting rid of all the "file not found" errors. Or simply make all files lowercase, that would work too I guess.
0. Make a backup. The script will override the files, so always make a backup first!
If a folder "tyrano/" already exists, then you can skip to step 5.
1. Install Power Shell. Fortunately, there is a version for Linux.
You can get it on their GitHub:
You must be registered to see the links
Otherwise, there are more detailed instructions in Microsoft's website:
You must be registered to see the links
It should be installed to /usr/bin/pwsh
2. Download Tyranocut1.ps (from Surgy)
It is a powershell script you can find on this very website:
https://f95zone.to/threads/script-to-cut-data-file-out-of-combined-tyranobuilder-exe.47164/
3. Open a Terminal and change dir to wherever your Tyrano game is.
4. Extract the exe file using Tyranocut. Example:
Code:
user@pc:~/games/tyranogame$ pwsh -executionPolicy bypass -file "tyranocut.ps1" -Unpack -GameExeName "game.exe"
Output may look something like this:
Code:
Processing game.exe...
Unpacking data.zip.
tyranocut.ps1: Exception calling "ExtractToFile" with "3" argument(s): "Access to the path '/home/user/games/tyranogame/data/' is denied."
However if it got the error before creating data.zip, I really cannot help.
Anyway, if you get the same error as me, you can just extract data.zip over the main dir.
5. Go to tyrano/ folder, and go to tyrano/ folder.
Open the file libs.js on your preferred text editor.
6. Search for getProcessPath function. Replace it.
7. Treat the game like any other nw-based game. The www/ folder may be named differently.
Quick Troubleshooting
Q. When I run ./nw it asks to open xdg-open, and says there is no support to the specified location.
A. Edit package.json - it'll have a field called "main". If it starts with "app://", remove that part and it should work.
Q. I could not find tyrano/ folder!
A. Did you extract data.zip over the game dir? Usually it may be extracted in a folder of its own, and you DON'T want this.
Q. "Exception of type 'System.OutOfMemoryException' was thrown."
A. As the name suggests, your system does not have enough RAM to extract this. The script uses a lot of memory and I don't think it accepts swap, either. I got this error by trying to extract a 600MB exe file with "only" 1.6 GB of free RAM.
Or maybe it hit some limit, I don't know >.> Better ask Surgy as he is the author.
PS. Lies. did a simplified version of Tyranocut which might help you out using Python; However, I have not tested it.
Q. "Backup of game exe already exists."
A. The script will try to backup the exe file. The backup will have ".old" extension. You probably can rename the extension to .exe to try again.
Q. "Byte sequence not found."
A. This is not a Tyrano game.
Q. I want to run it using Wine because Wine is cool and why not.
A. You can edit the code snippet so it always return process.cwd() regardless of the OS. This is not guaranteed to work but should do the trick for Wine.
Q. How do I run this a nwjs game? Help!
A. It should be explained in the thread (https://f95zone.to/threads/playing-on-linux-tutorials-tools-and-help.19523/) , the only difference is that the www folder may be called differently. (It was called "data" in the game I used this).
Basically, download nwjs, and copy-paste its contents (overwriting when need, you did make a backup first, right?), except for nw.pak, package.json and the data (or www) folder.
Q. «Insert some crypt error message here»
A. I only tested this with two Tyrano games. One worked and the other raised a memory error, so I'm not sure how other Tyrano games will behave.
Last edited: