Vintage_Lolkats 0 Report post Posted September 4, 2010 (edited) Hiya, im having troble with the Inn & Savepoint System script #============================================================================== # ** Inn & Savepoint System #------------------------------------------------------------------------------ # SephirothSpawn # Version 2 # 2006-10-19 #------------------------------------------------------------------------------ # * Version History : # # Version 1 ---------------------------------------------------- (2006-03-08) # Version 2 ---------------------------------------------------- (2006-10-19) # - Update : Rescripted Much of System #------------------------------------------------------------------------------ # * Requirements : # # Scene_Base # Near Fantastica's Pathfinding For Inn Transfer Movement (Optional) # Gameover to Inn System (Optional) #------------------------------------------------------------------------------ # * Description : # # This script was designed to allow you to create Inn's and savepoints with # a simple call script. For the Savepoints, you can control what commands # appear and disable commands. For the Inn, you can control the inn's # cost, greetings, and have the option to make the player move to certain # coordinates on the map as the screen fades to black. It is also configured # to have the option to save coordinates of the Gameover to Inn coordinates. #------------------------------------------------------------------------------ # * Instructions : # # Place The Script Below the SDK and Above Main. # To Customize Save Options and Default Inn Greetings, refer to Customization # To open Savepoint or Inn, refer to syntax. #------------------------------------------------------------------------------ # * Customization : # # Setting Command Words # - SPC_Save = 'word' # - SPC_Load = 'word' # - SPC_Menu = 'word' # - SPC_Shutdown = 'word' # - SPC_Cancel = 'word' # # Show Commands Enabled At Startup # - Enable_SPC_Save = true or false # - Enable_SPC_Save = true or false # - Enable_SPC_Load = true or false # - Enable_SPC_Menu = true or false # - Enable_SPC_Shutdown = true or false # - Enable_SPC_Cancel = true or false # # Show Disabled Commands (If True, commands will apear but will be disabled) # - Show_Disabled_Commands = true or false # # Default Inn Greetings # - DIG_Greeting = 'greeting' # - DIG_Staying = 'greeting' # - DIG_Thanks = 'greeting' # - DIG_Exit = 'greeting' # # Save Inn Location (Configured For Gameover to Inn System) # - Save_GO_To_Inn = true or false #------------------------------------------------------------------------------ # * Syntax : # # Disabling Savepoint Command # - $game_system.disabled_sp_commands << <command> # # Enabling Savepoint Command # - if $game_system.disabled_sp_commands.include?(<command>) # $game_system.disabled_sp_commands.delete(<command>) # end # # Replace <command> with : ISP_System::SPC_Save, ISP_System::SPC_Load, # ISP_System::SPC_Menu, ISP_System::SPC_Shutdown or ISP_System::SPC_Cancel # # Opening Savepoint # - $scene = Scene_Savepoint.new # # Opening Inn # - inn = Game_Inn.new(<cost>, <transfer_coordinates>, <greetings>) # $scene = Scene_Inn.new(inn) # # Replace <cost> with cost of inn. # Replace <transfer_coordinates> with [x, y] or nil, for no transfer. # Replace <greetings> with {<keyword> => 'greeting'} # # The following are keywords for the greetings : # 'greeting' => 'greeting' # 'staying' => 'staying greeting' # 'thanks' => 'thanks greeting' # 'exit' => 'exit greeting' # # Any non-speficied keywords will rely on the defaults set in the ISP module #============================================================================== #------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ SDK.log('Inn & Savepoint System', 'SephirothSpawn', 2, '2006-10-19') #------------------------------------------------------------------------------ # * Scene Base Test #------------------------------------------------------------------------------ unless SDK.state('Scene Base') # Print Error p 'Scene Base Not Found. Inn & Savepoint System Disabled.' # Disable Encounter Control SDK.disable('Inn & Savepoint System') end #------------------------------------------------------------------------------ # * Pathfinding Test #------------------------------------------------------------------------------ unless SDK.state('Path Finding') # Print Error p 'Path Finding Not Found. Inn & Savepoint System Will Not Disabled, but ' + 'in transfers will not work preperly with using the transfer option.' end #------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ if SDK.state('Inn & Savepoint System') #============================================================================== # ** ISP_System #============================================================================== module ISP_System #-------------------------------------------------------------------------- # * Save Point Commands #-------------------------------------------------------------------------- SPC_Save = 'Save' SPC_Load = 'Load' SPC_Menu = 'Menu' SPC_Shutdown = 'Shutdown' SPC_Cancel = 'Cancel' #-------------------------------------------------------------------------- # * Default Enable Save Point Commands #-------------------------------------------------------------------------- Enable_SPC_Save = true Enable_SPC_Save = true Enable_SPC_Load = true Enable_SPC_Menu = true Enable_SPC_Shutdown = true Enable_SPC_Cancel = true #-------------------------------------------------------------------------- # * Show Disabled Commands # # ~ When True, commands will appear disabled color. when false, commands # will not appear. #-------------------------------------------------------------------------- Show_Disabled_Commands = true #-------------------------------------------------------------------------- # * Default Inn Greetings #-------------------------------------------------------------------------- DIG_Greeting = 'Welcome to the Inn. Would you like to stay?' DIG_Staying = 'Enjoy Your Stay' DIG_Thanks = 'Thank You for staying' DIG_Exit = 'See You Later' #-------------------------------------------------------------------------- # * Save Gameover to Inn Location #-------------------------------------------------------------------------- Save_GO_To_Inn = true end #========================================================================= # ** Game_Inn #========================================================================= class Game_Inn #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :cost, :transfer attr_reader :greeting, :staying, :thanks, :exit #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(cost = 250, transfer = nil, greetings = {}) # Set Default Greetings If Unassigned unless greetings.has_key?('greeting') greetings['greeting'] = ISP_System::DIG_Greeting end unless greetings.has_key?('staying') greetings['staying'] = ISP_System::DIG_Staying end unless greetings.has_key?('thanks') greetings['thanks'] = ISP_System::DIG_Thanks end unless greetings.has_key?('exit') greetings['exit'] = ISP_System::DIG_Exit end # Sets Cost and Transfer @cost, @transfer = cost, transfer # Sets Greetings @greeting = greetings['greeting'] @staying = greetings['staying'] @thanks = greetings['thanks'] @exit = greetings['exit'] end end #============================================================================== # ** Game_System #============================================================================== class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :disabled_sp_commands, :savepoint_return #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_ispsystem_gmsys_init initialize #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Original Initialization seph_ispsystem_gmsys_init # Sets Disabled Savepoint Commands @disabled_sp_commands = [] isp = ISP_System @disabled_sp_commands << SPC_Save unless isp::Enable_SPC_Save @disabled_sp_commands << SPC_Load unless isp::Enable_SPC_Load @disabled_sp_commands << SPC_Menu unless isp::Enable_SPC_Menu @disabled_sp_commands << SPC_Shutdown unless isp::Enable_SPC_Shutdown @disabled_sp_commands << SPC_Cancel unless isp::Enable_SPC_Cancel # Turns Off Savepoint Return @savepoint_return = false end #-------------------------------------------------------------------------- # * Savepoint Commands #-------------------------------------------------------------------------- def savepoint_commands # Removes Duplicate Disabled Commands @disabled_sp_commands.uniq # Sets Up Commands isp = ISP_System c = [] # Passes Through All Savepoint Commands [isp::SPC_Save, isp::SPC_Load, isp::SPC_Menu, isp::SPC_Shutdown, isp::SPC_Cancel].each do |command| # If Show Disabled Commands or Not Disabled if isp::Show_Disabled_Commands # Add Command c << command else c << command unless @disabled_sp_commands.include?(command) end end # Returns Commands return c end end #============================================================================== # ** Game_Player #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :disable_player_movement #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- if @seph_ispsystem_gmplyr.nil? alias seph_ispsystem_gameplayer_init initialize alias seph_ispsystem_gameplayer_upm update_player_movement alias seph_ispsystem_gameplayer_uat update_action_trigger @seph_ispsystem_gmplyr = true end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Turns Off Disable Movement @disable_player_movement = false # Original Initialization seph_ispsystem_gameplayer_init end #-------------------------------------------------------------------------- # * Player Movement Update #-------------------------------------------------------------------------- def update_player_movement # Original Update Player Movement Unless Movement Disabled seph_ispsystem_gameplayer_upm unless @disable_player_movement end #-------------------------------------------------------------------------- # * Update Action Trigger #-------------------------------------------------------------------------- def update_action_trigger # Original Update Player AT Unless Movement Disabled seph_ispsystem_gameplayer_uat unless @disable_player_movement end end #========================================================================= # ** Window_InnGold #========================================================================= class Window_InnGold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(cost) super(640, 368, 320, 96) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 160 @cost = cost refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, contents.width, 32, 'Current Gold:') self.contents.font.color = normal_color self.contents.draw_text(- 4, 0, contents.width, 32, $game_party.gold.to_s, 2) self.contents.font.color = $game_party.gold >= @cost ? text_color(1) : text_color(2) self.contents.draw_text(4, 32, contents.width, 32, 'Cost to stay:') self.contents.draw_text(- 4, 32, contents.width, 32, @cost.to_s, 2) end end #============================================================================== # ** Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_ispsystem_stitle_main main #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # If Game_System Exist unless $game_system.nil? # If Savepint Return if $game_system.savepoint_return # Fetches Index of Load Command index = $game_system.savepoint_commands.index(ISP_System::SPC_Load) # Returns To Savepoint Scene $scene = Scene_Savepoint.new(false, index) # Turn Savepoint Return Flag Off $game_system.savepoint_return = false return end end # Original Main Method seph_ispsystem_stitle_main end end #============================================================================== # ** Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_ispsystem_smap_main main #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # If Savepoint Return if $game_system.savepoint_return # Fetches Menu Command Index index = $game_system.savepoint_commands.index(ISP_System::SPC_Menu) # Switches to Savepoint Scene $scene = Scene_Savepoint.new(false, index) # Turns off Savepoint Return flag $game_system.savepoint_return = false return end # Original Main Method seph_ispsystem_smap_main end end #============================================================================== # ** Scene_Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_ispsystem_smenu_main main #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # If Savepoint Return if $game_system.savepoint_return # Branch By Menu Index case @menu_index when 4 # Save # Fetches Save Command Index index = $game_system.savepoint_commands.index(ISP_System::SPC_Save) # Switches to Savepoint Scene $scene = Scene_Savepoint.new(false, index) # Turns Savepoint Return Flag Off $game_system.savepoint_return = false return when 5 # End Game # Fetches Save Command Index index = $game_system.savepoint_commands.index( ISP_System::SPC_Shutdown) # Switches to Savepoint Scene $scene = Scene_Savepoint.new(false, index) # Turns Savepoint Return Flag Off $game_system.savepoint_return = false return end end # Original Main Method seph_ispsystem_smenu_main end end #============================================================================== # ** Scene_Savepoint #============================================================================== class Scene_Savepoint < Scene_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(animation = true, index = 0) @animation, @index = animation, index end #-------------------------------------------------------------------------- # * Main Processing : Spriteset Initialization #-------------------------------------------------------------------------- def main_spriteset # Creates Map Spriteset @spriteset = Spriteset_Map.new end #-------------------------------------------------------------------------- # * Main Processing : Window Initialization #-------------------------------------------------------------------------- def main_window # Creates Help Window @help_window = Window_Help.new @help_window.y = @animation ? - 64 : 0 @help_window.opacity = 160 @help_window.set_text('What Would You like to Do?', 1) # Creates Gold Window @gold_window = Window_Gold.new @gold_window.x = 16 @gold_window.y = @animation ? 480 : 400 @gold_window.opacity = 160 # Creates Steps Window @steps_window = Window_Steps.new @steps_window.x = 464 @steps_window.y = @animation ? 480 : 368 @steps_window.opacity = 160 # Creates Command Window @command_window = Window_Command.new(256, $game_system.savepoint_commands) @command_window.x = 192 @command_window.y = @animation ? 480 : 144 @command_window.opacity = 160 @command_window.height = 192 @command_window.index = @index # If Show Disabld Commands if ISP_System::Show_Disabled_Commands # Passes Through All Commands isp = ISP_System [isp::SPC_Save, isp::SPC_Load, isp::SPC_Menu, isp::SPC_Shutdown, isp::SPC_Cancel].each do |command| # If Command Included if $game_system.savepoint_commands.include?(command) # If Command Disabled if $game_system.disabled_sp_commands.include?(command) # Disable Command From Window index = $game_system.savepoint_commands.index(command) @command_window.disable_command(index) end end end end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Main Update if @command_window.active update_main return end # Update Exit update_exit end #-------------------------------------------------------------------------- # * Frame Update : Main #-------------------------------------------------------------------------- def update_main # Moves In Windows @help_window.y += 4 if @help_window.y < 0 @gold_window.y -= 5 if @gold_window.y > 400 @steps_window.y -= 7 if @steps_window.y > 368 @command_window.y -= 21 if @command_window.y > 144 # If B button is Pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Turns off Confirmation Window @command_window.active = false return end # If C button is pressed if Input.trigger?(Input::C) # Gets Command command = $game_system.savepoint_commands[@command_window.index] # If Command Disabled if $game_system.disabled_sp_commands.include?(command) # Play busser SE $game_system.se_play($data_system.buzzer_se) # Sets Help Text @help_window.set_text(command + ' has been disabled.', 1) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Turns On Savepoint Return $game_system.savepoint_return = true # Branch Point for command case command when ISP_System::SPC_Save # Scene Change $scene = Scene_Save.new return when ISP_System::SPC_Load # Scene Change $scene = Scene_Load.new return when ISP_System::SPC_Menu # Scene Change $scene = Scene_Menu.new return when ISP_System::SPC_Shutdown # Scene Change $scene = Scene_End.new return when ISP_System::SPC_Cancel # Turns Off Savepoint Return $game_system.savepoint_return = false # Turns off Confirmation Window @command_window.active = false return end end end #-------------------------------------------------------------------------- # * Frame Update : Exit #-------------------------------------------------------------------------- def update_exit # Moves Out Windows @help_window.y -= 4 if @help_window.y > - 64 @gold_window.y += 5 if @gold_window.y < 480 @steps_window.y += 7 if @steps_window.y < 480 @command_window.y += 21 if @command_window.y < 480 # When Finished Moving Windows unless @help_window.y > - 64 # Changes to Scene Map $scene = Scene_Map.new end end end #============================================================================== # ** Scene_Inn #============================================================================== class Scene_Inn < Scene_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(inn = Game_Inn.new) @inn = inn end #-------------------------------------------------------------------------- # * Main Processing : Variable Initialization #-------------------------------------------------------------------------- def main_variable # Disables Player Movements $game_player.disable_player_movement = true end #-------------------------------------------------------------------------- # * Main Processing : Spriteset Initialization #-------------------------------------------------------------------------- def main_spriteset # Creates Map Spriteset @spriteset = Spriteset_Map.new end #-------------------------------------------------------------------------- # * Main Processing : Window Initialization #-------------------------------------------------------------------------- def main_window # Creates Help Window @help_window = Window_Help.new @help_window.width = 604 @help_window.contents = Bitmap.new(572, 32) @help_window.x = 16 @help_window.y = - 64 @help_window.opacity = 160 @help_window.set_text(@inn.greeting, 1) # Creates Confirmation Window @confirmation_window = Window_Command.new(160, ['Yes', 'No']) @confirmation_window.x = - 160 @confirmation_window.y = 368 @confirmation_window.opacity = 160 # Creates Gold Window @gold_window = Window_InnGold.new(@inn.cost) end #-------------------------------------------------------------------------- # * Main Processing : Ending #-------------------------------------------------------------------------- def main_end # Enables Player Movements $game_player.disable_player_movement = false end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update Player & Screen $game_player.update $game_screen.update $game_map.update # If Confirmation Window Active if @confirmation_window.active update_main return # If Phase is 'Staying' elsif @phase == 'Staying' update_staying return # If Phase is 'Stay Exit' elsif @phase == 'Stay Exit' update_stay_exit return # If Phase is 'Exit' elsif @phase == 'Exit' update_exit return end end #-------------------------------------------------------------------------- # * Frame Update: Main #-------------------------------------------------------------------------- def update_main # Moves In Windows @help_window.y += 10 if @help_window.y < 16 @confirmation_window.x += 22 if @confirmation_window.x < 16 @gold_window.x -= 42 if @gold_window.x > 304 # If B button is pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Set Help Text @help_window.set_text(@inn.exit, 1) # Turns off Confirmation Window @confirmation_window.active = false # Turns to Exit Phase @phase = 'Exit' return end # If C button is pressed if Input.trigger?(Input::C) # If No if @confirmation_window.index == 1 # Play cancel SE $game_system.se_play($data_system.cancel_se) # Set Help Text @help_window.set_text(@inn.exit, 1) # Turns off Confirmation Window @confirmation_window.active = false # Turns to Exit Phase @phase = 'Exit' return end # Checks Gold if $game_party.gold < @inn.cost # Play buzzer SE $game_system.se_play($data_system.buzzer_se) # Set Help Text @help_window.set_text("Not Enought #{$data_system.words.gold}", 1) return end # Play Decision SE $game_system.se_play($data_system.decision_se) # Recovers Actors $game_party.actors.each {|actor| actor.recover_all} # Sets Help Window Text @help_window.set_text(@inn.staying, 1) # Lose Gold $game_party.lose_gold(@inn.cost) # Refresh Gold Window @gold_window.refresh # Stores Player Location @temp_loc = [$game_player.x, $game_player.y] # Starts Frame Counting @stay_frame_count = 0 # Moves Player to Bedroom unless @inn.transfer.nil? # Moves Player to Bedroom $game_player.find_path(@inn.transfer[0], @inn.transfer[1]) end # Starts Screen Fading Out $game_screen.start_tone_change(Tone.new(-255, -255, -255, 0), 50) # Turns off Confirmation Window @confirmation_window.active = false # Turns Phase to Staying @phase = 'Staying' # If Gameover to Inn System Found if SDK.state('Gameover to Inn') # If Save Gameover to Inn Location if ISP_System::Save_GO_To_Inn $game_system.gameover_return_parameters[0] = $game_map.map_id $game_system.gameover_return_parameters[1] = $game_player.x $game_system.gameover_return_parameters[2] = $game_player.y $game_system.gameover_return_parameters[3] = $game_player.direction end end return end end #-------------------------------------------------------------------------- # * Frame Update: Staying #-------------------------------------------------------------------------- def update_staying # Move Out Windows @help_window.y -= 10 if @help_window.y > - 64 @confirmation_window.x -= 22 if @confirmation_window.x > - 160 @gold_window.x += 42 if @gold_window.x < 640 # Counts Frames @stay_frame_count += 1 # If Stay is Complete if @stay_frame_count == 100 # Sets Help Text @help_window.set_text(@inn.thanks, 1) # Starts Screen Fading Out $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20) # Moves Player Out of Bedroom unless @inn.transfer.nil? # Moves Player to Bedroom $game_player.find_path(@temp_loc[0], @temp_loc[1]) end # Turns Phase to Stay Exit @phase = 'Stay Exit' end end #-------------------------------------------------------------------------- # * Frame Update: Stay Exit #-------------------------------------------------------------------------- def update_stay_exit # Moves In Windows @help_window.y += 10 if @help_window.y < 16 @gold_window.x -= 42 if @gold_window.x > 304 # Player Movement Finished if $game_player.x == @temp_loc[0] && $game_player.y == @temp_loc[1] # Set Help Text @help_window.set_text(@inn.exit, 1) # Window Finished Movement if @help_window.x == 16 && @gold_window.x == 304 # If B or C is pressed if Input.trigger?(Input::B) || Input.trigger?(Input::C) # Play Decision SE $game_system.se_play($data_system.cancel_se) # Turns Phase to Exit @phase = 'Exit' return end end end end #-------------------------------------------------------------------------- # * Frame Update: Stay Exit #-------------------------------------------------------------------------- def update_exit # Move Windows @help_window.y -= 10 if @help_window.y > - 64 @confirmation_window.x -= 22 if @confirmation_window.x > - 160 @gold_window.x += 42 if @gold_window.x < 640 # Exit Scene unless @help_window.y > - 64 # Transfers To Map Scene $scene = Scene_Map.new end end end #-------------------------------------------------------------------------- # * End SDK Enable Test #-------------------------------------------------------------------------- end can someone tell me how to insert it and explain how to customize it... im terrible with scripts, i prefer the ones that come with demos lol. and also with the ATES script... how to i make the clock go at a realistic rate, not 40 minutes in one second :D sorry about the length btw, cant remember how to do spoilers :S EDIT: Got ATES workin fine, but on the inn & savepoint one i get "Script 'Inn and Savepoint' line 439: Type error occured. undefined superclass 'Scene_Base'" Line 439: class Scene_Savepoint < Scene_Base :S confussion!! any ideas anyone? Edited September 5, 2010 by Vintage_Lolkats Share this post Link to post Share on other sites
Hiya, im having troble with the Inn & Savepoint System script
#==============================================================================
# ** Inn & Savepoint System
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2
# 2006-10-19
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (2006-03-08)
# Version 2 ---------------------------------------------------- (2006-10-19)
# - Update : Rescripted Much of System
#------------------------------------------------------------------------------
# * Requirements :
#
# Scene_Base
# Near Fantastica's Pathfinding For Inn Transfer Movement (Optional)
# Gameover to Inn System (Optional)
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to allow you to create Inn's and savepoints with
# a simple call script. For the Savepoints, you can control what commands
# appear and disable commands. For the Inn, you can control the inn's
# cost, greetings, and have the option to make the player move to certain
# coordinates on the map as the screen fades to black. It is also configured
# to have the option to save coordinates of the Gameover to Inn coordinates.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
# To Customize Save Options and Default Inn Greetings, refer to Customization
# To open Savepoint or Inn, refer to syntax.
#------------------------------------------------------------------------------
# * Customization :
#
# Setting Command Words
# - SPC_Save = 'word'
# - SPC_Load = 'word'
# - SPC_Menu = 'word'
# - SPC_Shutdown = 'word'
# - SPC_Cancel = 'word'
#
# Show Commands Enabled At Startup
# - Enable_SPC_Save = true or false
# - Enable_SPC_Save = true or false
# - Enable_SPC_Load = true or false
# - Enable_SPC_Menu = true or false
# - Enable_SPC_Shutdown = true or false
# - Enable_SPC_Cancel = true or false
#
# Show Disabled Commands (If True, commands will apear but will be disabled)
# - Show_Disabled_Commands = true or false
#
# Default Inn Greetings
# - DIG_Greeting = 'greeting'
# - DIG_Staying = 'greeting'
# - DIG_Thanks = 'greeting'
# - DIG_Exit = 'greeting'
#
# Save Inn Location (Configured For Gameover to Inn System)
# - Save_GO_To_Inn = true or false
#------------------------------------------------------------------------------
# * Syntax :
#
# Disabling Savepoint Command
# - $game_system.disabled_sp_commands << <command>
#
# Enabling Savepoint Command
# - if $game_system.disabled_sp_commands.include?(<command>)
# $game_system.disabled_sp_commands.delete(<command>)
# end
#
# Replace <command> with : ISP_System::SPC_Save, ISP_System::SPC_Load,
# ISP_System::SPC_Menu, ISP_System::SPC_Shutdown or ISP_System::SPC_Cancel
#
# Opening Savepoint
# - $scene = Scene_Savepoint.new
#
# Opening Inn
# - inn = Game_Inn.new(<cost>, <transfer_coordinates>, <greetings>)
# $scene = Scene_Inn.new(inn)
#
# Replace <cost> with cost of inn.
# Replace <transfer_coordinates> with [x, y] or nil, for no transfer.
# Replace <greetings> with {<keyword> => 'greeting'}
#
# The following are keywords for the greetings :
# 'greeting' => 'greeting'
# 'staying' => 'staying greeting'
# 'thanks' => 'thanks greeting'
# 'exit' => 'exit greeting'
#
# Any non-speficied keywords will rely on the defaults set in the ISP module
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Inn & Savepoint System', 'SephirothSpawn', 2, '2006-10-19')
#------------------------------------------------------------------------------
# * Scene Base Test
#------------------------------------------------------------------------------
unless SDK.state('Scene Base')
# Print Error
p 'Scene Base Not Found. Inn & Savepoint System Disabled.'
# Disable Encounter Control
SDK.disable('Inn & Savepoint System')
end
#------------------------------------------------------------------------------
# * Pathfinding Test
#------------------------------------------------------------------------------
unless SDK.state('Path Finding')
# Print Error
p 'Path Finding Not Found. Inn & Savepoint System Will Not Disabled, but ' +
'in transfers will not work preperly with using the transfer option.'
end
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Inn & Savepoint System')
#==============================================================================
# ** ISP_System
#==============================================================================
module ISP_System
#--------------------------------------------------------------------------
# * Save Point Commands
#--------------------------------------------------------------------------
SPC_Save = 'Save'
SPC_Load = 'Load'
SPC_Menu = 'Menu'
SPC_Shutdown = 'Shutdown'
SPC_Cancel = 'Cancel'
#--------------------------------------------------------------------------
# * Default Enable Save Point Commands
#--------------------------------------------------------------------------
Enable_SPC_Save = true
Enable_SPC_Save = true
Enable_SPC_Load = true
Enable_SPC_Menu = true
Enable_SPC_Shutdown = true
Enable_SPC_Cancel = true
#--------------------------------------------------------------------------
# * Show Disabled Commands
#
# ~ When True, commands will appear disabled color. when false, commands
# will not appear.
#--------------------------------------------------------------------------
Show_Disabled_Commands = true
#--------------------------------------------------------------------------
# * Default Inn Greetings
#--------------------------------------------------------------------------
DIG_Greeting = 'Welcome to the Inn. Would you like to stay?'
DIG_Staying = 'Enjoy Your Stay'
DIG_Thanks = 'Thank You for staying'
DIG_Exit = 'See You Later'
#--------------------------------------------------------------------------
# * Save Gameover to Inn Location
#--------------------------------------------------------------------------
Save_GO_To_Inn = true
end
#=========================================================================
# ** Game_Inn
#=========================================================================
class Game_Inn
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :cost, :transfer
attr_reader :greeting, :staying, :thanks, :exit
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(cost = 250, transfer = nil, greetings = {})
# Set Default Greetings If Unassigned
unless greetings.has_key?('greeting')
greetings['greeting'] = ISP_System::DIG_Greeting
end
unless greetings.has_key?('staying')
greetings['staying'] = ISP_System::DIG_Staying
end
unless greetings.has_key?('thanks')
greetings['thanks'] = ISP_System::DIG_Thanks
end
unless greetings.has_key?('exit')
greetings['exit'] = ISP_System::DIG_Exit
end
# Sets Cost and Transfer
@cost, @transfer = cost, transfer
# Sets Greetings
@greeting = greetings['greeting']
@staying = greetings['staying']
@thanks = greetings['thanks']
@exit = greetings['exit']
end
end
#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :disabled_sp_commands, :savepoint_return
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_ispsystem_gmsys_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_ispsystem_gmsys_init
# Sets Disabled Savepoint Commands
@disabled_sp_commands = []
isp = ISP_System
@disabled_sp_commands << SPC_Save unless isp::Enable_SPC_Save
@disabled_sp_commands << SPC_Load unless isp::Enable_SPC_Load
@disabled_sp_commands << SPC_Menu unless isp::Enable_SPC_Menu
@disabled_sp_commands << SPC_Shutdown unless isp::Enable_SPC_Shutdown
@disabled_sp_commands << SPC_Cancel unless isp::Enable_SPC_Cancel
# Turns Off Savepoint Return
@savepoint_return = false
end
#--------------------------------------------------------------------------
# * Savepoint Commands
#--------------------------------------------------------------------------
def savepoint_commands
# Removes Duplicate Disabled Commands
@disabled_sp_commands.uniq
# Sets Up Commands
isp = ISP_System
c = []
# Passes Through All Savepoint Commands
[isp::SPC_Save, isp::SPC_Load, isp::SPC_Menu, isp::SPC_Shutdown,
isp::SPC_Cancel].each do |command|
# If Show Disabled Commands or Not Disabled
if isp::Show_Disabled_Commands
# Add Command
c << command
else
c << command unless @disabled_sp_commands.include?(command)
end
end
# Returns Commands
return c
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :disable_player_movement
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
if @seph_ispsystem_gmplyr.nil?
alias seph_ispsystem_gameplayer_init initialize
alias seph_ispsystem_gameplayer_upm update_player_movement
alias seph_ispsystem_gameplayer_uat update_action_trigger
@seph_ispsystem_gmplyr = true
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Turns Off Disable Movement
@disable_player_movement = false
# Original Initialization
seph_ispsystem_gameplayer_init
end
#--------------------------------------------------------------------------
# * Player Movement Update
#--------------------------------------------------------------------------
def update_player_movement
# Original Update Player Movement Unless Movement Disabled
seph_ispsystem_gameplayer_upm unless @disable_player_movement
end
#--------------------------------------------------------------------------
# * Update Action Trigger
#--------------------------------------------------------------------------
def update_action_trigger
# Original Update Player AT Unless Movement Disabled
seph_ispsystem_gameplayer_uat unless @disable_player_movement
end
end
#=========================================================================
# ** Window_InnGold
#=========================================================================
class Window_InnGold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(cost)
super(640, 368, 320, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 160
@cost = cost
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, contents.width, 32, 'Current Gold:')
self.contents.font.color = normal_color
self.contents.draw_text(- 4, 0, contents.width, 32,
$game_party.gold.to_s, 2)
self.contents.font.color = $game_party.gold >= @cost ?
text_color(1) : text_color(2)
self.contents.draw_text(4, 32, contents.width, 32, 'Cost to stay:')
self.contents.draw_text(- 4, 32, contents.width, 32, @cost.to_s, 2)
end
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_ispsystem_stitle_main main
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If Game_System Exist
unless $game_system.nil?
# If Savepint Return
if $game_system.savepoint_return
# Fetches Index of Load Command
index = $game_system.savepoint_commands.index(ISP_System::SPC_Load)
# Returns To Savepoint Scene
$scene = Scene_Savepoint.new(false, index)
# Turn Savepoint Return Flag Off
$game_system.savepoint_return = false
return
end
end
# Original Main Method
seph_ispsystem_stitle_main
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_ispsystem_smap_main main
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If Savepoint Return
if $game_system.savepoint_return
# Fetches Menu Command Index
index = $game_system.savepoint_commands.index(ISP_System::SPC_Menu)
# Switches to Savepoint Scene
$scene = Scene_Savepoint.new(false, index)
# Turns off Savepoint Return flag
$game_system.savepoint_return = false
return
end
# Original Main Method
seph_ispsystem_smap_main
end
end
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_ispsystem_smenu_main main
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If Savepoint Return
if $game_system.savepoint_return
# Branch By Menu Index
case @menu_index
when 4 # Save
# Fetches Save Command Index
index = $game_system.savepoint_commands.index(ISP_System::SPC_Save)
# Switches to Savepoint Scene
$scene = Scene_Savepoint.new(false, index)
# Turns Savepoint Return Flag Off
$game_system.savepoint_return = false
return
when 5 # End Game
# Fetches Save Command Index
index = $game_system.savepoint_commands.index(
ISP_System::SPC_Shutdown)
# Switches to Savepoint Scene
$scene = Scene_Savepoint.new(false, index)
# Turns Savepoint Return Flag Off
$game_system.savepoint_return = false
return
end
end
# Original Main Method
seph_ispsystem_smenu_main
end
end
#==============================================================================
# ** Scene_Savepoint
#==============================================================================
class Scene_Savepoint < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(animation = true, index = 0)
@animation, @index = animation, index
end
#--------------------------------------------------------------------------
# * Main Processing : Spriteset Initialization
#--------------------------------------------------------------------------
def main_spriteset
# Creates Map Spriteset
@spriteset = Spriteset_Map.new
end
#--------------------------------------------------------------------------
# * Main Processing : Window Initialization
#--------------------------------------------------------------------------
def main_window
# Creates Help Window
@help_window = Window_Help.new
@help_window.y = @animation ? - 64 : 0
@help_window.opacity = 160
@help_window.set_text('What Would You like to Do?', 1)
# Creates Gold Window
@gold_window = Window_Gold.new
@gold_window.x = 16
@gold_window.y = @animation ? 480 : 400
@gold_window.opacity = 160
# Creates Steps Window
@steps_window = Window_Steps.new
@steps_window.x = 464
@steps_window.y = @animation ? 480 : 368
@steps_window.opacity = 160
# Creates Command Window
@command_window = Window_Command.new(256, $game_system.savepoint_commands)
@command_window.x = 192
@command_window.y = @animation ? 480 : 144
@command_window.opacity = 160
@command_window.height = 192
@command_window.index = @index
# If Show Disabld Commands
if ISP_System::Show_Disabled_Commands
# Passes Through All Commands
isp = ISP_System
[isp::SPC_Save, isp::SPC_Load, isp::SPC_Menu, isp::SPC_Shutdown,
isp::SPC_Cancel].each do |command|
# If Command Included
if $game_system.savepoint_commands.include?(command)
# If Command Disabled
if $game_system.disabled_sp_commands.include?(command)
# Disable Command From Window
index = $game_system.savepoint_commands.index(command)
@command_window.disable_command(index)
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Main Update
if @command_window.active
update_main
return
end
# Update Exit
update_exit
end
#--------------------------------------------------------------------------
# * Frame Update : Main
#--------------------------------------------------------------------------
def update_main
# Moves In Windows
@help_window.y += 4 if @help_window.y < 0
@gold_window.y -= 5 if @gold_window.y > 400
@steps_window.y -= 7 if @steps_window.y > 368
@command_window.y -= 21 if @command_window.y > 144
# If B button is Pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Turns off Confirmation Window
@command_window.active = false
return
end
# If C button is pressed
if Input.trigger?(Input::C)
# Gets Command
command = $game_system.savepoint_commands[@command_window.index]
# If Command Disabled
if $game_system.disabled_sp_commands.include?(command)
# Play busser SE
$game_system.se_play($data_system.buzzer_se)
# Sets Help Text
@help_window.set_text(command + ' has been disabled.', 1)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Turns On Savepoint Return
$game_system.savepoint_return = true
# Branch Point for command
case command
when ISP_System::SPC_Save
# Scene Change
$scene = Scene_Save.new
return
when ISP_System::SPC_Load
# Scene Change
$scene = Scene_Load.new
return
when ISP_System::SPC_Menu
# Scene Change
$scene = Scene_Menu.new
return
when ISP_System::SPC_Shutdown
# Scene Change
$scene = Scene_End.new
return
when ISP_System::SPC_Cancel
# Turns Off Savepoint Return
$game_system.savepoint_return = false
# Turns off Confirmation Window
@command_window.active = false
return
end
end
end
#--------------------------------------------------------------------------
# * Frame Update : Exit
#--------------------------------------------------------------------------
def update_exit
# Moves Out Windows
@help_window.y -= 4 if @help_window.y > - 64
@gold_window.y += 5 if @gold_window.y < 480
@steps_window.y += 7 if @steps_window.y < 480
@command_window.y += 21 if @command_window.y < 480
# When Finished Moving Windows
unless @help_window.y > - 64
# Changes to Scene Map
$scene = Scene_Map.new
end
end
end
#==============================================================================
# ** Scene_Inn
#==============================================================================
class Scene_Inn < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(inn = Game_Inn.new)
@inn = inn
end
#--------------------------------------------------------------------------
# * Main Processing : Variable Initialization
#--------------------------------------------------------------------------
def main_variable
# Disables Player Movements
$game_player.disable_player_movement = true
end
#--------------------------------------------------------------------------
# * Main Processing : Spriteset Initialization
#--------------------------------------------------------------------------
def main_spriteset
# Creates Map Spriteset
@spriteset = Spriteset_Map.new
end
#--------------------------------------------------------------------------
# * Main Processing : Window Initialization
#--------------------------------------------------------------------------
def main_window
# Creates Help Window
@help_window = Window_Help.new
@help_window.width = 604
@help_window.contents = Bitmap.new(572, 32)
@help_window.x = 16
@help_window.y = - 64
@help_window.opacity = 160
@help_window.set_text(@inn.greeting, 1)
# Creates Confirmation Window
@confirmation_window = Window_Command.new(160, ['Yes', 'No'])
@confirmation_window.x = - 160
@confirmation_window.y = 368
@confirmation_window.opacity = 160
# Creates Gold Window
@gold_window = Window_InnGold.new(@inn.cost)
end
#--------------------------------------------------------------------------
# * Main Processing : Ending
#--------------------------------------------------------------------------
def main_end
# Enables Player Movements
$game_player.disable_player_movement = false
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update Player & Screen
$game_player.update
$game_screen.update
$game_map.update
# If Confirmation Window Active
if @confirmation_window.active
update_main
return
# If Phase is 'Staying'
elsif @phase == 'Staying'
update_staying
return
# If Phase is 'Stay Exit'
elsif @phase == 'Stay Exit'
update_stay_exit
return
# If Phase is 'Exit'
elsif @phase == 'Exit'
update_exit
return
end
end
#--------------------------------------------------------------------------
# * Frame Update: Main
#--------------------------------------------------------------------------
def update_main
# Moves In Windows
@help_window.y += 10 if @help_window.y < 16
@confirmation_window.x += 22 if @confirmation_window.x < 16
@gold_window.x -= 42 if @gold_window.x > 304
# If B button is pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Set Help Text
@help_window.set_text(@inn.exit, 1)
# Turns off Confirmation Window
@confirmation_window.active = false
# Turns to Exit Phase
@phase = 'Exit'
return
end
# If C button is pressed
if Input.trigger?(Input::C)
# If No
if @confirmation_window.index == 1
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Set Help Text
@help_window.set_text(@inn.exit, 1)
# Turns off Confirmation Window
@confirmation_window.active = false
# Turns to Exit Phase
@phase = 'Exit'
return
end
# Checks Gold
if $game_party.gold < @inn.cost
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
# Set Help Text
@help_window.set_text("Not Enought #{$data_system.words.gold}", 1)
return
end
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Recovers Actors
$game_party.actors.each {|actor| actor.recover_all}
# Sets Help Window Text
@help_window.set_text(@inn.staying, 1)
# Lose Gold
$game_party.lose_gold(@inn.cost)
# Refresh Gold Window
@gold_window.refresh
# Stores Player Location
@temp_loc = [$game_player.x, $game_player.y]
# Starts Frame Counting
@stay_frame_count = 0
# Moves Player to Bedroom
unless @inn.transfer.nil?
# Moves Player to Bedroom
$game_player.find_path(@inn.transfer[0], @inn.transfer[1])
end
# Starts Screen Fading Out
$game_screen.start_tone_change(Tone.new(-255, -255, -255, 0), 50)
# Turns off Confirmation Window
@confirmation_window.active = false
# Turns Phase to Staying
@phase = 'Staying'
# If Gameover to Inn System Found
if SDK.state('Gameover to Inn')
# If Save Gameover to Inn Location
if ISP_System::Save_GO_To_Inn
$game_system.gameover_return_parameters[0] = $game_map.map_id
$game_system.gameover_return_parameters[1] = $game_player.x
$game_system.gameover_return_parameters[2] = $game_player.y
$game_system.gameover_return_parameters[3] = $game_player.direction
end
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update: Staying
#--------------------------------------------------------------------------
def update_staying
# Move Out Windows
@help_window.y -= 10 if @help_window.y > - 64
@confirmation_window.x -= 22 if @confirmation_window.x > - 160
@gold_window.x += 42 if @gold_window.x < 640
# Counts Frames
@stay_frame_count += 1
# If Stay is Complete
if @stay_frame_count == 100
# Sets Help Text
@help_window.set_text(@inn.thanks, 1)
# Starts Screen Fading Out
$game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20)
# Moves Player Out of Bedroom
unless @inn.transfer.nil?
# Moves Player to Bedroom
$game_player.find_path(@temp_loc[0], @temp_loc[1])
end
# Turns Phase to Stay Exit
@phase = 'Stay Exit'
end
end
#--------------------------------------------------------------------------
# * Frame Update: Stay Exit
#--------------------------------------------------------------------------
def update_stay_exit
# Moves In Windows
@help_window.y += 10 if @help_window.y < 16
@gold_window.x -= 42 if @gold_window.x > 304
# Player Movement Finished
if $game_player.x == @temp_loc[0] && $game_player.y == @temp_loc[1]
# Set Help Text
@help_window.set_text(@inn.exit, 1)
# Window Finished Movement
if @help_window.x == 16 && @gold_window.x == 304
# If B or C is pressed
if Input.trigger?(Input::B) || Input.trigger?(Input::C)
# Play Decision SE
$game_system.se_play($data_system.cancel_se)
# Turns Phase to Exit
@phase = 'Exit'
return
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update: Stay Exit
#--------------------------------------------------------------------------
def update_exit
# Move Windows
@help_window.y -= 10 if @help_window.y > - 64
@confirmation_window.x -= 22 if @confirmation_window.x > - 160
@gold_window.x += 42 if @gold_window.x < 640
# Exit Scene
unless @help_window.y > - 64
# Transfers To Map Scene
$scene = Scene_Map.new
end
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
can someone tell me how to insert it and explain how to customize it... im terrible with scripts, i prefer the ones that come with demos lol.
and also with the ATES script... how to i make the clock go at a realistic rate, not 40 minutes in one second :D
sorry about the length btw, cant remember how to do spoilers :S
EDIT: Got ATES workin fine, but on the inn & savepoint one i get
"Script 'Inn and Savepoint' line 439: Type error occured. undefined superclass 'Scene_Base'"
Line 439:
:S confussion!! any ideas anyone?
Edited by Vintage_LolkatsShare this post
Link to post
Share on other sites