Okay, I figured out how to fix the DLC for Linux (potentially also Android), at least for the first few maps. Maybe there's something later on I haven't encountered yet. Buckle up cause there's a lot of changes that need to be made to fix the Thoughtography mechanic.
If you're lazy, just download the attached zip file,
make a backup of your game's `www` directory in case something goes wrong, then merge the `www` directory in the zip file with your game's `www` directory, replacing any files that you're asked about (there should be 4 replaced files).
If you'd rather make the changes yourself, I'll guide you through doing that below.
---
SA_Characters.js
Comment out the following code in `js/plugins/SA_Characters.js`:
JavaScript:
showSubPicture(23, `E_${__v(VAR__ENEMY_SBD)}_SBD`)
showSubPicture(24, `E_${__v(VAR__ENEMY_SEJ)}_SEJ`)
showSubPicture(27, `E_${__v(VAR__ENEMY_SFX01)}_SFX01`)
showSubPicture(28, `E_${__v(VAR__ENEMY_SFX02)}_SFX02`)
Add the following code to replace it:
JavaScript:
// NEW CODE STARTS HERE
// We're going to change this function so that it loads the right file in case-sensitive file systems
// Even when the person writing the character got the capitalization of "Blank" wrong
if (__v(VAR__ENEMY_SBD).toLowerCase() == "blank") {
showSubPicture(23, `E_Blank_SBD`)
} else {
showSubPicture(23, `E_${__v(VAR__ENEMY_SBD)}_SBD`)
}
if (__v(VAR__ENEMY_SEJ).toLowerCase() == "blank") {
showSubPicture(24, `E_Blank_SEJ`)
} else {
showSubPicture(24, `E_${__v(VAR__ENEMY_SEJ)}_SEJ`)
}
if (__v(VAR__ENEMY_SFX01).toLowerCase() == "blank") {
showSubPicture(27, `E_Blank_SFX01`)
} else {
showSubPicture(27, `E_${__v(VAR__ENEMY_SFX01)}_SFX01`)
}
if (__v(VAR__ENEMY_SFX02).toLowerCase() == "blank") {
showSubPicture(28, `E_Blank_SFX02`)
} else {
showSubPicture(28, `E_${__v(VAR__ENEMY_SFX02)}_SFX02`)
}
// NEW CODE ENDS HERE
(If you're curious why we need this, some code refers to certain files with the incorrect capitalization, which doesn't matter on case-insensitive filesystems (like Windows) but leads to problems on case-sensitive systems (like most Linux filesystems).
This'll fix any issues with the game failing to find problems like E_Blank_SBD, E_Blank_SEJ, E_Blank_SFX01 or E_Blank_SFX02.
RS_ScreenShot.js
In `www/js/plugins/RS_ScreenShot.js`, right under `$.getPath = function () {`, write `return 'www/Thoughtography/'`. The final result should look like this (lines starting with "//" are optional, as they're just comments that don't affect the code):
JavaScript:
$.getPath = function () {
// NEW CODE STARTS HERE
// This function will now always return "www/Thoughtography/", completely ignoring the rest of the function
// This solves several issues with loading Thoughtography on Linux, although you'll still to prefix a "/" when using Bitmap.load()
return 'www/Thoughtography/'
// NEW CODE ENDS HERE
(If you're curious why we need this, for some reason the game hates absolute paths on Linux, so we're switching it to a relative path.)
This one part of fixing most of the remaining issues, although it won't fix them without the next change.
SAPatch-Append-01_00_00.js and SceneGlossary.js
Replace each instance of `const bitmap = Bitmap.load(decodeURIComponent(path))` with `const bitmap = Bitmap.load(decodeURIComponent('/' + path))`. The final result should look like this (lines starting with "//" are optional, as they're just comments that don't affect the code):
JavaScript:
// NEW CODE STARTS HERE
// This code will allow the image to load correctly on Linux, as we need that prefixed slash
const bitmap = Bitmap.load(decodeURIComponent('/' + path))
// NEW CODE ENDS HERE
(If you're curious why we're doing this, it's because Bitmap.load expects that leading slash, whereas most of the other functions do not. If you fail to provide that leading slash, Bitmap.load will insert "www/", leading to the path being "www/www/Thoughtography", which will fail.)
Together with the last change, this should fix most of the remaining issues.
pfks.rpgmvp (aka pfks.png)
Run this file through
You must be registered to see the links
to get the decrypted file. Name it `pfks.png` and put it in `www/Thoughtography`.
(If you're curious why we need this, it's because even after all the changes above RPGMaker has trouble decrypting `pfks.rpgmvp` into `pfks.png`, so we have to decrypt it ourselves and give it the decrypted file.)
This should fix issues having to do with Pfks's thoughtograph.
---
Phew, that was a lot. Getting this one mechanic to work was more difficult than getting the entire base game working! Hopefully SQDT next game is relatively easy for Linux, or at least Linux through Wine.
