Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Compatibility: Rataime_Visual and Law's Custom Save System

Okay, I generally try for a couple of days to fix problems (including surfing boards for solutions) before I ask for help, but I cannot seem to find a solution to this problem either on my own, or with another's help. I am using Rataime_Visual (Shadows, Sun, Reflections, Mirrors, and Destruction Engine), along with Law's Custom Save System. Everything works fine when I play a New Game, do any of the visual effects, and even when I save a game. The moment I go to load a game, I get this error:

Script 'Sprite Shadow' line 304: NoMethodError occurred.

undefined method 'shadows' for nil:NilClass


If I remove the 'Sprite Shadow' Script, I get the same error for Sun, but with Line 239. If I remove Sun, it will work, but I effectively cannot have shadows in my game. It all points to the same 'line':

if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != [] for Shadows

if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != [] for Sun

I'm not a n00b with RGSS, but I'm no expert. I suspect that it's the way that the Custom Save System handles the sprites it imports into the 'screenshot'. I don't know how to fix this problem. Any help, even just pointing in the right direction, would be appreciated.

Here is Law's Save System, just in case:
Code:
#------------------------------------------------------------------------------

#==============================================================================

#==============================================================================

#======================*Law's Custom Save System*==============================

#=========================Author: The Law G14==================================

#============================Version 1.1=======================================

#==============================================================================

#------------------------------------------------------------------------------

 

#==============================================================================

# ** Module_Customization

#------------------------------------------------------------------------------

#  This module contains all the customization for the script

#==============================================================================

 

module Customization

  

  #----------------------------------------------------------------------------

  # * Config Begin

  #----------------------------------------------------------------------------

  

  # Here you can change the number of save slots that will be in your game

  SLOTS = 8

  # Here you can change the name of the text in the save slots

  SLOT_NAME = "Slot"

  

  # Here you can change what icon will appear next to a filename that isn't empty

  SLOT_ICON_SELECTED = "Keyblade1"

  # Here you can change what icon will appear next to a filename that is empty

  SLOT_ICON_UNSELECTED = "Keyblade2"

  

  # Draw Gold

  DRAW_GOLD = true

  # Draw Playtime

  DRAW_PLAYTIME = true

  # Draw location

  DRAW_LOCATION = true

  # Draw Actor's face

  DRAW_FACE = true

  # Draw Actor's name

  DRAW_NAME = true

    

  # Text inside file info window when empty

  EMPTY_SLOT_TEXT = "~EMPTY~"

  

  # Playtime Text

  PLAYTIME_TEXT = "Play Time: "

  # Gold Text

  GOLD_TEXT = "Money: "

  # Location Text

  LOCATION_TEXT = "Location: "

  

  # Map image border color (R,G,B,Opacity)

  MAP_BORDER = Color.new(0,0,0,200)

  

  # Text for help window when saving. Ex: "Which file would you like to save to?"

  SAVE_TEXT = "Which file would you like to save to?"

  # Text for help window when loading. Ex: "Which file would you like to load?"

  LOAD_TEXT = "Which file would you like to load?"

  

  # All windows' opacity (Lowest 0 - 255 Highest)

  # Use low opacity when having a background.

  WINDOW_OPACITY = 200

  # Background image file name, it must be in the pictures folder.

  # Put '' if you don't want a background.

  BACKGROUND_IMAGE = 'KingdomHeartsTitle'

  # Opacity for background image

  BACKGROUND_IMAGE_OPACITY = 255

    

  #----------------------------------------------------------------------------

  # * Config End

  #----------------------------------------------------------------------------

 

end

 

 

#==============================================================================

# ** Game_Map

#------------------------------------------------------------------------------

#  This class handles the map. It includes scrolling and passable determining

#  functions. Refer to "$game_map" for the instance of this class.

#==============================================================================

 

class Game_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :name

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias law_css_setup setup

  #--------------------------------------------------------------------------

  # * Setup

  #     map_id : map ID

  #--------------------------------------------------------------------------

  def setup(*args)

    # Run the original setup

    law_css_setup(*args)

    # Load the name of the map

    @name = load_data("Data/MapInfos.rxdata")[@map_id].name

  end

end

 

 

 

#==============================================================================

# ** Spriteset_Map_Loading_Preview

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc for the

#   loading screen's preview.

#==============================================================================

 

class Spriteset_Map_Loading_Preview

  #--------------------------------------------------------------------------

  # * Invariables

  #--------------------------------------------------------------------------

  RES_WIDTH =  352  # Please insert a number divisible by 32

  RES_HEIGHT = 160   # Please insert a number divisible by 32

  TOP_CORNER_X = 201

  TOP_CORNER_Y = 120

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    center

    # Make viewports

    @viewport1 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport2 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport3 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport1.z = 9200

    @viewport2.z = 9200

    @viewport3.z = 95000

    # Make tilemap

    @tilemap = Tilemap.new(@viewport1)

    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

    for i in 0..6

      autotile_name = $game_map.autotile_names[i]

      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)

    end

    @tilemap.map_data = $game_map.data

    @tilemap.priorities = $game_map.priorities

    # Make panorama plane

    @panorama = Plane.new(@viewport1)

    @panorama.z = -1000

    # Make fog plane

    @fog = Plane.new(@viewport1)

    @fog.z = 3000

    # Make character sprites

    @character_sprites = []

    for i in $game_map.events.keys.sort

      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])

      @character_sprites.push(sprite)

    end

    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

    # Make weather

    @weather = RPG::Weather.new(@viewport1)

    # Make picture sprites

    @picture_sprites = []

    for i in 1..50

      @picture_sprites.push(Sprite_Picture.new(@viewport2,

        $game_screen.pictures[i]))

    end

    # Make timer sprite

    @timer_sprite = Sprite_Timer.new

    # Frame update

    update

  end

  #--------------------------------------------------------------------------

  # * Dispose

  #--------------------------------------------------------------------------

  def dispose

    # Dispose of tilemap

    @tilemap.tileset.dispose

    for i in 0..6

      @tilemap.autotiles[i].dispose

    end

    @tilemap.dispose

    # Dispose of panorama plane

    @panorama.dispose

    # Dispose of fog plane

    @fog.dispose

    # Dispose of character sprites

    for sprite in @character_sprites

      sprite.dispose

    end

    # Dispose of weather

    @weather.dispose

    # Dispose of picture sprites

    for sprite in @picture_sprites

      sprite.dispose

    end

    # Dispose of timer sprite

    @timer_sprite.dispose

    # Dispose of viewports

    @viewport1.dispose

    @viewport2.dispose

    @viewport3.dispose

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    center

    # If panorama is different from current one

    if @panorama_name != $game_map.panorama_name or

       @panorama_hue != $game_map.panorama_hue

      @panorama_name = $game_map.panorama_name

      @panorama_hue = $game_map.panorama_hue

      if @panorama.bitmap != nil

        @panorama.bitmap.dispose

        @panorama.bitmap = nil

      end

      if @panorama_name != ""

        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

      end

      Graphics.frame_reset

    end

    # If fog is different than current fog

    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

      @fog_name = $game_map.fog_name

      @fog_hue = $game_map.fog_hue

      if @fog.bitmap != nil

        @fog.bitmap.dispose

        @fog.bitmap = nil

      end

      if @fog_name != ""

        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

      end

      Graphics.frame_reset

    end

    # Update tilemap

    @tilemap.ox = $game_map.display_x / 4

    @tilemap.oy =  $game_map.display_y / 4

    @tilemap.update

    # Update panorama plane

    @panorama.ox =  $game_map.display_x / 8

    @panorama.oy =  $game_map.display_y / 8

    # Update fog plane

    @fog.zoom_x = $game_map.fog_zoom / 100.0

    @fog.zoom_y = $game_map.fog_zoom / 100.0

    @fog.opacity = $game_map.fog_opacity

    @fog.blend_type = $game_map.fog_blend_type

    @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

    @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

    @fog.tone = $game_map.fog_tone

    # Update character sprites

    for sprite in @character_sprites

      sprite.update

    end

    # Update weather graphic

    @weather.type = $game_screen.weather_type

    @weather.max = $game_screen.weather_max

    @weather.ox = $game_map.display_x / 4

    @weather.oy = $game_map.display_y / 4

    @weather.update

    # Update picture sprites

    for sprite in @picture_sprites

      sprite.update

    end

    # Update timer sprite

    @timer_sprite.update

    # Set screen color tone and shake position

    @viewport1.tone = $game_screen.tone

    @viewport1.ox = $game_screen.shake

    # Set screen flash color

    @viewport3.color = $game_screen.flash_color

    # Update viewports

    @viewport1.update

    @viewport3.update

  end

  #--------------------------------------------------------------------------

  # * Set Map Display Position to Center of Screen

  #--------------------------------------------------------------------------

  def center

    x = $game_player.real_x

    y = $game_player.real_y

    max_x = [($game_map.width - RES_WIDTH / 32) * 128, RES_WIDTH].max

    max_y = [($game_map.height - RES_HEIGHT / 32) * 128, RES_HEIGHT].max

    center_x = (RES_WIDTH/2 - 16) * 4   # Center screen x-coordinate * 4

    center_y = (RES_HEIGHT/2 - 16) * 4   # Center screen y-coordinate * 4

    $game_map.display_x = [0, [x - center_x, max_x].min].max

    $game_map.display_y = [0, [y - center_y, max_y].min].max

    $game_map.refresh

  end

end

 

 

 

#==============================================================================

# ** Window_SaveFile

#------------------------------------------------------------------------------

#  This window displays save files on the save and load screens.

#==============================================================================

 

class Window_SaveFile < Window_Base

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :filename                 # file name

  attr_reader   :selected                 # selected

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     file_index : save file index (0-3)

  #     filename   : file name

  #--------------------------------------------------------------------------

  def initialize(file_index, filename, position)

    super(0, 64 + position * 52, 115, 52)

    self.contents = Bitmap.new(width - 32, height - 32)

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @time_stamp = Time.at(0)

    @file_exist = FileTest.exist?(@filename)

    if @file_exist

      file = File.open(@filename, "r")

      @time_stamp = file.mtime

      @characters = Marshal.load(file)

      @frame_count = Marshal.load(file)

      @game_system = Marshal.load(file)

      @game_switches = Marshal.load(file)

      @game_variables = Marshal.load(file)

      @total_sec = @frame_count / Graphics.frame_rate

      file.close

    end

    refresh

    @selected = false

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    if @file_exist

      # Draw file number

      self.contents.font.color = normal_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_SELECTED)

      @opacity = 255

    else

      self.contents.font.color = disabled_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_UNSELECTED)

      @opacity = 100

    end

    name = Customization::SLOT_NAME + "#{@file_index + 1}"

    self.contents.draw_text(20, -7, 600, 32, name)

    @name_width = contents.text_size(name).width

    self.contents.fill_rect(0, -2, 10, 32, Color.new(0, 0, 0, 0))

    self.contents.blt(0, -2, bitmap, Rect.new(0, 0, 24, 24), opacity)

  end

  #--------------------------------------------------------------------------

  # * Set Selected

  #     selected : new selected (true = selected, false = unselected)

  #--------------------------------------------------------------------------

  def selected=(selected)

    @selected = selected

    update_cursor_rect

  end

  #--------------------------------------------------------------------------

  # * Cursor Rectangle Update

  #--------------------------------------------------------------------------

  def update_cursor_rect

    if @selected

      self.cursor_rect.set(0, -7, @name_width + 38, 32)

    else

      self.cursor_rect.empty

    end

  end

end

 

 

 

#==============================================================================

# ** Window_FileInfo

#------------------------------------------------------------------------------

#  This window displays file information.

#==============================================================================

 

class Window_FileInfo < Window_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  if @law_save_resume_done_before.nil?

    alias nr_dispose dispose

    @law_save_resume_done_before = true

  end

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(115, 64, 525, 416)

    self.contents = Bitmap.new(width - 32, height - 32)

    refresh($game_temp.last_file_index)

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh(file_index)

    self.contents.clear

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @file_exist = FileTest.exist?(@filename)

    save_data = Customization::SLOTS

    # If save file exists

    if @file_exist

      file = File.open(@filename, "rb")

      $time_stamp =        file.mtime

      $characters =        Marshal.load(file)

      @frame_count =       Marshal.load(file)

      $game_system = Marshal.load(file)

      $game_switches = Marshal.load(file)

      $game_variables = Marshal.load(file)

      $game_self_switches =  Marshal.load(file)

      $game_screen = Marshal.load(file)

      $game_actors = Marshal.load(file)

      $game_party = Marshal.load(file)

      $game_troop = Marshal.load(file)

      $game_map = Marshal.load(file)

      $game_player = Marshal.load(file)

      file.close

      @total_sec = @frame_count / Graphics.frame_rate

      # Draw Screenshot

      begin

        width = 352 + 4

        height = 160 + 4

        x = (self.width - 32 - width) / 2

        y = 54 - 16

        self.contents.fill_rect(x, y, width, height, Customization::MAP_BORDER)

        @spriteset = Spriteset_Map_Loading_Preview.new

      end

      # Draw Gold

      if Customization::DRAW_GOLD

        cx = contents.text_size($data_system.words.gold).width

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(40, 0, 140, 32, $game_party.gold.to_s, 2)

        self.contents.font.color = system_color

        self.contents.draw_text(140, 0, 100, 32, $data_system.words.gold, 2)

        self.contents.draw_text(-20, -1, 100, 32, Customization::GOLD_TEXT, 2)  

      end

      # Draw actor face

      if Customization::DRAW_FACE

        for i in 0...$game_party.actors.size

          actor = $game_party.actors[i]

          draw_actor_face_graphic(actor, i*129, 250)

        end  

      end

      # Draw actor name

      if Customization::DRAW_NAME

        for i in 0...$game_party.actors.size

          self.contents.font.color = system_color

          self.contents.font.size = 25

          actor = $game_party.actors[i]

          draw_actor_name(actor, (i*130) + 25, 350)

        end 

      end

      # Draw play time

      if Customization::DRAW_PLAYTIME

        hour = @total_sec / 60 / 60

        min = @total_sec / 60 % 60

        sec = @total_sec % 60

        time_string = sprintf("%02d:%02d:%02d", hour, min, sec)

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(380, 0, 100, 32, time_string, 2)

        self.contents.font.color = system_color

        time_string = Customization::PLAYTIME_TEXT

        self.contents.draw_text(230, 0, 150, 32, time_string, 2)

      end

      # Draw Location

      if Customization::DRAW_LOCATION

        self.contents.font.color = system_color

        self.contents.font.size = 25

        self.contents.draw_text(4, 210, 120, 32, Customization::LOCATION_TEXT)

        self.contents.font.color = normal_color

        x = (Customization::LOCATION_TEXT.length * 10) + 5

        self.contents.draw_text(x, 210, 120, 32, $game_map.name.to_s, 2)

      end

    else

      self.contents.draw_text(-20, 50, self.contents.width, self.contents.height - 200, Customization::EMPTY_SLOT_TEXT, 1)

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Actor Face Graphic

  #--------------------------------------------------------------------------

  def draw_actor_face_graphic(actor, x, y)

    bitmap = RPG::Cache.picture(actor.id.to_s)

    self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))

  end

  #--------------------------------------------------------------------------

  # * Dispose Window

  #--------------------------------------------------------------------------

  def dispose(*args)

    nr_dispose(*args)

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

  end

end

 

 

 

#==============================================================================

# ** Scene_File

#------------------------------------------------------------------------------

#  This is a superclass for the save screen and load screen.

#==============================================================================

 

class Scene_File

  #--------------------------------------------------------------------------

  # * Invariables

  #--------------------------------------------------------------------------

  CENTER_X = (320 - 16) * 4   # Center screen x-coordinate * 4

  CENTER_Y = (240 - 16) * 4   # Center screen y-coordinate * 4

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     help_text : text string shown in the help window

  #--------------------------------------------------------------------------

  def initialize(help_text)

    @help_text = help_text

  end

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    @cursor_displace = 0

    # Make help window

    @help_window = Window_Help.new

    @help_window.set_text(@help_text)

    @help_window.opacity = Customization::WINDOW_OPACITY

    # Make save file window

    @savefile_windows = []

    for i in 0..Customization::SLOTS - 1

      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))

    end

    # Select last file to be operated

    @file_index = $game_temp.last_file_index

    @savefile_windows[@file_index].selected = true

    for i in @savefile_windows

      i.opacity = Customization::WINDOW_OPACITY

    end

    # Make FileInfo window

    @fileinfo_window = Window_FileInfo.new

    @fileinfo_window.opacity = Customization::WINDOW_OPACITY

    # Make background

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.picture(Customization::BACKGROUND_IMAGE)

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of windows

    @help_window.dispose

    for i in @savefile_windows

      i.dispose

    end

    @fileinfo_window.dispose

    @sprite.dispose

    @sprite.bitmap.dispose

   # $game_player.center($game_player.x, $game_player.y)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # Update windows

    @help_window.update

    @fileinfo_window.update

    for i in @savefile_windows

      i.update

    end    

    # If C button was pressed

    if Input.trigger?(Input::C)

      # Call method: on_decision (defined by the subclasses)

      on_decision(make_filename(@file_index))

      $game_temp.last_file_index = @file_index

      @fileinfo_window.refresh(@file_index)

      center

      return

    end

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Call method: on_cancel (defined by the subclasses)

      on_cancel

      return

    end

    # If the down directional button was pressed

    if Input.repeat?(Input::DOWN)

      if Input.trigger?(Input::DOWN) or @file_index < Customization::SLOTS - 1

      if @file_index == Customization::SLOTS - 1

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace += 1

      if @cursor_displace == 8

        @cursor_displace = 7

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 6 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index + 1)

      if @file_index == 8

        @file_index = 7

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

    # If the up directional button was pressed

    if Input.repeat?(Input::UP)

      if Input.trigger?(Input::UP) or @file_index > 0

      if @file_index == 0

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace -= 1

      if @cursor_displace == -1

        @cursor_displace = 0

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 1 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index - 1)

      if @file_index == -1

        @file_index = 0

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Make File Name

  #     file_index : save file index (0-3)

  #--------------------------------------------------------------------------

  def make_filename(file_index)

    return Customization::SLOT_NAME + "#{file_index + 1}.rxdata"

  end

  #--------------------------------------------------------------------------

  # * Backup Data

  #--------------------------------------------------------------------------

  def backup_data

    @nr_game_system = $game_system.clone

    @nr_game_switches = $game_switches.clone

    @nr_game_variables = $game_variables.clone

    @nr_game_self_switches = $game_self_switches.clone

    @nr_game_screen = $game_screen.clone

    @nr_game_actors = $game_actors.clone

    @nr_game_party = $game_party.clone

    @nr_game_troop = $game_troop.clone

    @nr_game_map = $game_map.clone

    @nr_game_player = $game_player.clone

  end

  #--------------------------------------------------------------------------

  # * Load Backup Data

  #--------------------------------------------------------------------------

  def load_backup_data

    $game_system = @nr_game_system.clone

    $game_switches = @nr_game_switches.clone

    $game_variables = @nr_game_variables.clone

    $game_self_switches = @nr_game_self_switches.clone

    $game_screen = @nr_game_screen.clone

    $game_actors = @nr_game_actors.clone

    $game_party = @nr_game_party.clone

    $game_troop = @nr_game_troop.clone

    $game_map = @nr_game_map.clone

    $game_player = @nr_game_player.clone

  end

  #--------------------------------------------------------------------------

  # * Set Map Display Position to Center of Screen

  #--------------------------------------------------------------------------

  def center

    max_x = ($game_map.width - 20) * 128

    max_y = ($game_map.height - 15) * 128

    x = $game_player.x

    y = $game_player.y

    $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max

    $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max

  end

end

 

 

 

#==============================================================================

# ** Scene_Save

#------------------------------------------------------------------------------

#  This class performs save screen processing.

#==============================================================================

 

class Scene_Save < Scene_File

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias law_css_scene_save_initialize initialize

  alias nr_css_scene_save_on_cancel on_cancel

  alias nr_css_scene_save_on_desision on_decision

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize(*args)

    backup_data

    law_css_scene_save_initialize(*args)

    super(Customization::SAVE_TEXT)

  end

  #--------------------------------------------------------------------------

  # * On Decision

  #--------------------------------------------------------------------------

  def on_decision(*args)

    load_backup_data

    nr_css_scene_save_on_desision(*args)

    center

  end

  #--------------------------------------------------------------------------

  # * On Decision

  #--------------------------------------------------------------------------

  def on_cancel(*args)

    load_backup_data

    nr_css_scene_save_on_cancel(*args)

  end

end

 

 

 

#==============================================================================

# ** Scene_Load

#------------------------------------------------------------------------------

#  This class performs load screen processing.

#==============================================================================

 

class Scene_Load < Scene_File

  

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  if @nr_css_done_before.nil?

    alias law_css_scene_load_initialize initialize

    @nr_css_done_before = true

  end

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize(*args)

    law_css_scene_load_initialize(*args)

    super(Customization::LOAD_TEXT)

  end

end

 

 

 

#==============================================================================

# ** Scene_Title

#------------------------------------------------------------------------------

#  This class performs title screen processing.

#==============================================================================

 

class Scene_Title

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    # If battle test

    if $BTEST

      battle_test

      return

    end

    # Load database

    $data_actors        = load_data("Data/Actors.rxdata")

    $data_classes       = load_data("Data/Classes.rxdata")

    $data_skills        = load_data("Data/Skills.rxdata")

    $data_items         = load_data("Data/Items.rxdata")

    $data_weapons       = load_data("Data/Weapons.rxdata")

    $data_armors        = load_data("Data/Armors.rxdata")

    $data_enemies       = load_data("Data/Enemies.rxdata")

    $data_troops        = load_data("Data/Troops.rxdata")

    $data_states        = load_data("Data/States.rxdata")

    $data_animations    = load_data("Data/Animations.rxdata")

    $data_tilesets      = load_data("Data/Tilesets.rxdata")

    $data_common_events = load_data("Data/CommonEvents.rxdata")

    $data_system        = load_data("Data/System.rxdata")

    # Make system object

    $game_system = Game_System.new

    # Make title graphic

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.title($data_system.title_name)

    # Make command window

    s1 = "New Game"

    s2 = "Continue"

    s3 = "Shutdown"

    @command_window = Window_Command.new(192, [s1, s2, s3])

    @command_window.back_opacity = 160

    @command_window.x = 320 - @command_window.width / 2

    @command_window.y = 288

    # Continue enabled determinant

    # Check if at least one save file exists

    # If enabled, make @continue_enabled true; if disabled, make it false

    @continue_enabled = false

    for i in 0..Customization::SLOTS

      if FileTest.exist?(Customization::SLOT_NAME + "#{i + 1}.rxdata")

        @continue_enabled = true

      end

    end

    # If continue is enabled, move cursor to "Continue"

    # If disabled, display "Continue" text in gray

    if @continue_enabled

      @command_window.index = 1

    else

      @command_window.disable_item(1)

    end

    # Play title BGM

    $game_system.bgm_play($data_system.title_bgm)

    # Stop playing ME and BGS

    Audio.me_stop

    Audio.bgs_stop

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of command window

    @command_window.dispose

    # Dispose of title graphic

    @sprite.bitmap.dispose

    @sprite.dispose

  end

end

Thanks in advance!
 
Following the rule and bumping after 72 hours. I'm still unable to solve this one on my own and it's a little on the frustrating side. Any help from anyone, even if it's just pointing me in a direction May not have looked at previously, would be great. Thanks!
 

Star

Sponsor

*points you in the right direction.*

Before ANYONE can help you, you need to post BOTH scripts in here, not just one. Nobody's willing to go completely out of their way to help you by frantically searching the web for the missing script. Once you have done that, then I'll look at it.
 
My sincerest apologies. Here you go:

Code:
#------------------------------------------------------------------------------

#==============================================================================

#==============================================================================

#======================*Law's Custom Save System*==============================

#=========================Author: The Law G14==================================

#============================Version 1.1=======================================

#==============================================================================

#------------------------------------------------------------------------------

 

#==============================================================================

# ** Module_Customization

#------------------------------------------------------------------------------

#  This module contains all the customization for the script

#==============================================================================

 

module Customization

  

  #----------------------------------------------------------------------------

  # * Config Begin

  #----------------------------------------------------------------------------

  

  # Here you can change the number of save slots that will be in your game

  SLOTS = 8

  # Here you can change the name of the text in the save slots

  SLOT_NAME = "Slot"

  

  # Here you can change what icon will appear next to a filename that isn't empty

  SLOT_ICON_SELECTED = "Keyblade1"

  # Here you can change what icon will appear next to a filename that is empty

  SLOT_ICON_UNSELECTED = "Keyblade2"

  

  # Draw Gold

  DRAW_GOLD = true

  # Draw Playtime

  DRAW_PLAYTIME = true

  # Draw location

  DRAW_LOCATION = true

  # Draw Actor's face

  DRAW_FACE = true

  # Draw Actor's name

  DRAW_NAME = true

    

  # Text inside file info window when empty

  EMPTY_SLOT_TEXT = "~EMPTY~"

  

  # Playtime Text

  PLAYTIME_TEXT = "Play Time: "

  # Gold Text

  GOLD_TEXT = "Money: "

  # Location Text

  LOCATION_TEXT = "Location: "

  

  # Map image border color (R,G,B,Opacity)

  MAP_BORDER = Color.new(0,0,0,200)

  

  # Text for help window when saving. Ex: "Which file would you like to save to?"

  SAVE_TEXT = "Which file would you like to save to?"

  # Text for help window when loading. Ex: "Which file would you like to load?"

  LOAD_TEXT = "Which file would you like to load?"

  

  # All windows' opacity (Lowest 0 - 255 Highest)

  # Use low opacity when having a background.

  WINDOW_OPACITY = 200

  # Background image file name, it must be in the pictures folder.

  # Put '' if you don't want a background.

  BACKGROUND_IMAGE = 'KingdomHeartsTitle'

  # Opacity for background image

  BACKGROUND_IMAGE_OPACITY = 255

    

  #----------------------------------------------------------------------------

  # * Config End

  #----------------------------------------------------------------------------

 

end

 

 

#==============================================================================

# ** Game_Map

#------------------------------------------------------------------------------

#  This class handles the map. It includes scrolling and passable determining

#  functions. Refer to "$game_map" for the instance of this class.

#==============================================================================

 

class Game_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :name

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias law_css_setup setup

  #--------------------------------------------------------------------------

  # * Setup

  #     map_id : map ID

  #--------------------------------------------------------------------------

  def setup(*args)

    # Run the original setup

    law_css_setup(*args)

    # Load the name of the map

    @name = load_data("Data/MapInfos.rxdata")[@map_id].name

  end

end

 

 

 

#==============================================================================

# ** Spriteset_Map_Loading_Preview

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc for the

#   loading screen's preview.

#==============================================================================

 

class Spriteset_Map_Loading_Preview

  #--------------------------------------------------------------------------

  # * Invariables

  #--------------------------------------------------------------------------

  RES_WIDTH =  352  # Please insert a number divisible by 32

  RES_HEIGHT = 160   # Please insert a number divisible by 32

  TOP_CORNER_X = 201

  TOP_CORNER_Y = 120

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    center

    # Make viewports

    @viewport1 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport2 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport3 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport1.z = 9200

    @viewport2.z = 9200

    @viewport3.z = 95000

    # Make tilemap

    @tilemap = Tilemap.new(@viewport1)

    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

    for i in 0..6

      autotile_name = $game_map.autotile_names[i]

      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)

    end

    @tilemap.map_data = $game_map.data

    @tilemap.priorities = $game_map.priorities

    # Make panorama plane

    @panorama = Plane.new(@viewport1)

    @panorama.z = -1000

    # Make fog plane

    @fog = Plane.new(@viewport1)

    @fog.z = 3000

    # Make character sprites

    @character_sprites = []

    for i in $game_map.events.keys.sort

      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])

      @character_sprites.push(sprite)

    end

    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

    # Make weather

    @weather = RPG::Weather.new(@viewport1)

    # Make picture sprites

    @picture_sprites = []

    for i in 1..50

      @picture_sprites.push(Sprite_Picture.new(@viewport2,

        $game_screen.pictures[i]))

    end

    # Make timer sprite

    @timer_sprite = Sprite_Timer.new

    # Frame update

    update

  end

  #--------------------------------------------------------------------------

  # * Dispose

  #--------------------------------------------------------------------------

  def dispose

    # Dispose of tilemap

    @tilemap.tileset.dispose

    for i in 0..6

      @tilemap.autotiles[i].dispose

    end

    @tilemap.dispose

    # Dispose of panorama plane

    @panorama.dispose

    # Dispose of fog plane

    @fog.dispose

    # Dispose of character sprites

    for sprite in @character_sprites

      sprite.dispose

    end

    # Dispose of weather

    @weather.dispose

    # Dispose of picture sprites

    for sprite in @picture_sprites

      sprite.dispose

    end

    # Dispose of timer sprite

    @timer_sprite.dispose

    # Dispose of viewports

    @viewport1.dispose

    @viewport2.dispose

    @viewport3.dispose

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    center

    # If panorama is different from current one

    if @panorama_name != $game_map.panorama_name or

       @panorama_hue != $game_map.panorama_hue

      @panorama_name = $game_map.panorama_name

      @panorama_hue = $game_map.panorama_hue

      if @panorama.bitmap != nil

        @panorama.bitmap.dispose

        @panorama.bitmap = nil

      end

      if @panorama_name != ""

        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

      end

      Graphics.frame_reset

    end

    # If fog is different than current fog

    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

      @fog_name = $game_map.fog_name

      @fog_hue = $game_map.fog_hue

      if @fog.bitmap != nil

        @fog.bitmap.dispose

        @fog.bitmap = nil

      end

      if @fog_name != ""

        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

      end

      Graphics.frame_reset

    end

    # Update tilemap

    @tilemap.ox = $game_map.display_x / 4

    @tilemap.oy =  $game_map.display_y / 4

    @tilemap.update

    # Update panorama plane

    @panorama.ox =  $game_map.display_x / 8

    @panorama.oy =  $game_map.display_y / 8

    # Update fog plane

    @fog.zoom_x = $game_map.fog_zoom / 100.0

    @fog.zoom_y = $game_map.fog_zoom / 100.0

    @fog.opacity = $game_map.fog_opacity

    @fog.blend_type = $game_map.fog_blend_type

    @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

    @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

    @fog.tone = $game_map.fog_tone

    # Update character sprites

    for sprite in @character_sprites

      sprite.update

    end

    # Update weather graphic

    @weather.type = $game_screen.weather_type

    @weather.max = $game_screen.weather_max

    @weather.ox = $game_map.display_x / 4

    @weather.oy = $game_map.display_y / 4

    @weather.update

    # Update picture sprites

    for sprite in @picture_sprites

      sprite.update

    end

    # Update timer sprite

    @timer_sprite.update

    # Set screen color tone and shake position

    @viewport1.tone = $game_screen.tone

    @viewport1.ox = $game_screen.shake

    # Set screen flash color

    @viewport3.color = $game_screen.flash_color

    # Update viewports

    @viewport1.update

    @viewport3.update

  end

  #--------------------------------------------------------------------------

  # * Set Map Display Position to Center of Screen

  #--------------------------------------------------------------------------

  def center

    x = $game_player.real_x

    y = $game_player.real_y

    max_x = [($game_map.width - RES_WIDTH / 32) * 128, RES_WIDTH].max

    max_y = [($game_map.height - RES_HEIGHT / 32) * 128, RES_HEIGHT].max

    center_x = (RES_WIDTH/2 - 16) * 4   # Center screen x-coordinate * 4

    center_y = (RES_HEIGHT/2 - 16) * 4   # Center screen y-coordinate * 4

    $game_map.display_x = [0, [x - center_x, max_x].min].max

    $game_map.display_y = [0, [y - center_y, max_y].min].max

    $game_map.refresh

  end

end

 

 

 

#==============================================================================

# ** Window_SaveFile

#------------------------------------------------------------------------------

#  This window displays save files on the save and load screens.

#==============================================================================

 

class Window_SaveFile < Window_Base

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :filename                 # file name

  attr_reader   :selected                 # selected

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     file_index : save file index (0-3)

  #     filename   : file name

  #--------------------------------------------------------------------------

  def initialize(file_index, filename, position)

    super(0, 64 + position * 52, 115, 52)

    self.contents = Bitmap.new(width - 32, height - 32)

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @time_stamp = Time.at(0)

    @file_exist = FileTest.exist?(@filename)

    if @file_exist

      file = File.open(@filename, "r")

      @time_stamp = file.mtime

      @characters = Marshal.load(file)

      @frame_count = Marshal.load(file)

      @game_system = Marshal.load(file)

      @game_switches = Marshal.load(file)

      @game_variables = Marshal.load(file)

      @total_sec = @frame_count / Graphics.frame_rate

      file.close

    end

    refresh

    @selected = false

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    if @file_exist

      # Draw file number

      self.contents.font.color = normal_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_SELECTED)

      @opacity = 255

    else

      self.contents.font.color = disabled_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_UNSELECTED)

      @opacity = 100

    end

    name = Customization::SLOT_NAME + "#{@file_index + 1}"

    self.contents.draw_text(20, -7, 600, 32, name)

    @name_width = contents.text_size(name).width

    self.contents.fill_rect(0, -2, 10, 32, Color.new(0, 0, 0, 0))

    self.contents.blt(0, -2, bitmap, Rect.new(0, 0, 24, 24), opacity)

  end

  #--------------------------------------------------------------------------

  # * Set Selected

  #     selected : new selected (true = selected, false = unselected)

  #--------------------------------------------------------------------------

  def selected=(selected)

    @selected = selected

    update_cursor_rect

  end

  #--------------------------------------------------------------------------

  # * Cursor Rectangle Update

  #--------------------------------------------------------------------------

  def update_cursor_rect

    if @selected

      self.cursor_rect.set(0, -7, @name_width + 38, 32)

    else

      self.cursor_rect.empty

    end

  end

end

 

 

 

#==============================================================================

# ** Window_FileInfo

#------------------------------------------------------------------------------

#  This window displays file information.

#==============================================================================

 

class Window_FileInfo < Window_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  if @law_save_resume_done_before.nil?

    alias nr_dispose dispose

    @law_save_resume_done_before = true

  end

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(115, 64, 525, 416)

    self.contents = Bitmap.new(width - 32, height - 32)

    refresh($game_temp.last_file_index)

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh(file_index)

    self.contents.clear

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @file_exist = FileTest.exist?(@filename)

    save_data = Customization::SLOTS

    # If save file exists

    if @file_exist

      file = File.open(@filename, "rb")

      $time_stamp =        file.mtime

      $characters =        Marshal.load(file)

      @frame_count =       Marshal.load(file)

      $game_system = Marshal.load(file)

      $game_switches = Marshal.load(file)

      $game_variables = Marshal.load(file)

      $game_self_switches =  Marshal.load(file)

      $game_screen = Marshal.load(file)

      $game_actors = Marshal.load(file)

      $game_party = Marshal.load(file)

      $game_troop = Marshal.load(file)

      $game_map = Marshal.load(file)

      $game_player = Marshal.load(file)

      file.close

      @total_sec = @frame_count / Graphics.frame_rate

      # Draw Screenshot

      begin

        width = 352 + 4

        height = 160 + 4

        x = (self.width - 32 - width) / 2

        y = 54 - 16

        self.contents.fill_rect(x, y, width, height, Customization::MAP_BORDER)

        @spriteset = Spriteset_Map_Loading_Preview.new

      end

      # Draw Gold

      if Customization::DRAW_GOLD

        cx = contents.text_size($data_system.words.gold).width

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(40, 0, 140, 32, $game_party.gold.to_s, 2)

        self.contents.font.color = system_color

        self.contents.draw_text(140, 0, 100, 32, $data_system.words.gold, 2)

        self.contents.draw_text(-20, -1, 100, 32, Customization::GOLD_TEXT, 2)  

      end

      # Draw actor face

      if Customization::DRAW_FACE

        for i in 0...$game_party.actors.size

          actor = $game_party.actors[i]

          draw_actor_face_graphic(actor, i*129, 250)

        end  

      end

      # Draw actor name

      if Customization::DRAW_NAME

        for i in 0...$game_party.actors.size

          self.contents.font.color = system_color

          self.contents.font.size = 25

          actor = $game_party.actors[i]

          draw_actor_name(actor, (i*130) + 25, 350)

        end 

      end

      # Draw play time

      if Customization::DRAW_PLAYTIME

        hour = @total_sec / 60 / 60

        min = @total_sec / 60 % 60

        sec = @total_sec % 60

        time_string = sprintf("%02d:%02d:%02d", hour, min, sec)

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(380, 0, 100, 32, time_string, 2)

        self.contents.font.color = system_color

        time_string = Customization::PLAYTIME_TEXT

        self.contents.draw_text(230, 0, 150, 32, time_string, 2)

      end

      # Draw Location

      if Customization::DRAW_LOCATION

        self.contents.font.color = system_color

        self.contents.font.size = 25

        self.contents.draw_text(4, 210, 120, 32, Customization::LOCATION_TEXT)

        self.contents.font.color = normal_color

        x = (Customization::LOCATION_TEXT.length * 10) + 5

        self.contents.draw_text(x, 210, 120, 32, $game_map.name.to_s, 2)

      end

    else

      self.contents.draw_text(-20, 50, self.contents.width, self.contents.height - 200, Customization::EMPTY_SLOT_TEXT, 1)

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Actor Face Graphic

  #--------------------------------------------------------------------------

  def draw_actor_face_graphic(actor, x, y)

    bitmap = RPG::Cache.picture(actor.id.to_s)

    self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))

  end

  #--------------------------------------------------------------------------

  # * Dispose Window

  #--------------------------------------------------------------------------

  def dispose(*args)

    nr_dispose(*args)

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

  end

end

 

 

 

#==============================================================================

# ** Scene_File

#------------------------------------------------------------------------------

#  This is a superclass for the save screen and load screen.

#==============================================================================

 

class Scene_File

  #--------------------------------------------------------------------------

  # * Invariables

  #--------------------------------------------------------------------------

  CENTER_X = (320 - 16) * 4   # Center screen x-coordinate * 4

  CENTER_Y = (240 - 16) * 4   # Center screen y-coordinate * 4

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     help_text : text string shown in the help window

  #--------------------------------------------------------------------------

  def initialize(help_text)

    @help_text = help_text

  end

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    @cursor_displace = 0

    # Make help window

    @help_window = Window_Help.new

    @help_window.set_text(@help_text)

    @help_window.opacity = Customization::WINDOW_OPACITY

    # Make save file window

    @savefile_windows = []

    for i in 0..Customization::SLOTS - 1

      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))

    end

    # Select last file to be operated

    @file_index = $game_temp.last_file_index

    @savefile_windows[@file_index].selected = true

    for i in @savefile_windows

      i.opacity = Customization::WINDOW_OPACITY

    end

    # Make FileInfo window

    @fileinfo_window = Window_FileInfo.new

    @fileinfo_window.opacity = Customization::WINDOW_OPACITY

    # Make background

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.picture(Customization::BACKGROUND_IMAGE)

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of windows

    @help_window.dispose

    for i in @savefile_windows

      i.dispose

    end

    @fileinfo_window.dispose

    @sprite.dispose

    @sprite.bitmap.dispose

   # $game_player.center($game_player.x, $game_player.y)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # Update windows

    @help_window.update

    @fileinfo_window.update

    for i in @savefile_windows

      i.update

    end    

    # If C button was pressed

    if Input.trigger?(Input::C)

      # Call method: on_decision (defined by the subclasses)

      on_decision(make_filename(@file_index))

      $game_temp.last_file_index = @file_index

      @fileinfo_window.refresh(@file_index)

      center

      return

    end

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Call method: on_cancel (defined by the subclasses)

      on_cancel

      return

    end

    # If the down directional button was pressed

    if Input.repeat?(Input::DOWN)

      if Input.trigger?(Input::DOWN) or @file_index < Customization::SLOTS - 1

      if @file_index == Customization::SLOTS - 1

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace += 1

      if @cursor_displace == 8

        @cursor_displace = 7

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 6 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index + 1)

      if @file_index == 8

        @file_index = 7

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

    # If the up directional button was pressed

    if Input.repeat?(Input::UP)

      if Input.trigger?(Input::UP) or @file_index > 0

      if @file_index == 0

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace -= 1

      if @cursor_displace == -1

        @cursor_displace = 0

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 1 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index - 1)

      if @file_index == -1

        @file_index = 0

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Make File Name

  #     file_index : save file index (0-3)

  #--------------------------------------------------------------------------

  def make_filename(file_index)

    return Customization::SLOT_NAME + "#{file_index + 1}.rxdata"

  end

  #--------------------------------------------------------------------------

  # * Backup Data

  #--------------------------------------------------------------------------

  def backup_data

    @nr_game_system = $game_system.clone

    @nr_game_switches = $game_switches.clone

    @nr_game_variables = $game_variables.clone

    @nr_game_self_switches = $game_self_switches.clone

    @nr_game_screen = $game_screen.clone

    @nr_game_actors = $game_actors.clone

    @nr_game_party = $game_party.clone

    @nr_game_troop = $game_troop.clone

    @nr_game_map = $game_map.clone

    @nr_game_player = $game_player.clone

  end

  #--------------------------------------------------------------------------

  # * Load Backup Data

  #--------------------------------------------------------------------------

  def load_backup_data

    $game_system = @nr_game_system.clone

    $game_switches = @nr_game_switches.clone

    $game_variables = @nr_game_variables.clone

    $game_self_switches = @nr_game_self_switches.clone

    $game_screen = @nr_game_screen.clone

    $game_actors = @nr_game_actors.clone

    $game_party = @nr_game_party.clone

    $game_troop = @nr_game_troop.clone

    $game_map = @nr_game_map.clone

    $game_player = @nr_game_player.clone

  end

  #--------------------------------------------------------------------------

  # * Set Map Display Position to Center of Screen

  #--------------------------------------------------------------------------

  def center

    max_x = ($game_map.width - 20) * 128

    max_y = ($game_map.height - 15) * 128

    x = $game_player.x

    y = $game_player.y

    $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max

    $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max

  end

end

 

 

 

#==============================================================================

# ** Scene_Save

#------------------------------------------------------------------------------

#  This class performs save screen processing.

#==============================================================================

 

class Scene_Save < Scene_File

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias law_css_scene_save_initialize initialize

  alias nr_css_scene_save_on_cancel on_cancel

  alias nr_css_scene_save_on_desision on_decision

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize(*args)

    backup_data

    law_css_scene_save_initialize(*args)

    super(Customization::SAVE_TEXT)

  end

  #--------------------------------------------------------------------------

  # * On Decision

  #--------------------------------------------------------------------------

  def on_decision(*args)

    load_backup_data

    nr_css_scene_save_on_desision(*args)

    center

  end

  #--------------------------------------------------------------------------

  # * On Decision

  #--------------------------------------------------------------------------

  def on_cancel(*args)

    load_backup_data

    nr_css_scene_save_on_cancel(*args)

  end

end

 

 

 

#==============================================================================

# ** Scene_Load

#------------------------------------------------------------------------------

#  This class performs load screen processing.

#==============================================================================

 

class Scene_Load < Scene_File

  

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  if @nr_css_done_before.nil?

    alias law_css_scene_load_initialize initialize

    @nr_css_done_before = true

  end

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize(*args)

    law_css_scene_load_initialize(*args)

    super(Customization::LOAD_TEXT)

  end

end

 

 

 

#==============================================================================

# ** Scene_Title

#------------------------------------------------------------------------------

#  This class performs title screen processing.

#==============================================================================

 

class Scene_Title

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    # If battle test

    if $BTEST

      battle_test

      return

    end

    # Load database

    $data_actors        = load_data("Data/Actors.rxdata")

    $data_classes       = load_data("Data/Classes.rxdata")

    $data_skills        = load_data("Data/Skills.rxdata")

    $data_items         = load_data("Data/Items.rxdata")

    $data_weapons       = load_data("Data/Weapons.rxdata")

    $data_armors        = load_data("Data/Armors.rxdata")

    $data_enemies       = load_data("Data/Enemies.rxdata")

    $data_troops        = load_data("Data/Troops.rxdata")

    $data_states        = load_data("Data/States.rxdata")

    $data_animations    = load_data("Data/Animations.rxdata")

    $data_tilesets      = load_data("Data/Tilesets.rxdata")

    $data_common_events = load_data("Data/CommonEvents.rxdata")

    $data_system        = load_data("Data/System.rxdata")

    # Make system object

    $game_system = Game_System.new

    # Make title graphic

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.title($data_system.title_name)

    # Make command window

    s1 = "New Game"

    s2 = "Continue"

    s3 = "Shutdown"

    @command_window = Window_Command.new(192, [s1, s2, s3])

    @command_window.back_opacity = 160

    @command_window.x = 320 - @command_window.width / 2

    @command_window.y = 288

    # Continue enabled determinant

    # Check if at least one save file exists

    # If enabled, make @continue_enabled true; if disabled, make it false

    @continue_enabled = false

    for i in 0..Customization::SLOTS

      if FileTest.exist?(Customization::SLOT_NAME + "#{i + 1}.rxdata")

        @continue_enabled = true

      end

    end

    # If continue is enabled, move cursor to "Continue"

    # If disabled, display "Continue" text in gray

    if @continue_enabled

      @command_window.index = 1

    else

      @command_window.disable_item(1)

    end

    # Play title BGM

    $game_system.bgm_play($data_system.title_bgm)

    # Stop playing ME and BGS

    Audio.me_stop

    Audio.bgs_stop

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of command window

    @command_window.dispose

    # Dispose of title graphic

    @sprite.bitmap.dispose

    @sprite.dispose

  end

end

Code:
#==============================================================================

# ** Sprite Shadow (Sprite_Ombre )

#------------------------------------------------------------------------------

#    Based on Genzai Kawakami's shadows

#    dynamisme & features by Rataime

#    extra features Boushy

#    New Edits by DerVVulfman

#    February 24, 2008

#

#------------------------------------------------------------------------------

# 

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map.   The player can move around  a 'light source' event and

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Light Source

#     To create a light source, you need to create a map event that is to be

#     used 'as' the light source.   Most of the time,  these could be events

#     that sport 'torch' or 'lantern' charactersets.  Just examples :)

#

#     To make one of these events a light source,  you need  to insert a few

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment to add is "begin Shadow Source" (without quotes). It

#     informs the system  that this event is a light source.   The remaining

#     three values are optional and have default values in the configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     anglemin 'number'     --- Starting position of a lightsource's arc.

#     anglemax 'number'     --- Ending position of a lightsource's arc.

#     distancemax 'number'  --- How far away from the 'source' you can go

#     self_opacity 'number' --- How dark the shadow will grow.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#  -- Blocking Shadows

#     To prevent shadows  from passing through  solid objects such as doors, 

#     walls, cabinets or other forms of furniture,  you will want to apply a

#     priority flag of '1' or higher on these items.  Normally, walls in the

#     default database do not have a priority flag as they merely block  the

#     player from passing through.

#     

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS 

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

    

    # Shadow Specific Systems

    SHADOW_WARN                 = true    # Checks for older shadow system

    SHADOW_MIN                  = 0       # Start setting of shadow arc *

    SHADOW_MAX                  = 0       # Ending setting of shadow arc *

    SHADOW_OPACITY              = 150     # Darkness level of shadow

    SHADOW_DISTANCE             = 350     # Maximum range in pixels

 

    # * SHADOW ARC:  Set in degrees,  this controls whether a light source

    #                can 'force' shadows in certain directions.  Useful if

    #                a light source is hanging on a wall so it cannot make

    #                a shadow THROUGH a wall.

    #

    #                It may take some practice  to set  the desired angles

    #                as it recognizes 90°  being the  top most part  of an

    #                arc,  180° being the leftmost side and so on...  pro-

    #                ceeding in a counter-clockwise motion.

    

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :shadow_spriteset         # holds shadow spritesets

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold 

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Shadow

#------------------------------------------------------------------------------

#  This sprite is used to display the character's shadow.  It observes the

#  Game_Character class and automatically changes sprite conditions.

#==============================================================================

class Sprite_Shadow < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id = 0)

    super(viewport)

    params  = $game_temp.shadow_spriteset.shadows[id]

    @source = params[0]

    # Default settings

    @anglemin     = SHADOW_MIN

    @anglemax     = SHADOW_MAX

    @self_opacity = SHADOW_OPACITY

    @distancemax  = SHADOW_DISTANCE

    # Settings changed by parameters

    @anglemin     = params[1]   if params.size > 1

    @anglemax     = params[2]   if params.size > 2

    @distancemax  = params[3]   if params.size > 3

    @self_opacity = params[4]   if params.size > 4

    @character = character

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #-------------------------------------------------------------------------- 

  def update

    # If shadow not in range of light source

    if !in_range?(@character, @source, @distancemax)

      self.opacity = 0

      return

    end

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer

      sx = @character.pattern * @cw

      sy = (@character.direction - 2) / 2 * @ch

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch   if @character.direction == 6

        sy = ( 6 - 2) / 2 * @ch   if @character.direction == 4

        sy = ( 8 - 2) / 2 * @ch   if @character.direction == 2

        sy = ( 2 - 2) / 2 * @ch   if @character.direction == 8

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates    

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch)-1

    # Set blend method and bush depth

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    @deltax       = @source.screen_x - self.x

    @deltay       = @source.screen_y - self.y

    self.color    = Color.new(0, 0, 0)

    @distance     = ((@deltax ** 2) + (@deltay ** 2))

    # Set opacity level based on light source distance

    self.opacity  = @self_opacity * 13000 / 

                      ((@distance * 370 / @distancemax) + 6000)

    self.angle    = 57.3 * Math.atan2(@deltax, @deltay )

    @angle_trigo  = self.angle+90

    if @angle_trigo < 0

        @angle_trigo = 360 + @angle_trigo

     end

    if @anglemin != 0 or @anglemax != 0

       if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and

          @anglemin < @anglemax

         self.opacity = 0

         return

       end

       if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and

          @anglemin > @anglemax

         self.opacity=0

         return

       end     

     end

  end

  #--------------------------------------------------------------------------

  # * In Range?  (From Near's Anti Lag Script, edited)

  #     element     : element

  #     object      : object

  #     range       : range in tiles

  #--------------------------------------------------------------------------   

  def in_range?(element, object, range)

    x = (element.screen_x - object.screen_x) * (element.screen_x - object.screen_x)

    y = (element.screen_y - object.screen_y) * (element.screen_y - object.screen_y)

    r = x + y

    if r <= (range * range)

       return true

    else

      return false

    end

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias shadow_initialize initialize

  alias shadow_update update  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @ombrelist = []

    if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != []

      params = XPML.XPML_read("Shadow", @character.id, 5)

      if params != nil

        for i in 0...$game_temp.shadow_spriteset.shadows.size

          @ombrelist.push(Sprite_Shadow.new(viewport, @character,i))

        end

      end

    end

    if character.is_a?(Game_Player) and $game_temp.shadow_spriteset.shadows != []

      for i in 0...$game_temp.shadow_spriteset.shadows.size

        @ombrelist.push(Sprite_Shadow.new(viewport, $game_player,i))

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================       

    end

    # Perform the original call

    shadow_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    shadow_update

    if @ombrelist != []

      for i in [email=0...@ombrelist.size]0...@ombrelist.size[/email]

        @ombrelist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page 

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :shadows

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias shadow_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------  

  def initialize

    $game_temp.shadow_spriteset = self

    @shadows = []

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and 

            $game_map.events[k].list[0].code == 108 and 

            ($game_map.events[k].list[0].parameters == ["s"] or 

            $game_map.events[k].list[0].parameters == ["o"]))

        warn = true         

      end

      params = XPML.XPML_read("Shadow Source", k, 5)

      if params != nil

        $game_temp.shadow_spriteset.shadows.push([$game_map.events[k]] + params) 

      end

    end

    if warn == true and SHADOW_WARN

      p "Warning : At least one event on this map uses an obsolete way to add shadows" 

    end

    # Perform the original call

    shadow_initialize

  end  

end

 

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and 

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

Code:
#==============================================================================

# ** Sprite Sun

#------------------------------------------------------------------------------

#    Based on Sprite Shadow

#    modified by Rataime

#    New Edits by DerVVulfman

#    February 12, 2008

#------------------------------------------------------------------------------

# 

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map. The player can move around while a programmed 'sun' will

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Sun

#     To create a sun effect, you'll need to create a map event that's to be

#     used 'as' the sun itself.   Under most circumstances,  this will be an

#     event without a characterset graphic. You don't want to 'SEE' the sun,

#     do you?

#

#     To make one of these events a 'sun,  you'll need to insert a couple of

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment  to add is "begin Sun" (without quotes).  It informs

#     the system that this map  has a sun effect in use.   The remaining two

#     values  are optional  and have  default values  in  the  configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     self_angle  'number'  --- How much of an angle each shadow will have.

#     self_opacity 'number' --- How dark the shadow will be.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the sun shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS 

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

    

    # Sun Specific Systems

    SUN_WARN                    = true    # Checks for older sun systems

    SUN_ANGLE                   = 45      # Angle for sun-generated shadow

    SUN_OPACITY                 = 128     # Darkness setting for sun shadow

 

    

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :sun_spriteset            # holds spritesets for 'sun' shadows

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold 

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Sun

#------------------------------------------------------------------------------

#  This sprite is used to position character shadows relative to map position.

#  It observes the Game_Character class and automatically changes sprite 

#  conditions.

#==============================================================================

 

class Sprite_Sun < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character           

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id=0)

    super(viewport)

    @character = character

    params=$game_temp.sun_spriteset.sun[id]

    self_angle    = SUN_ANGLE

    self_opacity  = SUN_OPACITY

    self_angle    = params[0]   if params.size > 0

    self_opacity  = params[1]   if params.size > 1

    @self_angle   = self_angle

    @self_opacity = self_opacity

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid      

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer    

      sx = @character.pattern * @cw

      @direct = @character.direction

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch                   if @direct == 6

        sy = ( 6 - 2) / 2 * @ch                   if @direct == 4

        sy = (@character.direction - 2) / 2 * @ch if @direct != 4 and @direct != 6

      else

        sy = (@character.direction - 2) / 2 * @ch

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates 

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch) - 1

    # Set opacity level, blend method, and bush depth

    self.opacity = @self_opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    self.angle = @self_angle.to_i - 90

    self.color = Color.new(0, 0, 0)

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  alias sun_update update

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @sunlist=[]

    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

      params = XPML.XPML_read("Shadow", @character.id, 2)

      if params != nil

        for i in 0...$game_temp.sun_spriteset.sun.size

          @sunlist.push(Sprite_Sun.new(viewport, @character, i))

        end

      end

    end

    if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []

      for i in 0...$game_temp.sun_spriteset.sun.size

        @sunlist.push(Sprite_Sun.new(viewport, $game_player, i))

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================       

    end

    # Perform the original call

    sun_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    sun_update

    if @sunlist != []

      for i in [email=0...@sunlist.size]0...@sunlist.size[/email]

        @sunlist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page 

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :sun

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------   

  alias sun_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------    

  def initialize

    @sun = []

    $game_temp.sun_spriteset = self

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

          $game_map.events[k].list[0].code == 108 and 

          ($game_map.events[k].list[0].parameters == ["sun"] or

          $game_map.events[k].list[0].parameters == ["o"]))

        warn = true

      end

      params = XPML.XPML_read("Sun", k, 2)

      $game_temp.sun_spriteset.sun.push(params) if params != nil

    end

    if warn == true and SUN_WARN

      p "Warning : At least one event on this map uses an obsolete way to add a sun effect"

    end

    # Perform the original call

    sun_initialize

  end  

end

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and 

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

EDIT: Please let me know if I have left out something that you require. I will be more than happy to post it. Thank you!
 

Star

Sponsor

Code:
#==============================================================================

# ** Sprite Shadow (Sprite_Ombre )

#------------------------------------------------------------------------------

#    Based on Genzai Kawakami's shadows

#    dynamisme & features by Rataime

#    extra features Boushy

#    New Edits by DerVVulfman

#    February 24, 2008

#

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map.   The player can move around  a 'light source' event and

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Light Source

#     To create a light source, you need to create a map event that is to be

#     used 'as' the light source.   Most of the time,  these could be events

#     that sport 'torch' or 'lantern' charactersets.  Just examples :)

#

#     To make one of these events a light source,  you need  to insert a few

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment to add is "begin Shadow Source" (without quotes). It

#     informs the system  that this event is a light source.   The remaining

#     three values are optional and have default values in the configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     anglemin 'number'     --- Starting position of a lightsource's arc.

#     anglemax 'number'     --- Ending position of a lightsource's arc.

#     distancemax 'number'  --- How far away from the 'source' you can go

#     self_opacity 'number' --- How dark the shadow will grow.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#  -- Blocking Shadows

#     To prevent shadows  from passing through  solid objects such as doors,

#     walls, cabinets or other forms of furniture,  you will want to apply a

#     priority flag of '1' or higher on these items.  Normally, walls in the

#     default database do not have a priority flag as they merely block  the

#     player from passing through.

#    

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Shadow Specific Systems

    SHADOW_WARN                 = true    # Checks for older shadow system

    SHADOW_MIN                  = 0       # Start setting of shadow arc *

    SHADOW_MAX                  = 0       # Ending setting of shadow arc *

    SHADOW_OPACITY              = 150     # Darkness level of shadow

    SHADOW_DISTANCE             = 350     # Maximum range in pixels

 

    # * SHADOW ARC:  Set in degrees,  this controls whether a light source

    #                can 'force' shadows in certain directions.  Useful if

    #                a light source is hanging on a wall so it cannot make

    #                a shadow THROUGH a wall.

    #

    #                It may take some practice  to set  the desired angles

    #                as it recognizes 90°  being the  top most part  of an

    #                arc,  180° being the leftmost side and so on...  pro-

    #                ceeding in a counter-clockwise motion.

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :shadow_spriteset         # holds shadow spritesets

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Shadow

#------------------------------------------------------------------------------

#  This sprite is used to display the character's shadow.  It observes the

#  Game_Character class and automatically changes sprite conditions.

#==============================================================================

class Sprite_Shadow < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id = 0)

    super(viewport)

    params  = $game_temp.shadow_spriteset.shadows[id]

    @source = params[0]

    # Default settings

    @anglemin     = SHADOW_MIN

    @anglemax     = SHADOW_MAX

    @self_opacity = SHADOW_OPACITY

    @distancemax  = SHADOW_DISTANCE

    # Settings changed by parameters

    @anglemin     = params[1]   if params.size > 1

    @anglemax     = params[2]   if params.size > 2

    @distancemax  = params[3]   if params.size > 3

    @self_opacity = params[4]   if params.size > 4

    @character = character

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # If shadow not in range of light source

    if !in_range?(@character, @source, @distancemax)

      self.opacity = 0

      return

    end

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer

      sx = @character.pattern * @cw

      sy = (@character.direction - 2) / 2 * @ch

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch   if @character.direction == 6

        sy = ( 6 - 2) / 2 * @ch   if @character.direction == 4

        sy = ( 8 - 2) / 2 * @ch   if @character.direction == 2

        sy = ( 2 - 2) / 2 * @ch   if @character.direction == 8

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates    

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch)-1

    # Set blend method and bush depth

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    @deltax       = @source.screen_x - self.x

    @deltay       = @source.screen_y - self.y

    self.color    = Color.new(0, 0, 0)

    @distance     = ((@deltax ** 2) + (@deltay ** 2))

    # Set opacity level based on light source distance

    self.opacity  = @self_opacity * 13000 /

                      ((@distance * 370 / @distancemax) + 6000)

    self.angle    = 57.3 * Math.atan2(@deltax, @deltay )

    @angle_trigo  = self.angle+90

    if @angle_trigo < 0

        @angle_trigo = 360 + @angle_trigo

     end

    if @anglemin != 0 or @anglemax != 0

       if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and

          @anglemin < @anglemax

         self.opacity = 0

         return

       end

       if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and

          @anglemin > @anglemax

         self.opacity=0

         return

       end    

     end

  end

  #--------------------------------------------------------------------------

  # * In Range?  (From Near's Anti Lag Script, edited)

  #     element     : element

  #     object      : object

  #     range       : range in tiles

  #--------------------------------------------------------------------------  

  def in_range?(element, object, range)

    x = (element.screen_x - object.screen_x) * (element.screen_x - object.screen_x)

    y = (element.screen_y - object.screen_y) * (element.screen_y - object.screen_y)

    r = x + y

    if r <= (range * range)

       return true

    else

      return false

    end

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias shadow_initialize initialize

  alias shadow_update update  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @ombrelist = []

    if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != []

      params = XPML.XPML_read("Shadow", @character.id, 5)

      if params != nil

        for i in 0...$game_temp.shadow_spriteset.shadows.size

          @ombrelist.push(Sprite_Shadow.new(viewport, @character,i))

        end

      end

    end

    if $scene == Scene_Map.new

    if character.is_a?(Game_Player) and $game_temp.shadow_spriteset.shadows != []

      for i in 0...$game_temp.shadow_spriteset.shadows.size

        @ombrelist.push(Sprite_Shadow.new(viewport, $game_player,i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    shadow_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    shadow_update

    if @ombrelist != []

      for i in [email=0...@ombrelist.size]0...@ombrelist.size[/email]

        @ombrelist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :shadows

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias shadow_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------  

  def initialize

    $game_temp.shadow_spriteset = self

    @shadows = []

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

            $game_map.events[k].list[0].code == 108 and

            ($game_map.events[k].list[0].parameters == ["s"] or

            $game_map.events[k].list[0].parameters == ["o"]))

        warn = true        

      end

      params = XPML.XPML_read("Shadow Source", k, 5)

      if params != nil

        $game_temp.shadow_spriteset.shadows.push([$game_map.events[k]] + params)

      end

    end

    if warn == true and SHADOW_WARN

      p "Warning : At least one event on this map uses an obsolete way to add shadows"

    end

    # Perform the original call

    shadow_initialize

  end  

end

 

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

Code:
#==============================================================================

# ** Sprite Sun

#------------------------------------------------------------------------------

#    Based on Sprite Shadow

#    modified by Rataime

#    New Edits by DerVVulfman

#    February 12, 2008

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map. The player can move around while a programmed 'sun' will

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Sun

#     To create a sun effect, you'll need to create a map event that's to be

#     used 'as' the sun itself.   Under most circumstances,  this will be an

#     event without a characterset graphic. You don't want to 'SEE' the sun,

#     do you?

#

#     To make one of these events a 'sun,  you'll need to insert a couple of

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment  to add is "begin Sun" (without quotes).  It informs

#     the system that this map  has a sun effect in use.   The remaining two

#     values  are optional  and have  default values  in  the  configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     self_angle  'number'  --- How much of an angle each shadow will have.

#     self_opacity 'number' --- How dark the shadow will be.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the sun shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Sun Specific Systems

    SUN_WARN                    = true    # Checks for older sun systems

    SUN_ANGLE                   = 45      # Angle for sun-generated shadow

    SUN_OPACITY                 = 128     # Darkness setting for sun shadow

 

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :sun_spriteset            # holds spritesets for 'sun' shadows

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Sun

#------------------------------------------------------------------------------

#  This sprite is used to position character shadows relative to map position.

#  It observes the Game_Character class and automatically changes sprite

#  conditions.

#==============================================================================

 

class Sprite_Sun < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character          

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id=0)

    super(viewport)

    @character = character

    params=$game_temp.sun_spriteset.sun[id]

    self_angle    = SUN_ANGLE

    self_opacity  = SUN_OPACITY

    self_angle    = params[0]   if params.size > 0

    self_opacity  = params[1]   if params.size > 1

    @self_angle   = self_angle

    @self_opacity = self_opacity

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid      

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer    

      sx = @character.pattern * @cw

      @direct = @character.direction

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch                   if @direct == 6

        sy = ( 6 - 2) / 2 * @ch                   if @direct == 4

        sy = (@character.direction - 2) / 2 * @ch if @direct != 4 and @direct != 6

      else

        sy = (@character.direction - 2) / 2 * @ch

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch) - 1

    # Set opacity level, blend method, and bush depth

    self.opacity = @self_opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    self.angle = @self_angle.to_i - 90

    self.color = Color.new(0, 0, 0)

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  alias sun_update update

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @sunlist=[]

    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

      params = XPML.XPML_read("Shadow", @character.id, 2)

      if params != nil

        for i in 0...$game_temp.sun_spriteset.sun.size

          @sunlist.push(Sprite_Sun.new(viewport, @character, i))

        end

      end

    end

    if $scene == Scene_Map.new 

      if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []

      for i in 0...$game_temp.sun_spriteset.sun.size

        @sunlist.push(Sprite_Sun.new(viewport, $game_player, i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    sun_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    sun_update

    if @sunlist != []

      for i in [email=0...@sunlist.size]0...@sunlist.size[/email]

        @sunlist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :sun

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------    

  def initialize

    @sun = []

    $game_temp.sun_spriteset = self

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

          $game_map.events[k].list[0].code == 108 and

          ($game_map.events[k].list[0].parameters == ["sun"] or

          $game_map.events[k].list[0].parameters == ["o"]))

        warn = true

      end

      params = XPML.XPML_read("Sun", k, 2)

      $game_temp.sun_spriteset.sun.push(params) if params != nil

    end

    if warn == true and SUN_WARN

      p "Warning : At least one event on this map uses an obsolete way to add a sun effect"

    end

    # Perform the original call

    sun_initialize

  end  

end

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

I just added if $scene == Scene_Map.new
if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []
for i in 0...$game_temp.sun_spriteset.sun.size
@sunlist.push(Sprite_Sun.new(viewport, $game_player, i))
end
end

same thing with the shadow. it was conflicting with Game Temp or something. I actually didn't see a sun, but I got no more conflicts after that, Does this work for you?
 
Unfortunately, same error as before, only this time the line number is different. Here are the two scripts as I have them, after your modification:

Code:
#==============================================================================

# ** Sprite Shadow (Sprite_Ombre )

#------------------------------------------------------------------------------

#    Based on Genzai Kawakami's shadows

#    dynamisme & features by Rataime

#    extra features Boushy

#    New Edits by DerVVulfman

#    February 24, 2008

#

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map.   The player can move around  a 'light source' event and

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Light Source

#     To create a light source, you need to create a map event that is to be

#     used 'as' the light source.   Most of the time,  these could be events

#     that sport 'torch' or 'lantern' charactersets.  Just examples :)

#

#     To make one of these events a light source,  you need  to insert a few

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment to add is "begin Shadow Source" (without quotes). It

#     informs the system  that this event is a light source.   The remaining

#     three values are optional and have default values in the configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     anglemin 'number'     --- Starting position of a lightsource's arc.

#     anglemax 'number'     --- Ending position of a lightsource's arc.

#     distancemax 'number'  --- How far away from the 'source' you can go

#     self_opacity 'number' --- How dark the shadow will grow.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#  -- Blocking Shadows

#     To prevent shadows  from passing through  solid objects such as doors,

#     walls, cabinets or other forms of furniture,  you will want to apply a

#     priority flag of '1' or higher on these items.  Normally, walls in the

#     default database do not have a priority flag as they merely block  the

#     player from passing through.

#    

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Shadow Specific Systems

    SHADOW_WARN                 = true    # Checks for older shadow system

    SHADOW_MIN                  = 0       # Start setting of shadow arc *

    SHADOW_MAX                  = 0       # Ending setting of shadow arc *

    SHADOW_OPACITY              = 150     # Darkness level of shadow

    SHADOW_DISTANCE             = 350     # Maximum range in pixels

 

    # * SHADOW ARC:  Set in degrees,  this controls whether a light source

    #                can 'force' shadows in certain directions.  Useful if

    #                a light source is hanging on a wall so it cannot make

    #                a shadow THROUGH a wall.

    #

    #                It may take some practice  to set  the desired angles

    #                as it recognizes 90°  being the  top most part  of an

    #                arc,  180° being the leftmost side and so on...  pro-

    #                ceeding in a counter-clockwise motion.

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :shadow_spriteset         # holds shadow spritesets

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Shadow

#------------------------------------------------------------------------------

#  This sprite is used to display the character's shadow.  It observes the

#  Game_Character class and automatically changes sprite conditions.

#==============================================================================

class Sprite_Shadow < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id = 0)

    super(viewport)

    params  = $game_temp.shadow_spriteset.shadows[id]

    @source = params[0]

    # Default settings

    @anglemin     = SHADOW_MIN

    @anglemax     = SHADOW_MAX

    @self_opacity = SHADOW_OPACITY

    @distancemax  = SHADOW_DISTANCE

    # Settings changed by parameters

    @anglemin     = params[1]   if params.size > 1

    @anglemax     = params[2]   if params.size > 2

    @distancemax  = params[3]   if params.size > 3

    @self_opacity = params[4]   if params.size > 4

    @character = character

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # If shadow not in range of light source

    if !in_range?(@character, @source, @distancemax)

      self.opacity = 0

      return

    end

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer

      sx = @character.pattern * @cw

      sy = (@character.direction - 2) / 2 * @ch

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch   if @character.direction == 6

        sy = ( 6 - 2) / 2 * @ch   if @character.direction == 4

        sy = ( 8 - 2) / 2 * @ch   if @character.direction == 2

        sy = ( 2 - 2) / 2 * @ch   if @character.direction == 8

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates    

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch)-1

    # Set blend method and bush depth

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    @deltax       = @source.screen_x - self.x

    @deltay       = @source.screen_y - self.y

    self.color    = Color.new(0, 0, 0)

    @distance     = ((@deltax ** 2) + (@deltay ** 2))

    # Set opacity level based on light source distance

    self.opacity  = @self_opacity * 13000 /

                      ((@distance * 370 / @distancemax) + 6000)

    self.angle    = 57.3 * Math.atan2(@deltax, @deltay )

    @angle_trigo  = self.angle+90

    if @angle_trigo < 0

        @angle_trigo = 360 + @angle_trigo

     end

    if @anglemin != 0 or @anglemax != 0

       if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and

          @anglemin < @anglemax

         self.opacity = 0

         return

       end

       if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and

          @anglemin > @anglemax

         self.opacity=0

         return

       end    

     end

  end

  #--------------------------------------------------------------------------

  # * In Range?  (From Near's Anti Lag Script, edited)

  #     element     : element

  #     object      : object

  #     range       : range in tiles

  #--------------------------------------------------------------------------  

  def in_range?(element, object, range)

    x = (element.screen_x - object.screen_x) * (element.screen_x - object.screen_x)

    y = (element.screen_y - object.screen_y) * (element.screen_y - object.screen_y)

    r = x + y

    if r <= (range * range)

       return true

    else

      return false

    end

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias shadow_initialize initialize

  alias shadow_update update  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @ombrelist = []

    if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != []

      params = XPML.XPML_read("Shadow", @character.id, 5)

      if params != nil

        for i in 0...$game_temp.shadow_spriteset.shadows.size

          @ombrelist.push(Sprite_Shadow.new(viewport, @character,i))

        end

      end

    end

    if $scene == Scene_Map.new

    if character.is_a?(Game_Player) and $game_temp.shadow_spriteset.shadows != []

      for i in 0...$game_temp.shadow_spriteset.shadows.size

        @ombrelist.push(Sprite_Shadow.new(viewport, $game_player,i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    shadow_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    shadow_update

    if @ombrelist != []

      for i in [email=0...@ombrelist.size]0...@ombrelist.size[/email]

        @ombrelist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :shadows

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias shadow_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------  

  def initialize

    $game_temp.shadow_spriteset = self

    @shadows = []

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

            $game_map.events[k].list[0].code == 108 and

            ($game_map.events[k].list[0].parameters == ["s"] or

            $game_map.events[k].list[0].parameters == ["o"]))

        warn = true        

      end

      params = XPML.XPML_read("Shadow Source", k, 5)

      if params != nil

        $game_temp.shadow_spriteset.shadows.push([$game_map.events[k]] + params)

      end

    end

    if warn == true and SHADOW_WARN

      p "Warning : At least one event on this map uses an obsolete way to add shadows"

    end

    # Perform the original call

    shadow_initialize

  end  

end

 

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

Code:
#==============================================================================

# ** Sprite Sun

#------------------------------------------------------------------------------

#    Based on Sprite Shadow

#    modified by Rataime

#    New Edits by DerVVulfman

#    February 12, 2008

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map. The player can move around while a programmed 'sun' will

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Sun

#     To create a sun effect, you'll need to create a map event that's to be

#     used 'as' the sun itself.   Under most circumstances,  this will be an

#     event without a characterset graphic. You don't want to 'SEE' the sun,

#     do you?

#

#     To make one of these events a 'sun,  you'll need to insert a couple of

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment  to add is "begin Sun" (without quotes).  It informs

#     the system that this map  has a sun effect in use.   The remaining two

#     values  are optional  and have  default values  in  the  configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     self_angle  'number'  --- How much of an angle each shadow will have.

#     self_opacity 'number' --- How dark the shadow will be.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the sun shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Sun Specific Systems

    SUN_WARN                    = true    # Checks for older sun systems

    SUN_ANGLE                   = 45      # Angle for sun-generated shadow

    SUN_OPACITY                 = 128     # Darkness setting for sun shadow

 

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :sun_spriteset            # holds spritesets for 'sun' shadows

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Sun

#------------------------------------------------------------------------------

#  This sprite is used to position character shadows relative to map position.

#  It observes the Game_Character class and automatically changes sprite

#  conditions.

#==============================================================================

 

class Sprite_Sun < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character          

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id=0)

    super(viewport)

    @character = character

    params=$game_temp.sun_spriteset.sun[id]

    self_angle    = SUN_ANGLE

    self_opacity  = SUN_OPACITY

    self_angle    = params[0]   if params.size > 0

    self_opacity  = params[1]   if params.size > 1

    @self_angle   = self_angle

    @self_opacity = self_opacity

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid      

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer    

      sx = @character.pattern * @cw

      @direct = @character.direction

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch                   if @direct == 6

        sy = ( 6 - 2) / 2 * @ch                   if @direct == 4

        sy = (@character.direction - 2) / 2 * @ch if @direct != 4 and @direct != 6

      else

        sy = (@character.direction - 2) / 2 * @ch

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch) - 1

    # Set opacity level, blend method, and bush depth

    self.opacity = @self_opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    self.angle = @self_angle.to_i - 90

    self.color = Color.new(0, 0, 0)

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  alias sun_update update

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @sunlist=[]

    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

      params = XPML.XPML_read("Shadow", @character.id, 2)

      if params != nil

        for i in 0...$game_temp.sun_spriteset.sun.size

          @sunlist.push(Sprite_Sun.new(viewport, @character, i))

        end

      end

    end

    if $scene == Scene_Map.new

      if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []

      for i in 0...$game_temp.sun_spriteset.sun.size

        @sunlist.push(Sprite_Sun.new(viewport, $game_player, i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    sun_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    sun_update

    if @sunlist != []

      for i in [email=0...@sunlist.size]0...@sunlist.size[/email]

        @sunlist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :sun

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------    

  def initialize

    @sun = []

    $game_temp.sun_spriteset = self

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

          $game_map.events[k].list[0].code == 108 and

          ($game_map.events[k].list[0].parameters == ["sun"] or

          $game_map.events[k].list[0].parameters == ["o"]))

        warn = true

      end

      params = XPML.XPML_read("Sun", k, 2)

      $game_temp.sun_spriteset.sun.push(params) if params != nil

    end

    if warn == true and SUN_WARN

      p "Warning : At least one event on this map uses an obsolete way to add a sun effect"

    end

    # Perform the original call

    sun_initialize

  end  

end

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

These are the two lines that keep glitching. First from Sprite Sun:

Code:
238.    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

And then from Sprite Shadow:

Code:
304.    if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != []

Those two lines seem to be what is messing everything up. I agree that somehow the save menu is conflicting with the game_temp, but I can't figure out how. Also, I have noticed that if I go to the save menu to save, the save menu's 'map' shows up just fine. So I'm totally lost as to what to do.
 

Star

Sponsor

Code:
#==============================================================================

# ** Sprite Sun

#------------------------------------------------------------------------------

#    Based on Sprite Shadow

#    modified by Rataime

#    New Edits by DerVVulfman

#    February 12, 2008

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map. The player can move around while a programmed 'sun' will

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Sun

#     To create a sun effect, you'll need to create a map event that's to be

#     used 'as' the sun itself.   Under most circumstances,  this will be an

#     event without a characterset graphic. You don't want to 'SEE' the sun,

#     do you?

#

#     To make one of these events a 'sun,  you'll need to insert a couple of

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment  to add is "begin Sun" (without quotes).  It informs

#     the system that this map  has a sun effect in use.   The remaining two

#     values  are optional  and have  default values  in  the  configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     self_angle  'number'  --- How much of an angle each shadow will have.

#     self_opacity 'number' --- How dark the shadow will be.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the sun shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Sun Specific Systems

    SUN_WARN                    = true    # Checks for older sun systems

    SUN_ANGLE                   = 45      # Angle for sun-generated shadow

    SUN_OPACITY                 = 128     # Darkness setting for sun shadow

 

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :sun_spriteset            # holds spritesets for 'sun' shadows

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Sun

#------------------------------------------------------------------------------

#  This sprite is used to position character shadows relative to map position.

#  It observes the Game_Character class and automatically changes sprite

#  conditions.

#==============================================================================

 

class Sprite_Sun < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character          

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id=0)

    super(viewport)

    @character = character

    params=$game_temp.sun_spriteset.sun[id]

    self_angle    = SUN_ANGLE

    self_opacity  = SUN_OPACITY

    self_angle    = params[0]   if params.size > 0

    self_opacity  = params[1]   if params.size > 1

    @self_angle   = self_angle

    @self_opacity = self_opacity

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid      

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer    

      sx = @character.pattern * @cw

      @direct = @character.direction

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch                   if @direct == 6

        sy = ( 6 - 2) / 2 * @ch                   if @direct == 4

        sy = (@character.direction - 2) / 2 * @ch if @direct != 4 and @direct != 6

      else

        sy = (@character.direction - 2) / 2 * @ch

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch) - 1

    # Set opacity level, blend method, and bush depth

    self.opacity = @self_opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    self.angle = @self_angle.to_i - 90

    self.color = Color.new(0, 0, 0)

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  alias sun_update update

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @sunlist=[]

 if $scene = Scene_Map.new

    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

      params = XPML.XPML_read("Shadow", @character.id, 2)

      if params != nil

        for i in 0...$game_temp.sun_spriteset.sun.size

          @sunlist.push(Sprite_Sun.new(viewport, @character, i))

        end

      end

    end

end

    if $scene == Scene_Map.new

      if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []

      for i in 0...$game_temp.sun_spriteset.sun.size

        @sunlist.push(Sprite_Sun.new(viewport, $game_player, i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.sun_spriteset.sun.size

            @sunlist.push(Sprite_Sun.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    sun_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------  

  def update

    sun_update

    if @sunlist != []

      for i in [email=0...@sunlist.size]0...@sunlist.size[/email]

        @sunlist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :sun

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias sun_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------    

  def initialize

    @sun = []

    $game_temp.sun_spriteset = self

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

          $game_map.events[k].list[0].code == 108 and

          ($game_map.events[k].list[0].parameters == ["sun"] or

          $game_map.events[k].list[0].parameters == ["o"]))

        warn = true

      end

      params = XPML.XPML_read("Sun", k, 2)

      $game_temp.sun_spriteset.sun.push(params) if params != nil

    end

    if warn == true and SUN_WARN

      p "Warning : At least one event on this map uses an obsolete way to add a sun effect"

    end

    # Perform the original call

    sun_initialize

  end  

end

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

Code:
#==============================================================================

# ** Sprite Shadow (Sprite_Ombre )

#------------------------------------------------------------------------------

#    Based on Genzai Kawakami's shadows

#    dynamisme & features by Rataime

#    extra features Boushy

#    New Edits by DerVVulfman

#    February 24, 2008

#

#------------------------------------------------------------------------------

#

# Introduction:

#

#  This system allows you and all 'prepared' events to generate shadows while

#  on the field map.   The player can move around  a 'light source' event and

#  display a shadow.   Likewise,  events with a special comment  within their

#  event list can also generate shadows.

#

#------------------------------------------------------------------------------

#

# Instructions:

#

#  -- The Light Source

#     To create a light source, you need to create a map event that is to be

#     used 'as' the light source.   Most of the time,  these could be events

#     that sport 'torch' or 'lantern' charactersets.  Just examples :)

#

#     To make one of these events a light source,  you need  to insert a few

#     things into that event's  "List of Event Commands".   These things are

#     nothing more than comments.  

#

#     The first comment to add is "begin Shadow Source" (without quotes). It

#     informs the system  that this event is a light source.   The remaining

#     three values are optional and have default values in the configuration

#     section  (only just added  into the script).   They too  are added  as

#     comments.

#

#     anglemin 'number'     --- Starting position of a lightsource's arc.

#     anglemax 'number'     --- Ending position of a lightsource's arc.

#     distancemax 'number'  --- How far away from the 'source' you can go

#     self_opacity 'number' --- How dark the shadow will grow.

#

#     After that, your characters can now move about and generate shadows.

#

#  -- Other Events

#     Events do not know that they can generate shadows.   To let them gene-

#     rate a shadow,  all you need to do is add a special comment into their

#     "List of Event Commands".   This comment needed  is merely  the phrase

#     'begin Shadow' (again, without quotes).

#

#

#  -- Blocking Shadows

#     To prevent shadows  from passing through  solid objects such as doors,

#     walls, cabinets or other forms of furniture,  you will want to apply a

#     priority flag of '1' or higher on these items.  Normally, walls in the

#     default database do not have a priority flag as they merely block  the

#     player from passing through.

#    

#

#------------------------------------------------------------------------------

#

# Revisions to note:

#

#  1) Added formatted headers and comments throughout the script.

#  2) Encapsulated a comment/parameter code in an XPML module.

#  3) Set the shadow array into an instance value to lower resource costs.

#  4) Compatability with Near Fantastica's Squad Movement systems.

#  5) Compatability with Ccoa's Caterpillar system.

#  6) Compatability with Trickster's Caterpillar system.

#  7) Added default shadow settings into the configuration section.

#

#==============================================================================

 

 

 

   #========================================================================

   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #

   #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original  

    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar

   

    # Shadow Specific Systems

    SHADOW_WARN                 = true    # Checks for older shadow system

    SHADOW_MIN                  = 0       # Start setting of shadow arc *

    SHADOW_MAX                  = 0       # Ending setting of shadow arc *

    SHADOW_OPACITY              = 150     # Darkness level of shadow

    SHADOW_DISTANCE             = 350     # Maximum range in pixels

 

    # * SHADOW ARC:  Set in degrees,  this controls whether a light source

    #                can 'force' shadows in certain directions.  Useful if

    #                a light source is hanging on a wall so it cannot make

    #                a shadow THROUGH a wall.

    #

    #                It may take some practice  to set  the desired angles

    #                as it recognizes 90°  being the  top most part  of an

    #                arc,  180° being the leftmost side and so on...  pro-

    #                ceeding in a counter-clockwise motion.

   

   #========================================================================

   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #

   #========================================================================

   

   

 

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  This class handles temporary data that is not included with save data.

#  Refer to "$game_temp" for the instance of this class.

#==============================================================================

 

class Game_Temp

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :shadow_spriteset         # holds shadow spritesets

end

 

 

 

#==============================================================================

# ** Game_Party

#------------------------------------------------------------------------------

#  This class handles the party. It includes information on amount of gold

#  and items. Refer to "$game_party" for the instance of this class.

#==============================================================================

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader :characters

end

 

 

 

#==============================================================================

# ** Sprite_Shadow

#------------------------------------------------------------------------------

#  This sprite is used to display the character's shadow.  It observes the

#  Game_Character class and automatically changes sprite conditions.

#==============================================================================

class Sprite_Shadow < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :character

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #     id        : id

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil, id = 0)

    super(viewport)

    params  = $game_temp.shadow_spriteset.shadows[id]

    @source = params[0]

    # Default settings

    @anglemin     = SHADOW_MIN

    @anglemax     = SHADOW_MAX

    @self_opacity = SHADOW_OPACITY

    @distancemax  = SHADOW_DISTANCE

    # Settings changed by parameters

    @anglemin     = params[1]   if params.size > 1

    @anglemax     = params[2]   if params.size > 2

    @distancemax  = params[3]   if params.size > 3

    @self_opacity = params[4]   if params.size > 4

    @character = character

    update

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # If shadow not in range of light source

    if !in_range?(@character, @source, @distancemax)

      self.opacity = 0

      return

    end

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

       @character_name != @character.character_name or

       @character_hue != @character.character_hue

      # Remember tile ID, file name, and hue

      @tile_id = @character.tile_id

      @character_name = @character.character_name

      @character_hue = @character.character_hue

      # If tile ID value is valid

      if @tile_id >= 384

        self.bitmap = RPG::Cache.tile($game_map.tileset_name,

          @tile_id, @character.character_hue)

        self.src_rect.set(0, 0, 32, 32)

        self.ox = 16

        self.oy = 32

      # If tile ID value is invalid        

      else

        self.bitmap = RPG::Cache.character(@character.character_name,

          @character.character_hue)

        @cw = bitmap.width / 4

        @ch = bitmap.height / 4

        self.ox = @cw / 2

        self.oy = @ch

      end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

      # Set rectangular transfer

      sx = @character.pattern * @cw

      sy = (@character.direction - 2) / 2 * @ch

      if self.angle > 90 or angle < -90

        sy = ( 4 - 2) / 2 * @ch   if @character.direction == 6

        sy = ( 6 - 2) / 2 * @ch   if @character.direction == 4

        sy = ( 8 - 2) / 2 * @ch   if @character.direction == 2

        sy = ( 2 - 2) / 2 * @ch   if @character.direction == 8

      end

      self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates    

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch)-1

    # Set blend method and bush depth

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

      animation = $data_animations[@character.animation_id]

      animation(animation, true)

      @character.animation_id = 0

    end

    @deltax       = @source.screen_x - self.x

    @deltay       = @source.screen_y - self.y

    self.color    = Color.new(0, 0, 0)

    @distance     = ((@deltax ** 2) + (@deltay ** 2))

    # Set opacity level based on light source distance

    self.opacity  = @self_opacity * 13000 /

                      ((@distance * 370 / @distancemax) + 6000)

    self.angle    = 57.3 * Math.atan2(@deltax, @deltay )

    @angle_trigo  = self.angle+90

    if @angle_trigo < 0

        @angle_trigo = 360 + @angle_trigo

     end

    if @anglemin != 0 or @anglemax != 0

       if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and

          @anglemin < @anglemax

         self.opacity = 0

         return

       end

       if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and

          @anglemin > @anglemax

         self.opacity=0

         return

       end    

     end

  end

  #--------------------------------------------------------------------------

  # * In Range?  (From Near's Anti Lag Script, edited)

  #     element     : element

  #     object      : object

  #     range       : range in tiles

  #--------------------------------------------------------------------------  

  def in_range?(element, object, range)

    x = (element.screen_x - object.screen_x) * (element.screen_x - object.screen_x)

    y = (element.screen_y - object.screen_y) * (element.screen_y - object.screen_y)

    r = x + y

    if r <= (range * range)

       return true

    else

      return false

    end

  end

end

 

 

 

#==============================================================================

# ** Sprite_Character

#------------------------------------------------------------------------------

#  This sprite is used to display the character.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Character < RPG::Sprite

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias shadow_initialize initialize

  alias shadow_update update  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     viewport  : viewport

  #     character : character (Game_Character)

  #--------------------------------------------------------------------------

  def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @ombrelist = []

if $scene = Scene_Map.new

    if character.is_a?(Game_Event) and $game_temp.shadow_spriteset.shadows != []

      params = XPML.XPML_read("Shadow", @character.id, 5)

      if params != nil

        for i in 0...$game_temp.shadow_spriteset.shadows.size

          @ombrelist.push(Sprite_Shadow.new(viewport, @character,i))

        end

      end

    end

end

    if $scene == Scene_Map.new

    if character.is_a?(Game_Player) and $game_temp.shadow_spriteset.shadows != []

      for i in 0...$game_temp.shadow_spriteset.shadows.size

        @ombrelist.push(Sprite_Shadow.new(viewport, $game_player,i))

      end

      end

      #===================================================

      # * Compatibility with Caterpillar Functions

      #===================================================

      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

        for member in $game_party.characters

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

        for member in $game_allies.values

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

        for member in $game_train.actors

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

        for member in $game_party.followers

          for i in 0...$game_temp.shadow_spriteset.shadows.size

            @ombrelist.push(Sprite_Shadow.new(viewport, member, i))

          end

        end

      end

      #===================================================

      # ** End of the compatibility

      #===================================================      

    end

    # Perform the original call

    shadow_initialize(viewport, @character)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    shadow_update

    if @ombrelist != []

      for i in [email=0...@ombrelist.size]0...@ombrelist.size[/email]

        @ombrelist[i].update

      end

    end

  end  

end

 

 

 

#==============================================================================

# ** Game_Event

#------------------------------------------------------------------------------

#  This class deals with events. It handles functions including event page

#  switching via condition determinants, and running parallel process events.

#  It's used within the Game_Map class.

#==============================================================================

 

class Game_Event < Game_Character

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor :id

end

 

 

 

#==============================================================================

# ** Spriteset_Map

#------------------------------------------------------------------------------

#  This class brings together map screen sprites, tilemaps, etc.

#  It's used within the Scene_Map class.

#==============================================================================

 

class Spriteset_Map

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------  

  attr_accessor :shadows

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------  

  alias shadow_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------  

  def initialize

    $game_temp.shadow_spriteset = self

    @shadows = []

    warn = false

    for k in $game_map.events.keys.sort

      if ($game_map.events[k].list != nil and

            $game_map.events[k].list[0].code == 108 and

            ($game_map.events[k].list[0].parameters == ["s"] or

            $game_map.events[k].list[0].parameters == ["o"]))

        warn = true        

      end

      params = XPML.XPML_read("Shadow Source", k, 5)

      if params != nil

        $game_temp.shadow_spriteset.shadows.push([$game_map.events[k]] + params)

      end

    end

    if warn == true and SHADOW_WARN

      p "Warning : At least one event on this map uses an obsolete way to add shadows"

    end

    # Perform the original call

    shadow_initialize

  end  

end

 

 

 

#==============================================================================

# ** module XPML

#------------------------------------------------------------------------------

#  This module handles the reading and passing of 'comment' parameters

#

#  The main XPML method is used to check and read event comments.

#  * It returns 'nil' if the markup 'check' text isn't even present.

#  * It returns [] if no parameters are passed

#  * It returns a parameter list with "int" converted as int.

#       eg :

#       begin first

#       begin second

#       param1 1

#       param2 two

#       begin third

#       anything 3

#

#   p XPML_read("first", event_id) -> []

#   p XPML_read("second", event_id) -> [1,"two"]

#   p XPML_read("third", event_id) -> [3]

#   p XPML_read("forth", event_id) -> nil

#===================================================

 

module XPML

  module_function

  #--------------------------------------------------------------------------

  # * XPML_read

  #     markup           : text in event comment to check

  #     event_id         : event ID

  #     max_param_number : maximum number of parameter/comments to load

  #--------------------------------------------------------------------------  

  def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

      for i in 0...event.list.size

        if event.list[i].code == 108 and

          event.list[i].parameters[0].downcase == "begin " + markup.downcase

          parameter_list = [] if parameter_list == nil

          for j in i + 1...event.list.size

            if event.list[j].code == 108

              parts = event.list[j].parameters[0].split

              if parts.size != 1 and parts[0].downcase != "begin"

                if parts[1].to_i != 0 or parts[1] == "0"

                  parameter_list.push(parts[1].to_i)

                else

                  parameter_list.push(parts[1])

                end

              else

                return parameter_list

              end

            else

              return parameter_list

            end

            if max_param_number != 0 and j == i + max_param_number

              return parameter_list

            end

          end

        end

      end

    return parameter_list

  end

end

How about now?
 
I'd think the most straightforward solution would be to move :shadow_spriteset to something other than Game_Temp, like Game_System. That would deal with it not existing on load, and would even allow saving whatever data it stores.
 

Star

Sponsor

BwdYeti":3pxl5bth said:
I'd think the most straightforward solution would be to move :shadow_spriteset to something other than Game_Temp, like Game_System. That would deal with it not existing on load, and would even allow saving whatever data it stores.
Right, but also it not being accessed during Scene's that are the map was just the easiest solution for me at the time. Both ways work. One just seemed easier than the other
 
@Star
The latest fix you offered does not fix the problem. In fact, it makes it so that I cannot start a New Game (somehow, it now clashes with my Particle System). When I go to continue, however, it gives me the same errors as before.

@BwdYeti
I do know exactly HOW to do this, but to try it, I went and changed all instances of Game_Temp and $game_temp to Game_System and $game_system. It still failed on Continue with the same error, and gave another error entirely when attempting to start a New Game.

@To Both
I apologize for the delay in replying, but I've had out of town company. I am thankful for both of you attempting to help me.
 
Hey guys. I've had time to think about it and I'm going to scrap using the full version of this script. Instead, I'm going to try and modify it to show, in lieu of the 'screenshot', an image of the 'world' that the characters are on.

I'll open a new topic in a few days if I'm stuck on this.

Thanks for all ya'lls help!
 
Im not very good at RGSS, but I had the exact same problem, as I use the same scripts. It may be a simple case of order... try rearranging the scripts, reversing their position, etc. If that doesn't work, I think you should post a demo so we can see how the scripts are truly interacting with one another, and could know whether our corrections will work.
 
Norton":3iwyueqf said:
Im not very good at RGSS, but I had the exact same problem, as I use the same scripts. It may be a simple case of order... try rearranging the scripts, reversing their position, etc. If that doesn't work, I think you should post a demo so we can see how the scripts are truly interacting with one another, and could know whether our corrections will work.

Well, after a few hours of tinkering, I've gone ahead and replaced the screenshot with a png of what world the player is on. I figure it out, and thankfully it was relatively simple.

Since I'm not going the original route, this post can be closed.

Thanks to Star and BwdYeti for their support!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top