Data not being read after encryption??

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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
 
  • Like
Reactions: BCj

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top