Data not being read after encryption??

● ARCHIVED · READ-ONLY
Started by Kes 6 posts View original ↗
  1. This was originally posted in FenixFyreX's script thread, but Shaz suggested starting a new topic, so here goes.

    I am using this script for lighting effects http://www.mediafire.com/download/tdu1ddt77t94r4q/FyxLFX.rar  Unfortunately for the purposes of this topic, the script is part of a demo, rather than as a stand alone.  It's 733 lines long, so I am assuming too long to be posted here.

    If I play the game in the editor I have no problems.

    However, if I encrypt it and then play the encrypted version, I get the error message

    File does not exist: Graphics/Lights/lantern.png

    The same thing happened with the file fireplace.

    Is it possible that the encrypted file is unable to read the existence of the graphic or perhaps the whole folder?

    EDIT

    In case it is of any use, there was another script I had which was unable to read the data once the game was encrypted.  The discussion and solution can be found on this topic http://forums.rpgmak...pting-the-game/  I do not know anything like enough about scripts to know if it is the same type of issue here, so the link may be irrelevant.
  2. Yep, it's exactly the same issue.

    In the FyxLFX script, go to line 495 where you'll see this code:

    unless FileTest.exist?(fn="Graphics/Lights/"+cache[:filename]+".png") msgbox "File does not exist: "+fn exit end self.bitmap = Cache.lights(cache[:filename]).cloneReplace it with this:
    Code:
        begin      self.bitmap = Cache.lights(cache[:filename]).clone    rescue      msgbox "File does not exist: " + "Graphics/Lights/" + cache[:filename] + ".png")      exit    end
    If that doesn't work, try this instead:

    Code:
        begin      self.bitmap = Cache.lights(cache[:filename]).clone    rescue      fn = "Graphics/Lights/" + cache[:filename] + ".png"      msgbox "File does not exist: " + fn      exit    end
  3. Thanks for such a quick response.

    Just so that I can be sure, when you say replace it with... does the "it" refer just to line 495, or to that whole section that you show in the first snippet?

    Sorry to be so obtuse.

    EDIT

    Took my life in my hands and went for it.  

    The second method works.  I am so relieved.

    @Shaz

    Thanks a million for sorting this out.  Once again to my rescue.

    I did have a thought.  Your fog script (the one you were looking at in my other project) also uses a separate folder.  Does that mean it will need tweaking too?
  4. No. It is not that it uses a separate folder. It is that it uses File or FileTest to check for the existence of a file. As Hime explained in the other topic, File and FileTest work when the files are uncompressed, because it's using the regular OS file system. But when the files are compressed into the archive, File and FileTest cannot see into the archive, so they will always fail to find the resource.


    So to set your mind at ease, and to avoid any other surprises, do a global search (Control + Shift + F) in your scripts for File. (with the period) and another for FileTest. (with the period). If either of those bring up any results, you are probably going to have issues with that script and will need to convert it to the begin|rescue|end logic that we've used with the last two scripts.
  5. I've done as you have suggested, and the only one I could find is in your AddData Save script, line 49.  However, clearly this script works, so I assume that instance is doing other things. 

    If that's the case, then this thread can close.  I won't report it, however, until you have seen this post, just in case.
  6. That one works because it's not looking for a file in the archive. It's looking for one in the regular file system.


    In that case, you should be good to go :)


    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.