Yami's overlay script. Overlay not showing up

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
Of course after one issue was resolved, another had to pop up. That's what I get for trying to put effort in my game. :kaoangry:

So I recently downloaded Yami's Overlay Script and its basic module.
I did all the set ups required. Changed the variables to not overlap with my already existing ones. Made a test ground layer, named it ground2-1. saved it in the overlay folder. Pressed F12 to playtest and.....

Nothing.

The map is just the collision test map. No parallax map in sight
Does anybody know what is going on?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,431
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
have you configured the variables correctly?
that script allows you to use variables to switch between several pictures, that is why you need the number behind the minus. and if you have used the configured variable for something else, then it tries to load a different picture depending on the value in the variable.
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
L
have you configured the variables correctly?
that script allows you to use variables to switch between several pictures, that is why you need the number behind the minus. and if you have used the configured variable for something else, then it tries to load a different picture depending on the value in the variable.
The script automatically sets the variables to 1 and the switches to on
I made sure to place the variables in a slot that is not overlapped by the variables I use for other purposes.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
I diagnosed a project before, blamed everything and all. When I saw it through, they just named the overlay folder wrong.
Iirc, it was Overlays with s, while the correct one is without s.
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
I diagnosed a project before, blamed everything and all. When I saw it through, they just named the overlay folder wrong.
Iirc, it was Overlays with s, while the correct one is without s.
upload_2018-11-27_12-1-17.png
I double checked and it's overlay. So this is clearly not the problem.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
But, your Overlay folder seems empty. Or does it need a folder within folder? I forgot
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Welp, then let's debug the script. First, put this patch below the script to remove the failsafe function.
Code:
module Cache
  def self.overlay(filename)
    bmp = self.load_bitmap("Graphics/Overlay/", filename)
    puts "Loading Graphics/Overlay/#{filename} is successful"
    bmp
  end
end # Cache
Open up console by using Game --> Show Console
Playtest your game. See if it writes loading the overlay is successful.
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
Welp, then let's debug the script. First, put this patch below the script to remove the failsafe function.
Code:
module Cache
  def self.overlay(filename)
    bmp = self.load_bitmap("Graphics/Overlay/", filename)
    puts "Loading Graphics/Overlay/#{filename} is successful"
    bmp
  end
end # Cache
Open up console by using Game --> Show Console
Playtest your game. See if it writes loading the overlay is successful.
It doesn't show anything. Would it be helpful if I uploaded a .zip of the game?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
If it doesn't show anything, then the script is not loading any overlay.
Some settings might off somewhere. For example, ground2-1 means the script will load the overlay in map ID 2.

A demo could do as well, but I don't want to download unnecessary hundreds of MBs to diagnose the project.
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
If it doesn't show anything, then the script is not loading any overlay.
Some settings might off somewhere. For example, ground2-1 means the script will load the overlay in map ID 2.

A demo could do as well, but I don't want to download unnecessary hundreds of MBs to diagnose the project.
The ID of the map I want to use the parallax map on is 002. So misnaming the file doesn't seem to be the case.

I just realized something. Even though the script automatically sets the variables to 1 and the switches to [on].
When I press F9, the switches are set to [Off] and the variables are set to 0

Perhaps there's a conflicting script somewhere?
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
Code:
#==============================================================================
# # Global Save System [v1.0]
# # By theLEECH
#==============================================================================
# # Overwrites:
# # in module DataManager:
# # # self.load_game(index)
# # # self.save_game(index)
# # # self.setup_new_game
#==============================================================================
# ---INSTRUCTIONS---
# Put the numbers of the variables to save and the switches to save in the
# VARIABLES_TO_SAVE array, and the SWITCHES_TO_SAVE array.
# If you want to automatically load/update the globally saved data, set the
# SAVE_ON_SAVE LOAD_ON_LOAD and LOAD_ON_NEW flags to true accordingly.
#------------------------------------------------------------------------------
# You can load and save global data within an event, by using the script command
# and entering: "global_save" or "global_load" (Without qoutations)
#==============================================================================
#==============================================================================
# # LGlobalSave
#==============================================================================
module LGlobalSave

#==============================================================================
# CONFIGURATION
#==============================================================================
# Whether or not the variables and switches in the global file should be
# saved when the player saves the game
  SAVE_ON_SAVE = false
# Whether or not the variables and switches in the global file should be
# loaded when the player loads a save file
  LOAD_ON_LOAD = false
# Whether or not the variables and switches in the global file should be
# loaded when the player starts a new game
  LOAD_ON_NEW = true
# An array that contains a list of variables to save in the global save file
# Enter a list of variables, by number, seperated by commas.
# You can use '..' to include all variables between two numbers
# Example: 15..42
# Will include all variables or switches between 15 and 42 (inclusive)
# Leave blank to save none of that type
  VARIABLES_TO_SAVE = [1]
# Same as above, but for switches
  SWITCHES_TO_SAVE = [1,13]
# The name of the file to save global variables and switches in
  FILE_NAME = "Global.rvdata2"
#==============================================================================
# END OF CONFIGURATION
#==============================================================================

  def self.saveTheFile(f)
    File.open(FILE_NAME, "wb") do |file|
      Marshal.dump(f, file)
    end
  end

  def self.loadTheFile
    if !File.exists?(LGlobalSave::FILE_NAME)
      f = makeNewFile
      return f
    else
        f = nil
      File.open(FILE_NAME, "rb") do |file|
        f = Marshal.load(file)
      end
      return f
    end
  end

  def self.makeNewFile
    return LGlobalSaveFile.new
  end

  def self.loadVariables(f)
    for i in VARIABLES_TO_SAVE
      $game_variables[i]= f.getVar(i)
    end
  end

  def self.loadSwitches(f)
    for i in SWITCHES_TO_SAVE
      $game_switches[i]= f.getSwitch(i)
    end
  end

  def self.saveVariables(f)
    for i in VARIABLES_TO_SAVE
      f.setVar(i, $game_variables[i])
    end
  end

  def self.saveSwitches(f)
    for i in SWITCHES_TO_SAVE
      f.setSwitch(i, $game_switches[i])
    end
  end

  def self.save
    f = makeNewFile
    saveVariables(f)
    saveSwitches(f)
    saveTheFile(f)
  end

  def self.load
    f = loadTheFile
    loadVariables(f)
    loadSwitches(f)
  end

end # end of module LGlobalSave

#==============================================================================
# ** LGlobalSaveFile
#------------------------------------------------------------------------------
# An object of this class is saved in the global.sav file
# It contains all the saved variables and switches
#==============================================================================
class LGlobalSaveFile

  def initialize # Initializes the object
    @var = []
    @switch = [1]
  end

# @var holds the saved variables
# set and get methods:
  def getVar(id)
    return @var[id]
  end
  def setVar(id, val)
    @var[id] = val
  end

# @switch holds the saved switches
# set and get methods:
  def getSwitch(id)
    return @switch[id]
  end
  def setSwitch(id, val)
    @switch[id] = val
  end

end # end of class LGlobalSaveFile

#==============================================================================
# These methods are for saving and loading the global save file from an event
#==============================================================================
def global_save
  LGlobalSave.save
end
def global_load
  LGlobalSave.load
end
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager

#--------------------------------------------------------------------------
# overwrite method: self.setup_new_game
#--------------------------------------------------------------------------
  def self.setup_new_game
    create_game_objects
    $game_party.setup_starting_members
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    Graphics.frame_count = 0
    LGlobalSave.load if LGlobalSave::LOAD_ON_NEW
  end

#--------------------------------------------------------------------------
# overwrite method: self.save_game(index)
#--------------------------------------------------------------------------
  def self.save_game(index)
    begin
      save_game_without_rescue(index)
    rescue
      delete_save_file(index)
      false
    end
    LGlobalSave.save if LGlobalSave::SAVE_ON_SAVE
  end

#--------------------------------------------------------------------------
# overwrite method: self.load_game(index)
#--------------------------------------------------------------------------
  def self.load_game(index)
    load_game_without_rescue(index) rescue false
    LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
  end
end # end of module DataManager
I suspect this is the one.
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,431
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
I just realized something. Even though the script automatically sets the variables to 1 and the switches to [on].
When I press F9, the switches are set to [Off] and the variables are set to 0

Perhaps there's a conflicting script somewhere?
and that is exactly why I asked you to check the variable configuration several posts above...
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Yeah, by default those scripts are conflicting. But not at basic principle of how it works.
You leave all the config at default. You use switch 1 in the overlay script, and you also use switch 1 that decided to be saved.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
As I said again, I don't want to download hundreds of MBs using third world country connection to check your project.
Please show us how you do you set up this. You said 3 and 4, and they're switches default value. While variables use 1 and 2.
Screenshot_299.jpg
Or make a smaller project to prove the bug without unnecessary files.
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
As I said again, I don't want to download hundreds of MBs using third world country connection to check your project.
Please show us how you do you set up this. You said 3 and 4, and they're switches default value. While variables use 1 and 2.
View attachment 103352
Or make a smaller project to prove the bug without unnecessary files.
Code:
#--------------------------------------------------------------------------
    # Default: ON
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    LIGHT_SWITCH = 14        # Turn on/off light layer
    SHADOW_SWITCH = 15       # Turn on/off shadow layer
    PARALLAX_SWITCH = 16     # Turn on/off parallax layer
    GROUND_SWITCH = 17       # Turn on/off ground layer

    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Overlay Variables -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # A map can have more than one image per layer, that means you can have a
    # different light/shadow for day and night, or have a different ground when
    # an event occured.
    #--------------------------------------------------------------------------
    # Default: 1
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    LIGHT_VARIABLE = 3      # Switch to another light
    SHADOW_VARIABLE = 3     # Switch to another shadow
    PARALLAX_VARIABLE = 4   # Switch to another parallax
    GROUND_VARIABLE = 4     # Switch to another ground
This is how this part of the code looks like
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
I looked further to the global save data. And turned out the script has a critical issue.
Whoever wrote the script looks like they weren't experienced on RGSS3.

The conflict goes like this.
Yami's overlay tried to flip the switch at the beginning of the game.
Global save reverts back Yami's attempt to flip the switch by overwriting it.
A simple fix could be, place the script above Yami's.
Or just simply ignore it, and flip the switch manually through events.

Although I did fix the script.
Code:
#==============================================================================
# # Global Save System [v1.0b]
# # By theLEECH
# # Fixed by TheoAllen
#==============================================================================
# ---INSTRUCTIONS---
# Put the numbers of the variables to save and the switches to save in the
# VARIABLES_TO_SAVE array, and the SWITCHES_TO_SAVE array.
# If you want to automatically load/update the globally saved data, set the
# SAVE_ON_SAVE LOAD_ON_LOAD and LOAD_ON_NEW flags to true accordingly.
#------------------------------------------------------------------------------
# You can load and save global data within an event, by using the script command
# and entering: "global_save" or "global_load" (Without qoutations)
#==============================================================================
#==============================================================================
# # LGlobalSave
#==============================================================================
module LGlobalSave

#==============================================================================
# CONFIGURATION
#==============================================================================
# Whether or not the variables and switches in the global file should be
# saved when the player saves the game
  SAVE_ON_SAVE = false
# Whether or not the variables and switches in the global file should be
# loaded when the player loads a save file
  LOAD_ON_LOAD = false
# Whether or not the variables and switches in the global file should be
# loaded when the player starts a new game
  LOAD_ON_NEW = true
# An array that contains a list of variables to save in the global save file
# Enter a list of variables, by number, seperated by commas.
# You can use '..' to include all variables between two numbers
# Example: 15..42
# Will include all variables or switches between 15 and 42 (inclusive)
# Leave blank to save none of that type
  VARIABLES_TO_SAVE = [1]
# Same as above, but for switches
  SWITCHES_TO_SAVE = [1,13]
# The name of the file to save global variables and switches in
  FILE_NAME = "Global.rvdata2"
#==============================================================================
# END OF CONFIGURATION
#==============================================================================

  def self.saveTheFile(f)
    File.open(FILE_NAME, "wb") do |file|
      Marshal.dump(f, file)
    end
  end

  def self.loadTheFile
    if !File.exists?(LGlobalSave::FILE_NAME)
      f = makeNewFile
      return f
    else
        f = nil
      File.open(FILE_NAME, "rb") do |file|
        f = Marshal.load(file)
      end
      return f
    end
  end

  def self.makeNewFile
    return LGlobalSaveFile.new
  end

  def self.loadVariables(f)
    for i in VARIABLES_TO_SAVE
      $game_variables[i]= f.getVar(i)
    end
  end

  def self.loadSwitches(f)
    for i in SWITCHES_TO_SAVE
      $game_switches[i]= f.getSwitch(i)
    end
  end

  def self.saveVariables(f)
    for i in VARIABLES_TO_SAVE
      f.setVar(i, $game_variables[i])
    end
  end

  def self.saveSwitches(f)
    for i in SWITCHES_TO_SAVE
      f.setSwitch(i, $game_switches[i])
    end
  end

  def self.save
    f = makeNewFile
    saveVariables(f)
    saveSwitches(f)
    saveTheFile(f)
  end

  def self.load
    f = loadTheFile
    loadVariables(f)
    loadSwitches(f)
  end

end # end of module LGlobalSave

#==============================================================================
# ** LGlobalSaveFile
#------------------------------------------------------------------------------
# An object of this class is saved in the global.sav file
# It contains all the saved variables and switches
#==============================================================================
class LGlobalSaveFile

  def initialize # Initializes the object
    @var = []
    @switch = [1]
  end

# @var holds the saved variables
# set and get methods:
  def getVar(id)
    return @var[id]
  end
  def setVar(id, val)
    @var[id] = val
  end

# @switch holds the saved switches
# set and get methods:
  def getSwitch(id)
    return @switch[id]
  end
  def setSwitch(id, val)
    @switch[id] = val
  end

end # end of class LGlobalSaveFile

#==============================================================================
# These methods are for saving and loading the global save file from an event
#==============================================================================
def global_save
  LGlobalSave.save
end
def global_load
  LGlobalSave.load
end
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager
  class << self
    alias glob_new_game setup_new_game
  end
  def self.setup_new_game
    glob_new_game
    LGlobalSave.load if LGlobalSave::LOAD_ON_NEW
  end
end # end of module DataManager

class Scene_Save
  alias glob_save_succ on_save_success
  def on_save_success
    LGlobalSave.save if LGlobalSave::SAVE_ON_SAVE
    glob_save_succ
  end
end

class Scene_Load
  alias glob_load_succ on_load_success
  def on_load_success
    LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
    glob_load_succ
  end
end
 

GothicMonocle

Dearly Departed
Veteran
Joined
Nov 20, 2017
Messages
46
Reaction score
12
First Language
Greek
Primarily Uses
RMMV
I looked further to the global save data. And turned out the script has a critical issue.
Whoever wrote the script looks like they weren't experienced on RGSS3.

The conflict goes like this.
Yami's overlay tried to flip the switch at the beginning of the game.
Global save reverts back Yami's attempt to flip the switch by overwriting it.
A simple fix could be, place the script above Yami's.
Or just simply ignore it, and flip the switch manually through events.

Although I did fix the script.
Code:
#==============================================================================
# # Global Save System [v1.0b]
# # By theLEECH
# # Fixed by TheoAllen
#==============================================================================
# ---INSTRUCTIONS---
# Put the numbers of the variables to save and the switches to save in the
# VARIABLES_TO_SAVE array, and the SWITCHES_TO_SAVE array.
# If you want to automatically load/update the globally saved data, set the
# SAVE_ON_SAVE LOAD_ON_LOAD and LOAD_ON_NEW flags to true accordingly.
#------------------------------------------------------------------------------
# You can load and save global data within an event, by using the script command
# and entering: "global_save" or "global_load" (Without qoutations)
#==============================================================================
#==============================================================================
# # LGlobalSave
#==============================================================================
module LGlobalSave

#==============================================================================
# CONFIGURATION
#==============================================================================
# Whether or not the variables and switches in the global file should be
# saved when the player saves the game
  SAVE_ON_SAVE = false
# Whether or not the variables and switches in the global file should be
# loaded when the player loads a save file
  LOAD_ON_LOAD = false
# Whether or not the variables and switches in the global file should be
# loaded when the player starts a new game
  LOAD_ON_NEW = true
# An array that contains a list of variables to save in the global save file
# Enter a list of variables, by number, seperated by commas.
# You can use '..' to include all variables between two numbers
# Example: 15..42
# Will include all variables or switches between 15 and 42 (inclusive)
# Leave blank to save none of that type
  VARIABLES_TO_SAVE = [1]
# Same as above, but for switches
  SWITCHES_TO_SAVE = [1,13]
# The name of the file to save global variables and switches in
  FILE_NAME = "Global.rvdata2"
#==============================================================================
# END OF CONFIGURATION
#==============================================================================

  def self.saveTheFile(f)
    File.open(FILE_NAME, "wb") do |file|
      Marshal.dump(f, file)
    end
  end

  def self.loadTheFile
    if !File.exists?(LGlobalSave::FILE_NAME)
      f = makeNewFile
      return f
    else
        f = nil
      File.open(FILE_NAME, "rb") do |file|
        f = Marshal.load(file)
      end
      return f
    end
  end

  def self.makeNewFile
    return LGlobalSaveFile.new
  end

  def self.loadVariables(f)
    for i in VARIABLES_TO_SAVE
      $game_variables[i]= f.getVar(i)
    end
  end

  def self.loadSwitches(f)
    for i in SWITCHES_TO_SAVE
      $game_switches[i]= f.getSwitch(i)
    end
  end

  def self.saveVariables(f)
    for i in VARIABLES_TO_SAVE
      f.setVar(i, $game_variables[i])
    end
  end

  def self.saveSwitches(f)
    for i in SWITCHES_TO_SAVE
      f.setSwitch(i, $game_switches[i])
    end
  end

  def self.save
    f = makeNewFile
    saveVariables(f)
    saveSwitches(f)
    saveTheFile(f)
  end

  def self.load
    f = loadTheFile
    loadVariables(f)
    loadSwitches(f)
  end

end # end of module LGlobalSave

#==============================================================================
# ** LGlobalSaveFile
#------------------------------------------------------------------------------
# An object of this class is saved in the global.sav file
# It contains all the saved variables and switches
#==============================================================================
class LGlobalSaveFile

  def initialize # Initializes the object
    @var = []
    @switch = [1]
  end

# @var holds the saved variables
# set and get methods:
  def getVar(id)
    return @var[id]
  end
  def setVar(id, val)
    @var[id] = val
  end

# @switch holds the saved switches
# set and get methods:
  def getSwitch(id)
    return @switch[id]
  end
  def setSwitch(id, val)
    @switch[id] = val
  end

end # end of class LGlobalSaveFile

#==============================================================================
# These methods are for saving and loading the global save file from an event
#==============================================================================
def global_save
  LGlobalSave.save
end
def global_load
  LGlobalSave.load
end
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager
  class << self
    alias glob_new_game setup_new_game
  end
  def self.setup_new_game
    glob_new_game
    LGlobalSave.load if LGlobalSave::LOAD_ON_NEW
  end
end # end of module DataManager

class Scene_Save
  alias glob_save_succ on_save_success
  def on_save_success
    LGlobalSave.save if LGlobalSave::SAVE_ON_SAVE
    glob_save_succ
  end
end

class Scene_Load
  alias glob_load_succ on_load_success
  def on_load_success
    LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
    glob_load_succ
  end
end
Hmm that's interesting. Even though now the variables and switches are fixed in a sense that they are displayed as [ON] in-game, the overlay graphic still doesn't appear.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Ok, so here is the thing. Try to create a project, containing only those two scripts, then try to replicate the error.
Send the new project here without unnecessary MBs and I will look into it.
 

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top