Ultimate Overlay Mapping Encryption-Problem

Yokiko

Villager
Member
Joined
Jan 20, 2014
Messages
24
Reaction score
2
First Language
German
Primarily Uses
RMVX
Okay, this is really awful, I really need your help here.

I'm using Hanzo Kimuras Ultimate Overlay Mapping-script and wanted to encrypt the game it's used in - but all the overlay-images aren't hidden or encrypted at all. I tried to move the overlays in the graphics-folder to be encrypted automatically and changed the folder-path in the script - the images are successfully hidden, but after that the overlays simply won't be shown in the game anymore.

So... Does anyone know how to change that so the overlays are encrypted and usable?

Because vx.net and RRR are no more, I can't give you a direct link to the demo, but here's the script Hanzo used:

#==============================================================================# U L T I M A T E O V E R L A Y M A P P I N G# Script By: Hanzo Kimura# Date Created: 08/11/10#==============================================================================module HK_UOM #=================================== SET UP ===================================## SCREEN SETUP Width = 544 # The Size of Resolution (Screen's Width) 544/640 Height = 416 # The Size of Resolution (Screen's Height) 416/480# SWITCHES LightSwitch = 1 #Switch to Activate Light Overlays ShadowSwitch = 2 #Switch to Activate Shadow Overlays ParSwitch = 1 #Switch to Activate Parallax Overlays GroundSwitch = 1 #Switch to Activate Ground Overlays# FILENAMES LightMap = "Light" #The name of the file for Light Overlays ShadowMap = "Shadow" #The name of the file for Shadow Overlays ParMap = "Par" #The name of the file for Parallax Overlays GroundMap = "Ground" #The name of the file for Ground Overlays#================================ END OF SET UP ===============================#end# OVERLAY SCRIPT STARTS HERE #module Cache def self.overlay(filename) load_bitmap("Overlays/", filename) endendclass Spriteset_Map include HK_UOM alias hk_uom_initialize initialize def initialize @GroundON = FileTest.exist?("Overlays/" + "ground" + $game_map.map_id.to_s + ".png") hk_uom_initialize update end alias hk_uom_create_parallax create_parallax def create_parallax if @GroundON @ground = Sprite.new(@viewport1) @ground.z = 1 @ground.bitmap = Cache.overlay("ground" + $game_map.map_id.to_s) end hk_uom_create_parallax end alias hk_uom_dispose_parallax dispose_parallax def dispose_parallax if @ground != nil @ground.dispose end hk_uom_dispose_parallax end alias hk_uom_update_parallax update_parallax def update_parallax if @ground != nil @ground.visible = $game_switches[GroundSwitch] end if @ground != nil @ground.tone = $game_map.screen.tone @viewport1.ox = $game_map.screen.shake #update shake screen @viewport1.color = $game_map.screen.flash_color #update flash screen if @ground.ox != -$game_map.display_x / 256 or @ground.oy != -$game_map.display_y / 256 or @ground.ox == 0 or @ground.oy == 0 @ground.ox = $game_map.display_x / 8 @ground.oy = $game_map.display_y / 8 end end hk_uom_update_parallax endend#==============================================================================# Scene Map#==============================================================================class Scene_Map < Scene_Base alias hk_uom_start start def start hk_uom_start $OverlayMap = Overlay_Map.new end def terminate super if $scene.is_a?(Scene_Battle) @spriteset.dispose_characters end snapshot_for_background @spriteset.dispose @message_window.dispose $OverlayMap.dispose if $scene.is_a?(Scene_Battle) perform_battle_transition end end def update super $game_map.interpreter.update $game_map.update $game_player.update $game_system.update @spriteset.update @message_window.update $OverlayMap.update unless $game_message.visible update_transfer_player update_encounter update_call_menu update_call_debug update_scene_change end end def update_transfer_player return unless $game_player.transfer? fade = (Graphics.brightness > 0) fadeout(30) if fade @spriteset.dispose $game_player.perform_transfer $game_map.autoplay $game_map.update Graphics.wait(15) @spriteset = Spriteset_Map.new $OverlayMap.dispose $OverlayMap = Overlay_Map.new fadein(30) if fade Input.update endend#==============================================================================# Overlay#==============================================================================class Overlay_Mapinclude HK_UOM def initialize check_file display_overlay end def check_file @LightON = FileTest.exist?("Overlays/" + LightMap + $game_map.map_id.to_s + ".jpg") @ShadowON = FileTest.exist?("Overlays/" + ShadowMap + $game_map.map_id.to_s + ".jpg") @ParON = FileTest.exist?("Overlays/" + ParMap + $game_map.map_id.to_s + ".png") @GroundON = FileTest.exist?("Overlays/" + GroundMap + $game_map.map_id.to_s + ".png") end # Displaying Overlays SET UP # def display_overlay if @LightON @light_viewport = Viewport.new(0, 0, Width, Height) @light_viewport.z = 10 @light = Sprite.new(@light_viewport) @light.bitmap = Cache.overlay(LightMap + $game_map.map_id.to_s) @light.z = 10 @light.opacity = 115 @light.blend_type = 1 @light.visible = $game_switches[LightSwitch] end if @ShadowON @shadow_viewport = Viewport.new(0, 0, Width, Height) @shadow_viewport.z = 9 @shadow = Sprite.new(@shadow_viewport) @shadow.bitmap = Cache.overlay(ShadowMap + $game_map.map_id.to_s) @shadow.z = 9 @shadow.opacity = 85 @shadow.blend_type = 2 @shadow.visible = $game_switches[ShadowSwitch] end if @ParON @par_viewport = Viewport.new(0, 0, Width, Height) @par_viewport.z = 8 @par = Sprite.new(@par_viewport) @par.z = 8 @par.bitmap = Cache.overlay(ParMap + $game_map.map_id.to_s) @par.tone = $game_map.screen.tone @par.opacity = 255 @par.blend_type = 0 @par.visible = $game_switches[ParSwitch] end update end # Update Overlays SET UP # def update if @light != nil @light.visible = $game_switches[LightSwitch] end if @shadow != nil @shadow.visible = $game_switches[ShadowSwitch] end if @par != nil @par.visible = $game_switches[ParSwitch] end if @light != nil @light.tone = $game_map.screen.tone #update screentone @light_viewport.ox = $game_map.screen.shake #update shake screen @light_viewport.color = $game_map.screen.flash_color #update flash screen if @light.x != $game_map.display_x / 256 or @light.y != $game_map.display_y / 256 or @light.x == 0 or @light.y == 0 @light.ox = $game_map.display_x / 8 @light.oy = $game_map.display_y / 8 end #./ end #./ if @shadow != nil @shadow.tone = $game_map.screen.tone #update screentone @shadow_viewport.ox = $game_map.screen.shake #update shake screen @shadow_viewport.color = $game_map.screen.flash_color #update flash screen if @shadow.x != $game_map.display_x / 256 or @shadow.y != $game_map.display_y / 256 or @shadow.x == 0 or @shadow.y == 0 @shadow.ox = $game_map.display_x / 8 @shadow.oy = $game_map.display_y / 8 end #./ end #./ if @par != nil @par.tone = $game_map.screen.tone #update screentone @par_viewport.ox = $game_map.screen.shake #update shake screen @par_viewport.color = $game_map.screen.flash_color #update flash screen if @par.ox != $game_map.display_x / 256 or @par.oy != $game_map.display_y / 256 or @par.ox == 0 or @par.oy == 0 @par.ox = $game_map.display_x / 8 @par.oy = $game_map.display_y / 8 end #./ end #./ end #def end def dispose if @light != nil @light_viewport.dispose @light.dispose end if @shadow != nil @shadow_viewport.dispose @shadow.dispose end if @par != nil @par_viewport.dispose @par.dispose end endendI absolutely don't know anything about scripting, but after some time of research I figured there is a very similar script for Ace. Yami wrote it and even stated that the original script is from Hanzo Kimura, so I guess the structure might be related. In the newest update the encryption-problem is apparently fixed.

Maybe Yamis work can help to fix the problem in Hanzos script, since I'm using VX and not Ace?

Here is the demo for Yamis Overlay Mapping.

I really hope somebody can help me out here. Pretty please? With sugar on top?
 
Last edited by a moderator:

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV

Yokiko

Villager
Member
Joined
Jan 20, 2014
Messages
24
Reaction score
2
First Language
German
Primarily Uses
RMVX
Oh, oops! Sorry, I thought the script in the demo would be the newest one because my friend said there's a line under the updates-list that goes something like "2012.04.16 - Reworked with Encrypted Game". I don't have ACE, so I'm not able to check it myself :(

But thank you very much! I really hope my request is easier to accomplish with Yamis success to look at.
 
Last edited by a moderator:

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
You are right, the demo does contain the latest version of Yami's Overlay Mapping script. Your friend must have uploaded it for you. The one that was available on the blog contained the outdated one.

At any rate, the link will provide potential scripters a direct look at Yami's script, especially since some may not have the VX Ace engine like you. Sorry for the confusion.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
I don't know how exactly to correct the problem, but I know where it comes from.


The engine has two different commands for loading files, and only one of them can search and use the encrypted archive. The other method has a few more options, but it cannot access the archive if the game is encrypted.


So basically, a scripter needs to replace the file functions with the variant that uses the archive and everything would work as intended. I don't know how much work that is however.
 
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
Not being a scripter, I cannot give the solution, but the cause of the problem was identified in 2 separate cases which I had, which may throw light on what's happening here.  Both problems were solved.

The first is here  It identifies clearly the cause of the problem.

The second, which had the same root cause, can be found here

It may well be that the method which solved these two instances would also apply to your problem.
 
Last edited by a moderator:

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
Those are very useful information, ksjp17. Unfortunately, another issue would be that the scripter who would attempt to fix this problem, has to well-versed in RGSS2 as well as RGSS3.
 

Yokiko

Villager
Member
Joined
Jan 20, 2014
Messages
24
Reaction score
2
First Language
German
Primarily Uses
RMVX
I see! Whoa, you guys are really good, I know absolutely nothing about scripting, so I never would have seen where the problem comes from.

I really hope, someone is able to fix it - but I'm quite positive that with all the information you all are giving so nicely, it should be managable. Thank you very much!
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Those are very useful information, ksjp17. Unfortunately, another issue would be that the scripter who would attempt to fix this problem, has to well-versed in RGSS2 as well as RGSS3.
It's the same thing in VX: just look for anything that looks like this

FileTest.exist?("Overlays/" + LightMap + $game_map.map_id.to_s + ".jpg")Specifically

Code:
FileTest.exist?
And change it to use load_data somehow. Or whatever the VX version is. I think it's still load_data.The problem here is that they're checking whether the file exists, so you'd have to say

Code:
begin  load_data(your_file_path)rescue  // it failed...end
So something like
Code:
def file_exists?(path)  begin    data = load_data(path)    return true  rescue    return false  endend
And then now you can just say

Code:
file_exists?("Overlays/" + LightMap + $game_map.map_id.to_s + ".jpg")
 
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
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
The reason why I said that the scripter has to well-versed in RGSS2 and RGSS3 is because he would have to be able to read the both scripts and has to have knowledge of the languages.

For someone like me to read and understand either of the scripts is difficult. I did find five instances where the 'Filetest.exist?' appears in the VX script, but am not sure how to convert it. All three samples (two from kjsp17's links, and one from Yami's Overlay Mapping' scripts) have slightly different approaches to solving the problem.

The information you have just provided is very helpful and more elaborate. I will see if I can apply it to the VX version while waiting for a more experienced scripter to handle this issue. Thank you, Tsukihime.
 

Yokiko

Villager
Member
Joined
Jan 20, 2014
Messages
24
Reaction score
2
First Language
German
Primarily Uses
RMVX
Sorry, I didn't mean to post this request in the wrong section! It won't happen again. :)

This issue here seems a lot more complicated than I firstly thought... Thank you for your eagerness, everybody!
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
It looks simple enough, but I will have to apologize since I can't seem to apply it to this scipt.

Sorry, Yokiko. Hope a more experienced scripter comes along and help you with your problem.
 

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