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.

Seph's Test Bed V.4

Status
Not open for further replies.
I got a proplem. I try to use your Party Switcher script, but there becames this message:
Script 'Party Switcher' line 1277: TypeError Occurred
undefined superclass `Scene_base'

What i should do?
 
Ok, Seph will not be able to be here for some time in his absence I will be trying my best to answer your questions

Isopaha that means you don't have the Scene_Base class you can either get it when adding only SDK Part I (See SDK topic) or I believe he has it as a separate script in his test bed,

please read all instructions for a script before posting here (assuming that the Scene_Base requirement was in the instructions)
 
Trickster;190743 said:
Ok, Seph will not be able to be here for some time in his absence I will be trying my best to answer your questions

Isopaha that means you don't have the Scene_Base class you can either get it when adding only SDK Part I (See SDK topic) or I believe he has it as a separate script in his test bed,

please read all instructions for a script before posting here (assuming that the Scene_Base requirement was in the instructions)

That Scene_Base was not in test bed. I have tried a lot.
 
Yes it is

here is SDK Part I (note: SDK Part I does not mess with any of your scripts, It just Defines the SDK methods SDK.enabled? and adds the Scene_Base class and also a few other things like common fixes to methods such as the window disposed error and the script command hanging bug)
Code:
#==============================================================================
# ** RMXP Standard Development Kit (SDK) - Part I
#------------------------------------------------------------------------------
# Build Date  - 2005-11-22
# Version 1.0 - Near Fantastica                - 2005-11-22
# Version 1.1 - SephirothSpawn                 - 2005-12-18 - (Near Fantastica)
# Version 1.2 - Near Fantastica                - 2005-12-18 - (Wachunga)
# Version 1.3 - Wachunga                       - 2005-12-19 - (Near Fantastica)
# Version 1.4 - Prexus                         - 2006-03-02 - (SephirothSpawn)
# Version 1.5 - Jimme Reashu                   - 2006-03-25 - (Near Fantastica)
# Version 2.0 - SephirothSpawn / Trickster /
#               Der Drake / Sandgolem          - 2007-02-22 - (SDK Team)
# Version 2.1 - tibuda /alexanderpas / Mr. Mo  - 2007-02-25 - (SephirothSpawn)
# Version 2.2 - SephirothSpawn / Trickster / 
#               tibuda                         - 2007-04-04 - (SDK Team)
#==============================================================================

#==============================================================================
# ** SDK
#==============================================================================

module SDK
  #--------------------------------------------------------------------------
  # * Version & Parts Log
  #--------------------------------------------------------------------------
  Version = 2.2
  Parts   = [1]
  #--------------------------------------------------------------------------
  # * Show Disable Messages
  #--------------------------------------------------------------------------
  Show_Error_Disable_Message  = true
  Show_Method_Overwrite_Error = true
  #--------------------------------------------------------------------------
  # * Script, Alias, Overwrite & Method Branch Log Logging
  #
  #   List       : 'script' => [scripter, version, date]
  #   Enabled    : 'script' => boolean
  #   Aliases    : 'script' => [ [class, old, new], ... ]
  #   Overwrites : 'script' => [ [class, method], ... ]
  #   Branches   : [class, method] => [ method, ... ]
  #--------------------------------------------------------------------------
  @list               = {}
  @enabled            = {}
  @aliases            = {}
  @overwrites         = {}
  @method_branch_log  = {}
  @enabled.default    = false
  @aliases.default    = []
  @overwrites.default = []
  @last_script        = 'SDK'
  #--------------------------------------------------------------------------
  # * Logs a custom script
  #--------------------------------------------------------------------------
  def self.log(script, name, ver, date)
    # Logs Script
    @list[script]    = [name, ver, date]
    # Enables Script
    @enabled[script] = true
    # Sets Last Script
    @last_script     = script
  end
  #--------------------------------------------------------------------------
  # * Logs an alias
  #--------------------------------------------------------------------------
  def self.log_alias(classname, oldmethodname, newmethodname)
    # Gets Value
    value = [classname, oldmethodname, newmethodname]
    # Convert Values to Symbols
    value.collect! { |x| (x.is_a?(Symbol) ? x : x.to_s.to_sym) }
    # Creates Array
    @aliases[@last_script] = [] unless @aliases.has_key?(@last_script)
    # Stop if Method Logged
    return if @aliases[@last_script].include?(value)
    # Logs Alias
    @aliases[@last_script] << value
    # Check for overwrites
    self.check_for_overwrites(value) if Show_Method_Overwrite_Error
  end
  #--------------------------------------------------------------------------
  # * Logs an overwrite
  #--------------------------------------------------------------------------
  def self.log_overwrite(classname, methodname)
    # Gets Value
    value = [classname, methodname]
    # Convert Values to Symbols
    value.collect! { |x| (x.is_a?(Symbol) ? x : x.to_s.to_sym)}
    # Creates Array
    @overwrites[@last_script] = [] unless @overwrites.has_key?(@last_script)
    # Stop if Overwrite Logged
    return if @overwrites[@last_script].include?(value)
    # Log Overwrite
    @overwrites[@last_script] << value
    # Check for aliases
    self.check_for_aliases(value) if Show_Method_Overwrite_Error
  end
  #--------------------------------------------------------------------------
  # * Logs an method branch
  #--------------------------------------------------------------------------
  def self.log_branch(classname, methodname, *sub_methods)
    # Creates Key
    key = [classname, methodname]
    # Convert Values to Symbols
    key.collect! { |x| (x.is_a?(Symbol) ? x : x.to_s.to_sym)}
    # Creates Sub Method List (if none yet recorded)
    @method_branch_log[key] = [] unless @method_branch_log.has_key?(key)
    # Adds New Sub Methods
    @method_branch_log[key] << sub_methods
    # Organize Sub Method List
    @method_branch_log[key].flatten!
    @method_branch_log[key].uniq!
  end
  #--------------------------------------------------------------------------
  # * Check Requirements
  #--------------------------------------------------------------------------
  def self.check_requirements(version = 2.2, parts = [1], scripts = [])
    # Start Missing Requirements
    missing_reqs = {}
    # Checks Version
    unless Version >= version
      missing_reqs[0] = version
    end    
    # Checks Required Part
    for part in parts
      unless Parts.include?(part)
        missing_reqs[1] = parts
        break
      end
    end
    # Checks Required Scripts
    if scripts.is_a?(Array)
      for script in scripts
        unless self.enabled?(script)
          missing_reqs[2] = [] unless missing_reqs.has_key?(2)
          missing_reqs[2] << script
        end
      end
    elsif scripts.is_a?(Hash)
      scripts.each do |script, v|
        if self.enabled?(script) == false
          missing_reqs[2] = [] unless missing_reqs.has_key?(2)
          missing_reqs[2] << script
          next
        else
          if @list[script][1] < v
            missing_reqs[3] = {} unless missing_reqs.has_key?(3)
            missing_reqs[3][script] = v
          end
        end
      end
    end
    # If Script Needing Disabled
    unless missing_reqs.size == 0
      # Disable Script
      self.disable(@last_script)
      # If Show Auto Disable Script Message
      if Show_Error_Disable_Message
        # Show Error Message
        self.auto_disable_script_message(@last_script, missing_reqs)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Enabled Test
  #--------------------------------------------------------------------------
  def self.enabled?(script, version = nil)
    if version != nil && @list.has_key?(script)
      return false unless @list[script][1] >= version
    end    
    return @enabled[script]
  end
  #--------------------------------------------------------------------------
  # * Enables the passed script
  #--------------------------------------------------------------------------
  def self.enable(script)
    @enabled[script] = true
  end
  #--------------------------------------------------------------------------
  # * Disables the passed script
  #--------------------------------------------------------------------------
  def self.disable(script)
    # Disable Script
    @enabled[script] = false
  end
  #--------------------------------------------------------------------------
  # * Returns a list of custom scripts
  #--------------------------------------------------------------------------
  def self.return_log(script = '')
    return script == '' || @list.include?(script) == false ? 
      self.sorted_log : @list[script]
  end
  #--------------------------------------------------------------------------
  # * Returns a list of enabled scripts
  #--------------------------------------------------------------------------
  def self.return_enabled_log(script = '')
    return script == '' || self.enabled?(script) == false ? 
      self.sorted_enabled_log : @enabled[script]
  end
  #--------------------------------------------------------------------------
  # * Returns alias log
  #--------------------------------------------------------------------------
  def self.return_alias_log(script = '')
    return script == '' || @list.include?(script) == false ?
      self.sorted_alias_log : @aliases[script]
  end
  #--------------------------------------------------------------------------
  def self.return_overwrite_log(script = '')
    return script == '' || @list.include?(script) == false ?
      self.sorted_alias_log : @aliases[script]
  end
  #--------------------------------------------------------------------------
  # * Writes a list of the custom scripts to a file
  #--------------------------------------------------------------------------
  def self.write(scripts = self.sorted_log)
    # Opens / Creates File & Writes Script Listings
    file = File.open('Scripts List.txt', 'wb')
    for script in scripts
      l = "#{script[0]} : #{script[1]} Version #{script[2]} (#{script[3]})\n"
      file.write(l)
    end
    file.close
  end
  #--------------------------------------------------------------------------
  # * Writes a list of the enabled scripts to a file
  #--------------------------------------------------------------------------
  def self.write_enabled
    self.write(self.sorted_enabled_log)
  end
  #--------------------------------------------------------------------------
  # * Writes a list of the aliases
  #--------------------------------------------------------------------------
  def self.write_aliases
    # Opens / Creates File & Writes Script Listings
    file = File.open('Alias List.txt', 'wb')
    for sname in @aliases.keys.sort
      for a in @aliases[sname]
        c, o, n = "Class: #{a[0]}", "Old Name: #{a[1]}", "New Name: #{a[2]}"
        file.write("#{sname} -  #{c} - #{o} - #{n}\n")
      end
    end
    file.close
  end
  #--------------------------------------------------------------------------
  # * Writes a list of the overwrites
  #--------------------------------------------------------------------------
  def self.write_overwrites
    # Opens / Creates File & Writes Script Listings
    file = File.open('Overwrites List.txt', 'wb')
    for sname in @overwrites.keys.sort
      for o in @overwrites[sname]
        file.write("#{sname} -  Class: #{o[0]} - Method:#{o[1]}\n")
      end
    end
    file.close
  end
  #--------------------------------------------------------------------------
  # * Sort Script List
  #
  #   sort_type : 0 - Scripter, 1 - Script Name
  #--------------------------------------------------------------------------
  def self.sorted_log(sort_type = 0)
    # Creates Sorted Nested Array
    nested = @list.sort do |a, b|
      sort_type == 0 ? a[1][0] <=> b [1][0] : a[0] <=> b[0]
    end
    # Creates Sorted List
    lst = []
    nested.each do |x|
      x.flatten!
      lst << ((sort_type == 0 ? [x[1], x[0]] : [x[0], x[1]]) << x[2] << x[3])
    end
    # Return List
    return lst
  end
  #--------------------------------------------------------------------------
  # * Sort Enabled Script List
  #
  #   sort_type : 0 - Scripter, 1 - Script Name
  #--------------------------------------------------------------------------
  def self.sorted_enabled_log(sort_type = 0)
    # Creates Sorted Nested Array
    nested = @list.sort do |a, b|
      sort_type == 0 ? a[1][0] <=> b [1][0] : a[0] <=> b[0]
    end
    # Creates Sorted List
    lst = []
    nested.each do |x|
      next unless @enabled[x[0]]
      x.flatten!
      lst << ((sort_type == 0 ? [x[1], x[0]] : [x[0], x[1]]) << x[2] << x[3])
    end
    # Return List
    return lst
  end
  #--------------------------------------------------------------------------
  # * Show Auto Disable Error Message
  #
  #   Missing Reqs = { type => parameters }
  #
  #   Type 0 : Not High Enough Version
  #    Parameters : [version_required]
  #
  #   Type 1 : SDK Parts Missing
  #    Parameters : [part, ...]
  #
  #   Type 2 : Missing Script
  #    Parameters : [script, ...]
  #
  #   Type 3 : Not High Enough Script Version
  #    Parameters : {script => version, ...}
  #--------------------------------------------------------------------------
  def self.auto_disable_script_message(script, missing_reqs)
    # Start Message Text
    t = 'The following script has been disabled : ' + script
    # If Missing Reqs Specified
    unless missing_reqs.size == 0
      # Adds Message Text
      t += ' for the following reasons : '
      ta = []
      # Pass Through Missing Reqs
      missing_reqs.each do |type, parameters|
        # Branch By Type
        case type
        when 0 # Not High Enough SDK Version
          ta << 'SDK version not high enough version. Please update to ' +
               'at least version ' + parameters.to_s
        when 1 # Missing SDK Part
          ta << 'You are missing part of the SDK. Please add the following ' +
               'parts - ' + parameters.join(' & ')
        when 2 # Missing Scripts
          parameters.each do |script|
            ta << 'Script missing - ' + script
          end
        when 3 # Not High Enough Version
          parameters.each do |script, v|
            ta << 'Script not high enough version - ' + script + 
                 ' (Required ' + v.to_s + 'or higher)'
          end
        end
      end
      # Add Message Text
      t += ta.join(' ; ')
    end
    # Print Error Message
    p t
  end
  #--------------------------------------------------------------------------
  # * Check for Overwrites
  #
  #   Value = [classname, oldmethodname, newmethodname]
  #--------------------------------------------------------------------------
  def self.check_for_overwrites(value)
    # Pass Through All Method Branches
    @method_branch_log.each do |classmethod, submethods|
      # If Class name matches & Sub Methods Include Method
      if classmethod[0] == value[0] && submethods.include?(value[1])
        # Pass Throug All Script Overwrites
        @overwrites.each do |script, overwrites|
          # Pass Through Overwrite List
          overwrites.each do |cm|
            # If Method Matches
            if classmethod == cm
              # Print Error
              p 'The following script will not work : ' + @last_script,
                'Reason : The (' + script + ') overwrites the ' + 
                'method ' + cm[1].to_s + ' erasing the branched method ' +
                value[1].to_s + ' branched from ' + value[0].to_s + ' that ' +
                'the ' + script + ' uses'
              return
            end
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Check for Aliases
  #
  #   Value = [classname, methodname]
  #--------------------------------------------------------------------------
  def self.check_for_aliases(value)
    # Check If Method Ever Aliased
    @aliases.each do |script, list|
      # Pass Through Alias List
      list.each do |con|
        # If Class & Method Match
        if con[0] == value[0] && con[1] == value[1]
          # Print Error
          p 'The following script will not work : ' + script,
            'Reason : The (' + @last_script + ') overwrites the method ' +
            value[1].to_s + ' aliased from ' + "#{con[1]} to #{con[2]}" +
            'found in class ' + value[0]
        end
      end
    end
    # Pass Through All Method Branches
    @method_branch_log.each do |classmethod, submethods|
      # If Class name matches & Sub Methods Include Method
      if classmethod == value
        # Pass Through Aliases
        @aliases.each do |script, list|
          # Pass Through Alias List
          list.each do |con|
            # If Sub Methods Include Old Method
            if submethods.include?(con[1])
              # Print Error
              p 'The following script will not work : ' + script,
                'Reason : The (' + @last_script + ') overwrites the ' + 
                'method ' + con[1].to_s + ' erasing the branched method ' +
                value[1].to_s + ' branched from ' + value[0].to_s + ' that '+
                'the ' + script + ' uses'
            end
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Evals text from an input source
  #--------------------------------------------------------------------------
  def self.text_box_input(element, index)
    return if index == 0
    commands = element.split('|')
    eval(commands[index])
  end
  #--------------------------------------------------------------------------
  # * Returns a list of parameters from an event's comments
  #--------------------------------------------------------------------------
  def self.event_comment_input(*args)
    parameters = []
    list = *args[0].list
    elements = *args[1]
    trigger = *args[2]
    return nil if list == nil
    return nil unless list.is_a?(Array)
    for item in list
      next unless item.code == 108 || item.code == 408
      if item.parameters[0] == trigger
        start = list.index(item) + 1
        finish = start + elements
        for id in start...finish
        end
          next if !list[id]
          parameters.push(list[id].parameters[0])
        return parameters
      end
    end
    return nil
  end
end

#==============================================================================
# ** SDK::Scene Base
#==============================================================================

class SDK::Scene_Base
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    main_variable                 # Main Variable Initialization
    main_spriteset                # Main Spriteset Initialization
    main_sprite                   # Main Sprite Initialization
    main_window                   # Main Window Initialization
    main_audio                    # Main Audio Initialization
    main_transition               # Main Transition Initialization
    loop do                       # Scene Loop
      main_loop                   # Main Loop
      break if main_break?        # Break If Breakloop Test 
    end                           # End Scene Loop
    Graphics.freeze               # Prepare for transition
    main_dispose                  # Main Dispose
    main_end                      # Main End
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Variable Initialization
  #--------------------------------------------------------------------------
  def main_variable   ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Spriteset Initialization
  #--------------------------------------------------------------------------
  def main_spriteset  ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Sprite Initialization
  #--------------------------------------------------------------------------
  def main_sprite     ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Window Initialization
  #--------------------------------------------------------------------------
  def main_window     ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Audio Initialization
  #--------------------------------------------------------------------------
  def main_audio      ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Transition
  #--------------------------------------------------------------------------
  def main_transition
    Graphics.transition
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Loop
  #--------------------------------------------------------------------------
  def main_loop
    Graphics.update             # Update game screen
    Input.update                # Update input information
    main_update                 # Update scene objects
    update                      # Update Processing
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Break Loop Test
  #--------------------------------------------------------------------------
  def main_break?
    return $scene != self # Abort loop if sceen is changed
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Disposal
  #--------------------------------------------------------------------------
  def main_dispose
    # Passes Through All Instance Variables
    self.instance_variables.each do |object_name|
      # Evaluates Object
      object = eval object_name
      # Pass Object To Auto Dispose
      auto_dispose(object)
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Ending
  #--------------------------------------------------------------------------
  def main_end        ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Update
  #--------------------------------------------------------------------------
  def main_update
    # Passes Through All Instance Variables
    self.instance_variables.each do |object_name|
      # Evaluates Object
      object = eval object_name
      # Pass Object To Auto Update
      auto_update(object)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update          ; end
  #--------------------------------------------------------------------------
  # * Main Processing : Auto Dispose
  #--------------------------------------------------------------------------
  def auto_dispose(object)
    # Return If Object isn't a Hash, Array or Respond to Dispose
    return unless object.is_a?(Hash) || object.is_a?(Array) || 
                  object.respond_to?(:dispose)
    # If Hash Object
    if object.is_a?(Hash)
      object.each do |key, value|
        # Pass Key & Value to Auto Dispose
        auto_dispose(key) ; auto_dispose(value)
      end
      return
    end
    # If Array Object
    if object.is_a?(Array)
      # Pass All Object to Auto Dispose
      object.each {|obj| auto_dispose(obj)}
      return
    end
    # If Responds to Dispose
    if object.respond_to?(:dispose)
      # If Responds to Disposed? && is Disposed or Responds to Disable
      # Dispose and dispose is disabled
      if (object.respond_to?(:disposed?) && object.disposed?) ||
         (object.respond_to?(:disable_dispose?) && object.disable_dispose?)
        # Return
        return
      end
      # Dispose Object
      object.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Auto Update
  #--------------------------------------------------------------------------
  def auto_update(object)
    # Return If Object isn't a Hash, Array or Respond to Update
    return unless object.is_a?(Hash) || object.is_a?(Array) || 
                  object.respond_to?(:update)
    # If Hash Object
    if object.is_a?(Hash)
      object.each do |key, value|
        # Pass Key & Value to Auto Update
        auto_update(key) ; auto_update(value)
      end
      return
    end
    # If Array Object
    if object.is_a?(Array)
      # Pass All Object to Auto Update
      object.each {|obj| auto_update(obj)}
      return
    end
    # If Responds to Update
    if object.respond_to?(:update)
      # If Responds to Disable Update & Update Disabled
      if object.respond_to?(:disable_update?) && object.disable_update?
        # Return
        return
      end
      # Update Object
      object.update
    end
  end
end

#==============================================================================
# ** Object
#==============================================================================

class Object
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :disable_dispose, :disable_update
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  if @sdk_disableupdate_stack.nil?
    alias_method :sdk_disableupdate_object_init, :initialize
    @sdk_disableupdate_stack= true
  end
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Original Initialization
    sdk_disableupdate_object_init
    # Turn Disable Flags Off
    @disable_dispose, @disable_update = false, false
  end
  #--------------------------------------------------------------------------
  # * Disable Dispose
  #--------------------------------------------------------------------------
  def disable_dispose?
    return @disable_dispose
  end
  #--------------------------------------------------------------------------
  # * Disable Update
  #--------------------------------------------------------------------------
  def disable_update?
    return @disable_update
  end
end

#==============================================================================
# ** Module
#==============================================================================

class Module
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  if @sdk_logalias_stack.nil?
    alias sdk_aliaslog_aliasmethod alias_method
    @sdk_logalias_stack= true
  end
  #--------------------------------------------------------------------------
  # * Alias Method
  #--------------------------------------------------------------------------
  def alias_method(newmethodname, oldmethodname)
    # Log Alias
    SDK.log_alias(self, oldmethodname, newmethodname)
    # Original Alias Method
    sdk_aliaslog_aliasmethod(newmethodname, oldmethodname)
  end
end

#==============================================================================
# ** Bitmap
#==============================================================================

class Bitmap
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :disable_dispose
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  if @sdk_bitmap_stack.nil?
    alias_method :sdk_bitmap_init, :initialize
    @sdk_bitmap_stack = true
  end
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    # Original Initialization
    sdk_bitmap_init(*args)
    # Turn Disable Dispose ON
    @disable_dispose = true
  end
end

#==============================================================================
# ** RPG::Event::Page::Condition
#==============================================================================

class RPG::Event::Page::Condition
  #--------------------------------------------------------------------------
  # * Conditions Met?
  #--------------------------------------------------------------------------
  def conditions_met?(map_id, event_id)
    # Switch 1 condition confirmation
    if @switch1_valid && $game_switches[@switch1_id] == false
      return false
    end
    # Switch 2 condition confirmation
    if @switch2_valid && $game_switches[@switch2_id] == false
      return false
    end
    # Variable condition confirmation
    if @variable_valid && $game_variables[@variable_id] < @variable_value
      return false
    end
    # Self switch condition confirmation
    if @self_switch_valid
      key = [map_id, event_id, @self_switch_ch]
      if $game_self_switches[key] == false
        return false
      end
    end
    # Returns True
    return true
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    return if self.disposed?
    # Dispose if window contents bit map is set
    if self.contents != nil
      self.contents.dispose
    end
    super
  end
end

#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :commands
  #--------------------------------------------------------------------------
  # * Command
  #--------------------------------------------------------------------------
  def command(index = self.index)
    return @commands[index]
  end
  #--------------------------------------------------------------------------
  # * Commands
  #--------------------------------------------------------------------------
  def commands=(commands)
    # Return if Commands Are Same
    return if @commands == commands
    # Reset Commands
    @commands = commands
    # Resets Item Max
    item_max = @item_max
    @item_max = @commands.size
    # If Item Max Changes
    unless item_max == @item_max
      # Deletes Existing Contents (If Exist)
      unless self.contents.nil?
        self.contents.dispose
        self.contents = nil
      end
      # Recreates Contents
      self.contents = Bitmap.new(width - 32, @item_max * 32)
    end
    # Refresh Window
    refresh
  end
end

#==============================================================================
# ** Window_HorizCommand
#------------------------------------------------------------------------------
#  This window deals with general command choices. (Horizontal)
#==============================================================================

class Window_HorizCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :commands
  attr_accessor :c_spacing
  attr_accessor :alignment
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, c_spacing = (width - 32) / commands.size)
    # Compute window height from command quantity
    super(0, 0, width, 64)
    @commands     = commands
    @item_max     = commands.size
    @column_max   = @item_max
    @c_spacing    = c_spacing
    @alignment    = 1
    self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Command
  #--------------------------------------------------------------------------
  def command(index = self.index)
    return @commands[index]
  end
  #--------------------------------------------------------------------------
  # * Commands
  #--------------------------------------------------------------------------
  def commands=(commands)
    # Return if Commands Are Same
    return if @commands == commands
    # Reset Commands
    @commands = commands
    # Resets Item Max
    item_max    = @item_max
    @item_max   = @commands.size
    @column_max = @item_max
    # If Item Max Changes
    unless item_max == @item_max
      # Deletes Existing Contents (If Exist)
      unless self.contents.nil?
        self.contents.dispose
        self.contents = nil
      end
      # Recreates Contents
    self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    end
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    command = commands[index]
    x = index * @c_spacing + 4
    self.contents.font.color = color
    self.contents.draw_text(x, 0, @c_spacing - 8, 32, command, @alignment)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(@c_spacing * @index, 0, @c_spacing, 32)
  end
end

#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
#  This window displays save files on the save and load screens.
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     file_index : save file index (0-3)
  #     filename   : file name
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 64 + file_index % 4 * 104, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = filename
    @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
end

#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Script
  #--------------------------------------------------------------------------
  def command_355
    # Set first line to script
    script = @list[@index].parameters[0] + "\n"
    # Loop
    loop do
      # If next event command is second line of script or after
      if @list[@index+1].code == 655
        # Add second line or after to script
        script += @list[@index+1].parameters[0] + "\n"
      # If event command is not second line or after
      else
        # Abort loop
        break
      end
      # Advance index
      @index += 1
    end
    # Evaluation
    eval(script)
    # Continue
    return true
  end
end

or I shall point it out in Seph's script editor thingy (In RED)
http://img368.imageshack.us/img368/9593/locationzl0.th.png[/IMG]
 
i want to use the learn skills by items but i would like it so that when they learn the skill from an item a message appears saying something like, "from drinking all those potions it looks like you learned how to heal yourself" or whatever i would want it to say
 
Uzumakishadow:
That can be done with events easily.
But its up to you if you want it scripted or not.

Trickster:
I wonder if SephirothSpawn fixed the Encounter Control problem I had ages ago with the terrain tags, which he said he would fix soon.
 
its uzumakishade, and i dont think it can be done with events because i want the message to appear right when i use the item, meaning it would show up while im in the item menu on the map or in battle
 
i know this sound's silly in your character change script i got an error for removing all the characters can u make it that the main character the hero cannot be remove?
 
@ uzumakishade: watch your attitude. Try yourself. If you can't, ask for help. Do not Demand it, or you will not get it. Try adding some "please", "if youm could", a questionmark maybe.
If you demand stuff with a nasty attitude, the people who can help get vexed. And then they don't help you, or anyone else. They don't have to, anyway.

Sorry if I misunderstood you, I've had too much of that stuff lately...

@ everyone else: sorry for this, It's a soft spot for me... I just couldn't resist:D
 
Hey Seph some error's I found

When doing a switch and changing the party out with a new member I got this error:
script 'skill learn display' line 237: RGSS error ocurred. Failed to create bitmap.
line:
bitmap = Bitmap.new(200, icons.size * 32)

There's another that didn't make an error but it might have just been set up differtly. But your FF8 skills seem to work even before they obtain and use the magic setup for them. Like Arshes is fine but the rest of the party can still use their magic without the points. But even after Arshes gets his draw of cross cut he still can't use it. Not sure what's going on there.

Oh and btw I double and triple checked for the In Battle Switcher. Doesn't seem to be in the testbed (that I was talking about in PM) It's the one with the summoning. I saw A party switcher but not that one. Unless it's smooshed with anotehr script in here or has a differnt name. I'm never good unless there's a big in my face example so I may be missing it.

Either way I hope that helps ya.
 
First off, all scripts in the main post have probably been updated already. There is a beta in my signature right now that has an update in them. Further, I am working on another update where I tons more scripts and such in them ready to be released.

I have been told there was an error in the party switcher. I am debugging it seeing what that was.

Sorry about the lack of update. I am going to cut the V.4 short, and just publish what I have done now as V4, and V5 will be what I intended for V4 is just make a bunch of updates bi-weekly instead of huge updates.

Just give me some time to get myself organized. The test bed now has I believe nearly 70 scripts, 40 more old V.3 test bed scripts I have removed and am updating, then another 30+ that I have yet to update since the start of my test bed, and another 30 that I haven't even finished. I am so un-organized. I have just learned to live in chaos. :p
 
no prob :) Downloaded the beta test bed v4 and i've had a quick scan on it looks like that most of the bugs have been sorted by the looks of it. :)

however, i have a little question on the party changer? Is there a character lock feature? As i want to stop the player from removing the character in slot 1 (who is the main character of my game).
 
There is a required feature you can have. They cannot exit the party changer unless the required people are in the party.

Check the script heading and some instructions should be in there. If you need help, just ask, and I will explain it here.
 
$scene = Scene_Party.new('required' => [001])

oo1 stands the number of the actor
Use that call script to require... however i found some errors crashing that script, seph is trying to find out what causes it and fix it :p my recomendation is to wait til he fix it

Im happy to hear seph is fixing that script because it looks awesome :D
 
Actually, it is just 1, not 001. 0's in the front change the base of the number. You might get lucky once or twice, but most of the time, you will end up screwing up your required actors.
 
waaaa, ok :p I better take that in mind once i use the script again... Thx :D

Btw... u think that could be the reason of the cloned reserve characters????
cos' if so the problem could be solved
 
not quite because the cloned characters were not the required characters, but it could be involved somehow i required #001 and actor 3 was on reserve
the cloned character was the 003, once i reloaded the game and took the reserve character to the party, he stayed on reserva and in party too, then if i tryied to take the cloned 003 to reserve i had 2 # 003 characters on reserve. i had 3 characters cloned in reserve once.

but all of those were called with that call script i wrote

edit: the problem is that i took that script out of my game and i cannot test it anymore

edit 2: ive been trying to find some screenshots i took but i cant i think i erased them
 
Certainly.

To save your locations as is:
Code:
Script : save_goinn_parameters

To specialize positions, use:
Code:
Script :$game_system.gameover_return_parameters[0] = map_id
$game_system.gameover_return_parameters[1] = player_x
$game_system.gameover_return_parameters[2] = player_y
$game_system.gameover_return_parameters[3] = direction

You also have those auto-save feature, that will save your position after you use the transfer player command or the save option.


With everything, if you have any suggestions for additions, just ask.
 
Status
Not open for further replies.

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