Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AutoSelfSwitcher
#1
AutoSelfSwitcher
Version: 1

Introduction
This script sets which self-switches of events from certain maps are turned on by default.

Features
  • Set which self-switches from certain events at certain maps turn on at the start of your project.

Screenshots
No screenshots.

Demo
No demo.

Script
Code:
=begin
????????????????????????????????????????????????????????????????????????????????
? AutoSelfSwitcher                                                             ?
? by PK8                                                                       ?
? September 16th, 2009                                                         ?
? http://rmvxp.com                                                             ?
????????????????????????????????????????????????????????????????????????????????
? ? Table of Contents                                                          ?
? ?? Author's Notes                - Line 14,15                                ?
? ?? Introduction & Description    - Line 17?19                                ?
? ?? Features                      - Line 21?23                                ?
? ?? This aliases the following... - Line 25,26                                ?
????????????????????????????????????????????????????????????????????????????????
? ? Author's Notes                                                             ?
? My boredom + my interest in self-switches/self-variables made me do this!    ?
????????????????????????????????????????????????????????????????????????????????
? ? Introduction & Description                                                 ?
? This script sets which self-switches of events from certain maps are turned  ?
? on by default.                                                               ?
????????????????????????????????????????????????????????????????????????????????
? ? Features                                                                   ?
? ? Set which self-switches from certain events at certain maps turn on at the ?
?   start of your project.                                                     ?
????????????????????????????????????????????????????????????????????????????????
? ? This aliases the following...                                              ?
? initialize          - Game_SelfSwitches                                      ?
????????????????????????????????????????????????????????????????????????????????
=end

#===============================================================================??
# ** AutoSelfSwitcher Customization!
#===============================================================================??
class PK8
  ASS_Switches = [
    # [map_id, event_id, self_switch_id],
    [1, 1, 'A'],
    [1, 2, 'B'],
    [1, 3, 'C'],
    [1, 4, 'D']
  ]
end

#==============================================================================
# ** Game_SelfSwitches
#------------------------------------------------------------------------------
#  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_switches.
#==============================================================================

class Game_SelfSwitches
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :pk8_autoselfswitcher_initialize, :initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    pk8_autoselfswitcher_initialize
    PK8::ASS_Switches.each { | k | @data[k] = true }
  end
end

Instructions
Setting up the script is pretty easy, I think. Just go into the ASS_Switches array. It should look like this:
Code:
ASS_Switches = [
    # [map_id, event_id, self_switch_id],
    [1, 1, 'A'],
    [1, 2, 'B'],
    [1, 3, 'C'],
    [1, 4, 'D']
  ]
And start modifying the script starting at Line 35. :P

FAQ
Feel free to ask.

Compatibility
Aliases initialize of Game_SelfSwitches.

Credits and Thanks
No one to thank.

Author's Notes
My boredom + my interest in self-switches/self-variables made me do this!

Terms and Conditions
*shrugs*
Reply }




Users browsing this thread: