Taisha

Newbie
Aug 27, 2017
32
41
Thank you for putting together your linux guide, it was a massive help getting it running natively, however I can't play the DLC, since its complaining that it can't find anything regarding thoughtography. During the tutorial battle, when pfks's photo activates an error pops up saying that the file not found "/www/Thoughtography/pfks.png", when said file is present. It isn't a case sensitivity thing, since it matches verbatim to what the error states. If you have any ideas or if you managed to work around said issue I'd love to know what you did.
No problem, glad to hear it helped someone! :)

I haven't gotten around to playing the DLC yet, so I haven't encountered this issue. I'll try to play that battle this weekend and see if I can recreate the error. (y)

EDIT: Sorry, haven't been able to spend much time on this yet; I'll try to do it this week.

From the little bit I poked around I saw there's no `pfks.png` file in that folder, but there is an encrypted RPGMaker file, so I'm guessing it's something to do with that. Maybe the decryption isn't working properly? If that's all, the problem could probably be solved by running the file through an and putting the unencrypted `pfks.png` in that folder. I'll give that a try when I get some time, or you could try it yourself and maybe get results sooner.
 
Last edited:
  • Like
Reactions: GarbageStore

GarbageStore

New Member
Aug 10, 2020
4
4
No problem, glad to hear it helped someone! :)

I haven't gotten around to playing the DLC yet, so I haven't encountered this issue. I'll try to play that battle this weekend and see if I can recreate the error. (y)

EDIT: Sorry, haven't been able to spend much time on this yet; I'll try to do it this week.

From the little bit I poked around I saw there's no `pfks.png` file in that folder, but there is an encrypted RPGMaker file, so I'm guessing it's something to do with that. Maybe the decryption isn't working properly? If that's all, the problem could probably be solved by running the file through an and putting the unencrypted `pfks.png` in that folder. I'll give that a try when I get some time, or you could try it yourself and maybe get results sooner.
On my end, the file is present and unencrpyted from the looks of things, I even re-downloaded the expansion from the MEGA link in the OP, and the pfks.png was present. Using the website you linked also leads me to believe that its decrypted already, since the image it returns after decrypting is corrupted.

EDIT: If pfks.png is missing from the Thoughtography folder, the fight will continue on as normal. The game for some reason won't complain if its missing, only when its present. Using thoughtography however will essentially lock the game as it falls into a loop of complaining that the photo that was just taken isn't found.
 
Last edited:
  • Like
Reactions: Taisha

Taisha

Newbie
Aug 27, 2017
32
41
On my end, the file is present and unencrpyted from the looks of things, I even re-downloaded the expansion from the MEGA link in the OP, and the pfks.png was present. Using the website you linked also leads me to believe that its decrypted already, since the image it returns after decrypting is corrupted.

EDIT: If pfks.png is missing from the Thoughtography folder, the fight will continue on as normal. The game for some reason won't complain if its missing, only when its present. Using thoughtography however will essentially lock the game as it falls into a loop of complaining that the photo that was just taken isn't found.
Nice job looking into it! (y)

A few thoughts on what you wrote:

First, I'm surprised you've got pfks.png in an unencrypted format. I'm playing the Japanese version of the game and mine is encrypted (the file name is pfks.rpmvp). Interestingly I didn't get the bug at all, so maybe you actually need the encrypted file? I've uploaded my version , try putting it in your folder and see if it works. You might have to remove your pfks.png for it to work (just move it to some other folder so you can get it back if you need it later).

Second, I ran into a bug with E_blank_SEJ during the Ghost fight, before the pfks.png thing. I made a fix for it, which I'll write up in another post in this thread when I have more time. It's basically a more complicated version of the case sensitive thing from before. I'm a bit surprised you didn't get it, maybe a difference between the English and Japanese versions?

Third, I got the photo not found error as well, but haven't gotten that one fixed yet. I'm going to be pretty busy for the next few days but I'll try to give that one another look.
 

GarbageStore

New Member
Aug 10, 2020
4
4
Nice job looking into it! (y)

A few thoughts on what you wrote:

First, I'm surprised you've got pfks.png in an unencrypted format. I'm playing the Japanese version of the game and mine is encrypted (the file name is pfks.rpmvp). Interestingly I didn't get the bug at all, so maybe you actually need the encrypted file? I've uploaded my version , try putting it in your folder and see if it works. You might have to remove your pfks.png for it to work (just move it to some other folder so you can get it back if you need it later).

Second, I ran into a bug with E_blank_SEJ during the Ghost fight, before the pfks.png thing. I made a fix for it, which I'll write up in another post in this thread when I have more time. It's basically a more complicated version of the case sensitive thing from before. I'm a bit surprised you didn't get it, maybe a difference between the English and Japanese versions?

Third, I got the photo not found error as well, but haven't gotten that one fixed yet. I'm going to be pretty busy for the next few days but I'll try to give that one another look.
I appreciate your help troubleshooting this. I used your file, and the results were the same as if the .png wasn't present, which is to say the battle against the ghost continued fine. Afterwards I ended up freshly extracting the game and playing in wine to compare what it *should* look like, and in the wine version the picture of pkfs pops up on screen when veil is cast, vs nothing happening in the native version.

I tested the thoughtograhpy during the ghost fight, and it seems that whats supposed to happen after you take the picture is the game will display it, and then tell you what sorts of powers the photo provides. In the native version the game fails to display the photo since it can't find it. I wonder if it has something to do with the way the game takes screenshots, and if theres something with the way linux handles the photos that the engine or game doesn't like, but thats just me spitballing.

It slipped by mind but I did run into that E_blank bug but I typically just brute force those sorts of things by either renaming the one file to what it wants, or by making a copy of said file and having both E_blank and E_Blank or the equivalent.
 
Last edited:
  • Like
Reactions: Taisha

Taisha

Newbie
Aug 27, 2017
32
41
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 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. :)
 
  • Heart
Reactions: GarbageStore

GarbageStore

New Member
Aug 10, 2020
4
4
What an absolutely brilliant guide, after following your changes the game now behaves exactly as it did during my wine test, so I think for now its completely fixed! Thank you so very much for all your effort getting this to work, my hats off to you. I'll play through the rest of the DLC and should I run into anything truly show-stopping that I can't just brute force rename I'll report back, but I have a hopeful feeling that it won't be necessary
 
  • Heart
Reactions: Taisha

xXnatsuXx

New Member
Aug 18, 2018
13
8
"She was literally trying to"
You don't have permission to view the spoiler content. Log in or register now.

I thought it was more along the lines of -
You don't have permission to view the spoiler content. Log in or register now.

"Of course, the line after the final boss"
You don't have permission to view the spoiler content. Log in or register now.

You don't have permission to view the spoiler content. Log in or register now.
or something like that.
 
4.60 star(s) 22 Votes