Random Battle Transitions Script, leads to crash on encryption

Hi guys,

Thought I'd throw up a topic for this and see if anyone has the knowledge to help with what's likely and hopefully a simple solution..

I'm using the below script, it's a short one.

Spoiler
-----------------------------------------------------

-----------------------------------------------------

#==============================================================================
# ** NAMKCOR's Random Battle Transition
#------------------------------------------------------------------------------
#  Override to the standard Scene_Map to allow for random selection of
#  multiple battle transition graphics.
#
#  Configuration:
#  > Ensure that all of your BattleStart graphics are named as follows:
#    BattleStart_X.png, where X is the number.
#
#  > Example: if we had 3 BattleStart graphics, I would name them:
#    BattleStart_1.png, BattleStart_2.png, and BattleStart_3.png
#
#  > At Configuration Point A, set the 'return' value to the number
#    of BattleStart graphics in your System folder.
#==============================================================================

module NAMKCOR
 
  #============================================================================
  # Configuration Point A
  #============================================================================
  def self.battle_transition_count
    return 13
  end
 
#==============================================================================
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
# YOU HAVE BEEN WARNED!
#==============================================================================
 
  def self.battle_transition_graphic
    return "Graphics/System/BattleStart_" +
           (rand(battle_transition_count) + 1).to_s
  end

end

class Scene_Map < Scene_Base
  def perform_battle_transition
    Graphics.transition(60, NAMKCOR.battle_transition_graphic, 100)
    Graphics.freeze
  end
end

----------------------------------------

----------------------------------------
I have everything in place and the script works fine, until i encrypt the game.

I receive an error to say

"Unable to find file"
Then lists the transition number it was trying to find.

I thought it might be because the it uses File or FileTest to check for the existence of a file and due to encryption it can't find it, but I don't see any references to check for existence.

Then again, I'm no scripter, any advice or help would be amazing!

Thanks
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Next time, please just link to the script wherever it is originally hosted, instead of pasting the whole thing into your post. For various reasons that I will only go into if you ask me to.


If you HAVE to paste it, wrap it in code tags, and spoiler tags if it's more than a few lines, to preserve formatting, avoid automatic changes of character sequences to emoticons, and improve readability.
Next time use Spoiler tags to enclose the script, as well as posting a link to where you got the script from.

 Derp ninja'd

Providing a screenshot of the error window in question would help as well.
The error was

"Unable to find file"
Then lists the transition number it was trying to find.

I have fixed this problem by placing the battle transition PNG's in to the RTP graphics/system folder.

For some strange reason, following encryption, the projects graphics/system folder could/can not be read.

All other things within that graphics/system folder can be read, just not the battle transition PNGs.

Consider the above to be a fix, although not ideal, it does the job.

EDIT

"Scroll down for more perma fix."

.
Are you sure the transition number it generated exists?
Are you sure the transition number it generated exists?
Yes, because it can find them when i place them in the RTP folder  - "graphics/system."

It just can not find them, after encryption, in the compressed folder (graphics/system)
If i remove the transition images from Graphics/system in the project

and place them in RTP system folder,

Then encrypt again,

It works fine.
Create a new project with the transition script and a couple transitions set up and send me an encrypted demo.


All files in the Data and Graphics folders should be automatically packed up but we can always check that.
Create a new project with the transition script and a couple transitions set up and send me an encrypted demo.

All files in the Data and Graphics folders should be automatically packed up but we can always check that.
Where shall i send it?
Just post it here. It's a new project so there shouldn't be any proprietary data. Just provide dummy transitions or something.
Just post it here. It's a new project so there shouldn't be any proprietary data. Just provide dummy transitions or something.
Ok, and you want to receive it, encrypted?
Just post it here. It's a new project so there shouldn't be any proprietary data. Just provide dummy transitions or something.
Hmm, I tried attaching the compressed .exe file as a file here but it wont allow me, saying I'm not permitted to upload this file.

During the compression process, I can see it is also compressing the transition PNG's.

Is there any other way to send the file?

Are you sure you wouldn't prefer it unencrypted?
Dropbox or mediafire.


Send both the encrypted version and the unpacked version.


The transition files should be placed in the System/Graphics folder in your project (not the RTP)


I would simply unpack the encrypted archive and see whether it matches the unpacked version, and then pack the project myself to verify that I get the same results.


If not, then you might have something wrong with RM itself.
Dropbox or mediafire.

Send both the encrypted version and the unpacked version.

The transition files should be placed in the System/Graphics folder in your project (not the RTP)

I would simply unpack the encrypted archive and see whether it matches the unpacked version, and then pack the project myself to verify that I get the same results.

If not, then you might have something wrong with RM itself.

I think it's something wrong with RM personally..

But ok, is it possible for me to send via skype instead if i message my id?
Just upload it publicly. Others may want to see if it is really an RM problem.
This should work, download and extract.

Testing = Encrypted

testing.zip
attached Testing1 = unencrypted

testing1.zip
Here's the problem:


Well, I think it's the problem.

encrypt.jpg
Fixed.

Thank you so much Tsukihime!

I can now remove those transitions from my RTP and place them in to the project graphics/system folder, they 

work now, with a simple deletion of the extension!

This happened because I used gimp to resize the images to 640x480, in that process it must have included the .png in the file name.

I'll let Namkcor know.

Thanks for looking at this and fixing it!

Have a great day!

Original thread: https://forums.rpgmakerweb.com/threads/random-battle-transitions-script-leads-to-crash-on-encryption.25141/