Code:
=begin
????????????????????????????????????????????????????????????????????????????????
? AutoSelfVariables ?
? by PK8 ?
? November 8th, 2009 ?
? http://rmvxp.com ?
????????????????????????????????????????????????????????????????????????????????
? ? Table of Contents ?
? ?? Author's Notes - Line 14,15 ?
? ?? Introduction & Description - Line 17?18 ?
? ?? Features - Line 20?22 ?
? ?? This aliases the following... - Line 24,25 ?
????????????????????????????????????????????????????????????????????????????????
? ? Author's Notes ?
? My boredom made me work on this script. :P ?
????????????????????????????????????????????????????????????????????????????????
? ? Introduction & Description ?
? This script sets initial values of self-variables of events from certain maps?
????????????????????????????????????????????????????????????????????????????????
? ? Features ?
? ? Set initial values of self-variables from certain events at certain maps at?
? the start of your project. ?
????????????????????????????????????????????????????????????????????????????????
? ? This aliases the following... ?
? initialize - Game_SelfVariables ?
????????????????????????????????????????????????????????????????????????????????
=end
#===============================================================================??
# ** AutoSelfVariables Customization!
#===============================================================================??
class PK8
ASV_Variables = {} # Do not touch.
# ASV_Parameters[[map_id, event_id, id]] = value
ASV_Variables[[1, 1, 'A']] = 1
ASV_Variables[[1, 2, 'A']] = 5
ASV_Variables[[1, 3, 'A']] = 10
ASV_Variables[[1, 4, 'A']] = rand(20)
end
#==============================================================================
# ** Game_SelfVariables
#------------------------------------------------------------------------------
# This class handles self switches. It's a wrapper for the built-in class
# "Hash." The instance of this class is referenced by $game_self_variables.
#==============================================================================
class Game_SelfVariables
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :pk8_autoselfvariables_initialize, :initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
pk8_autoselfvariables_initialize
PK8::ASV_Variables.each_pair { | k, v | @data[k] = v }
end
end