Hey guys!
I'm just wondering can you guys combine these 2 scripts for me? They don't seem to be compatible
This Custom Save Scripts
And the Better Title Screen Script by SephirothSpawn
I'm just wondering can you guys combine these 2 scripts for me? They don't seem to be compatible
This Custom Save Scripts
#---------------------
# Personal Save Files
# By: Polraudio
# Credits: Polraudio, RPG Advocate, Cybersam
# Version: 1.0
#---------------------
=begin
#----------------------------------------------------
Features:
- Allows you to have up to Unlimited save files
- You can have a name for your save files
Instructions:
Place above main
Contact:
If you have any questions or comments you can find me
at www.rmxpunlimited.net(Best Method)
Or email me polraudio@gmail.com
=end
class Window_SaveFile < Window_Base
# -------------------
def initialize(file_index, filename, position)
y = 64 + position * 104
super(0, y, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
@file_index = file_index
@filename = "Save#{@file_index + 1}." + $savename
@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
def refresh
self.contents.clear
self.contents.font.color = normal_color
name = "Record #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
if @file_exist
for i in 0...@characters.size
bitmap = RPG::Cache.character(@characters[0], @characters[1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
def selected=(selected)
@selected = selected
update_cursor_rect
end
def update_cursor_rect
if @selected
self.cursor_rect.set(0, 0, @name_width + 8, 32)
else
self.cursor_rect.empty
end
end
end
class Scene_File
SAVEFILE_MAX = 99
# -------------------
def initialize(help_text)
@help_text = help_text
end
# -------------------
def main
@help_window = Window_Help.new
@help_window.set_text(@help_text)
@savefile_windows = []
@cursor_displace = 0
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
end
@file_index = 0
@savefile_windows[@file_index].selected = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
for i in @savefile_windows
i.dispose
end
end
# -------------------
def update
@help_window.update
for i in @savefile_windows
i.update
end
if Input.trigger?(Input::C)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
if Input.trigger?(Input::B)
on_cancel
return
end
if Input.repeat?(Input::DOWN)
if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
if @file_index == SAVEFILE_MAX - 1
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace += 1
if @cursor_displace == 4
@cursor_displace = 3
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 2 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows.selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + 1)
if @file_index == SAVEFILE_MAX
@file_index = SAVEFILE_MAX - 1
end
for i in 0..3
@savefile_windows.selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
if Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @file_index > 0
if @file_index == 0
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace -= 1
if @cursor_displace == -1
@cursor_displace = 0
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 1 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows.selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index - 1)
if @file_index == -1
@file_index = 0
end
for i in 0..3
@savefile_windows.selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
end
def make_filename(file_index)
return "Save#{file_index + 1}." + $savename
end
end
class Scene_Save < Scene_File
def initialize
super("Which file would you like to save to?")
end
def on_decision(filename)
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
end
def on_cancel
$game_system.se_play($data_system.cancel_se)
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
end
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
characters.push([actor.character_name, actor.character_hue])
end
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
$game_system.save_count += 1
$game_system.magic_number = $data_system.magic_number
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_script_var, file)
Marshal.dump($game_script_swi, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
class Scene_Load < Scene_File
def initialize
$game_temp = Game_Temp.new
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end
def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end
def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
end
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_script_var = Marshal.load(file)
$game_script_swi = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end
class Scene_Title
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Shutdown"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
def command_new_game
$game_system.se_play($data_system.decision_se)
data = []
top_text = "Please create a name for your saves"
text = ""
font = "Arial"
max = 9
size = 24
$savename = Text_input.new(top_text, text, font, max, size).text
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
def command_continue
$game_system.se_play($data_system.decision_se)
data = []
top_text = "Please type your save name"
text = ""
font = "Arial"
max = 9
size = 24
$savename = Text_input.new(top_text, text, font, max, size).text
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load.new
end
def command_shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
end
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end
#======================================
# â– Keyboard Script
#---------------------------------------------------------------------------
#  By: Cybersam
# Date: 25/05/05
# Version 4
#======================================
# How to use
# if Kboard.keyboard($R_Key_A)
#
module Kboard
#--------------------------------------------------------------------------
$RMouse_BUTTON_L = 0x01 # left mouse button
$RMouse_BUTTON_R = 0x02 # right mouse button
$RMouse_BUTTON_M = 0x04 # middle mouse button
$RMouse_BUTTON_4 = 0x05 # 4th mouse button
$RMouse_BUTTON_5 = 0x06 # 5th mouse button
#--------------------------------------------------------------------------
$R_Key_BACK = 0x08 # BACKSPACE key
$R_Key_TAB = 0x09 # TAB key
$R_Key_RETURN = 0x0D # ENTER key
$R_Key_SHIFT = 0x10 # SHIFT key
$R_Key_CTLR = 0x11 # CTLR key
$R_Key_ALT = 0x12 # ALT key
$R_Key_PAUSE = 0x13 # PAUSE key
$R_Key_CAPITAL = 0x14 # CAPS LOCK key
$R_Key_ESCAPE = 0x1B # ESC key
$R_Key_SPACE = 0x20 # SPACEBAR
$R_Key_PRIOR = 0x21 # PAGE UP key
$R_Key_NEXT = 0x22 # PAGE DOWN key
$R_Key_END = 0x23 # END key
$R_Key_HOME = 0x24 # HOME key
$R_Key_LEFT = 0x25 # LEFT ARROW key
$R_Key_UP = 0x26 # UP ARROW key
$R_Key_RIGHT = 0x27 # RIGHT ARROW key
$R_Key_DOWN = 0x28 # DOWN ARROW key
$R_Key_SELECT = 0x29 # SELECT key
$R_Key_PRINT = 0x2A # PRINT key
$R_Key_SNAPSHOT = 0x2C # PRINT SCREEN key
$R_Key_INSERT = 0x2D # INS key
$R_Key_DELETE = 0x2E # DEL key
#--------------------------------------------------------------------------
$R_Key_0 = 0x30 # 0 key
$R_Key_1 = 0x31 # 1 key
$R_Key_2 = 0x32 # 2 key
$R_Key_3 = 0x33 # 3 key
$R_Key_4 = 0x34 # 4 key
$R_Key_5 = 0x35 # 5 key
$R_Key_6 = 0x36 # 6 key
$R_Key_7 = 0x37 # 7 key
$R_Key_8 = 0x38 # 8 key
$R_Key_9 = 0x39 # 9 key
#--------------------------------------------------------------------------
$R_Key_A = 0x41 # A key
$R_Key_B = 0x42 # B key
$R_Key_C = 0x43 # C key
$R_Key_D = 0x44 # D key
$R_Key_E = 0x45 # E key
$R_Key_F = 0x46 # F key
$R_Key_G = 0x47 # G key
$R_Key_H = 0x48 # H key
$R_Key_I = 0x49 # I key
$R_Key_J = 0x4A # J key
$R_Key_K = 0x4B # K key
$R_Key_L = 0x4C # L key
$R_Key_M = 0x4D # M key
$R_Key_N = 0x4E # N key
$R_Key_O = 0x4F # O key
$R_Key_P = 0x50 # P key
$R_Key_Q = 0x51 # Q key
$R_Key_R = 0x52 # R key
$R_Key_S = 0x53 # S key
$R_Key_T = 0x54 # T key
$R_Key_U = 0x55 # U key
$R_Key_V = 0x56 # V key
$R_Key_W = 0x57 # W key
$R_Key_X = 0x58 # X key
$R_Key_Y = 0x59 # Y key
$R_Key_Z = 0x5A # Z key
#--------------------------------------------------------------------------
$R_Key_LWIN = 0x5B # Left Windows key (Microsoft Natural keyboard)
$R_Key_RWIN = 0x5C # Right Windows key (Natural keyboard)
$R_Key_APPS = 0x5D # Applications key (Natural keyboard)
#--------------------------------------------------------------------------
$R_Key_NUMPAD0 = 0x60 # Numeric keypad 0 key
$R_Key_NUMPAD1 = 0x61 # Numeric keypad 1 key
$R_Key_NUMPAD2 = 0x62 # Numeric keypad 2 key
$R_Key_NUMPAD3 = 0x63 # Numeric keypad 3 key
$R_Key_NUMPAD4 = 0x64 # Numeric keypad 4 key
$R_Key_NUMPAD5 = 0x65 # Numeric keypad 5 key
$R_Key_NUMPAD6 = 0x66 # Numeric keypad 6 key
$R_Key_NUMPAD7 = 0x67 # Numeric keypad 7 key
$R_Key_NUMPAD8 = 0x68 # Numeric keypad 8 key
$R_Key_NUMPAD9 = 0x69 # Numeric keypad 9 key
$R_Key_MULTIPLY = 0x6A # Multiply key (*)
$R_Key_ADD = 0x6B # Add key (+)
$R_Key_SEPARATOR = 0x6C # Separator key
$R_Key_SUBTRACT = 0x6D # Subtract key (-)
$R_Key_DECIMAL = 0x6E # Decimal key
$R_Key_DIVIDE = 0x6F # Divide key (/)
#--------------------------------------------------------------------------
$R_Key_F1 = 0x70 # F1 key
$R_Key_F2 = 0x71 # F2 key
$R_Key_F3 = 0x72 # F3 key
$R_Key_F4 = 0x73 # F4 key
$R_Key_F5 = 0x74 # F5 key
$R_Key_F6 = 0x75 # F6 key
$R_Key_F7 = 0x76 # F7 key
$R_Key_F8 = 0x77 # F8 key
$R_Key_F9 = 0x78 # F9 key
$R_Key_F10 = 0x79 # F10 key
$R_Key_F11 = 0x7A # F11 key
$R_Key_F12 = 0x7B # F12 key
#--------------------------------------------------------------------------
$R_Key_NUMLOCK = 0x90 # NUM LOCK key
$R_Key_SCROLL = 0x91 # SCROLL LOCK key
#--------------------------------------------------------------------------
$R_Key_LSHIFT = 0xA0 # Left SHIFT key
$R_Key_RSHIFT = 0xA1 # Right SHIFT key
$R_Key_LCONTROL = 0xA2 # Left CONTROL key
$R_Key_RCONTROL = 0xA3 # Right CONTROL key
$R_Key_L_ALT = 0xA4 # Left ALT key
$R_Key_R_ALT = 0xA5 # Right ALT key
#--------------------------------------------------------------------------
$R_Key_SEP = 0xBC # , key
$R_Key_DASH = 0xBD # - key
$R_Key_DOTT = 0xBE # . key
#--------------------------------------------------------------------------
GetKeyState = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
GetKeyboardState = Win32API.new("user32","GetKeyState",['i'],'i')
GetSetKeyState = Win32API.new("user32","SetKeyboardState",['i'],'i')
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
def keyb(rkey)
if GetKeyState.call(rkey) != 0
return 1
end
return 0
end
#--------------------------------------------------------------------------
def keyboard(rkey)
GetKeyState.call(rkey) & 0x01 == 1 #
end
#--------------------------------------------------------------------------
def key(rkey, key = 0)
GetKeyboardState.call(rkey) & 0x01 == key #
end
end
#===============================================================================
#
# Text-Input Script v1 created by: cybersam
#
# hi boys and ladys.... and whatever else ^-^
#
# here comes the script that allows you to insert text with the keyboard
# in your game... ^-^
#
# i didnt make it work with the default name edit/input script
# but with this it should be easier for you guys to do it...
# the reason ?!.. i said it already in other scripts... ^-^
#
# "i dont wana do a complete script that you can post in your games and it works
# without a single modification"...
#
# since there are people here that just dont even wont try to learn ruby...
# this script works perfect of its own....
# but it wont let you edit the character name without modification...
# so go on and try it out...
#
# if you need help to edit something just ask...
# i would gladly help but i wont do all the work for you...
#
# thats it from my side...
# as for now... this will be the last update
# for this script (keyboard/mouse script) from my side...
# if you find any bugs please contact me... you should already now how... ^-^
# and dont tell me "there is a bug in you script!"
# that alone is not enough... ^-^
#
# cya all ^-^
# sam
#
#===============================================================================
class Text_input < Window_Base
def initialize(top_text = "Here comes the new Version of the keyboard script", text = "Keyboad - Script v3", font = "Arial", max = 20, size = 16, free = "_")
@toptext = top_text
@text = text
@font = font
@max = max
@size = size
@free = free
super(320 - (@max*@size+@size)/2, 240-@size*2-32, @max * @size + 32, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = @font
self.contents.font.size = @size
self.z = 256
@twidth = @max*@size
refresh
update
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, @twidth, @size, @toptext, 1)
for i in 0...@max
text = @text
if text == nil
text = @free
else
text = text.chr
end
self.contents.font.color = normal_color
self.contents.draw_text(@size * i, @size + 24, @size, @size, text, 1)
end
end
def update
loop do
Graphics.update
refresh
if Kboard.keyboard($R_Key_BACK) # delete (with backspace)
text = ""
if @text.size != 0
for i in 0...@text.size - 1
text += @text.chr
end
@text = text
else
end
end
if Kboard.keyboard($R_Key_RETURN) # Enter key... to end...
#$game_variables[1]=@text
return
end
if @text.size < @max
# putting Key's to the text
if Kboard.keyboard($R_Key_SPACE) # space key (to insert space between the chars... ^-^)
@text += " " # space.. you can set anything else if you want ^-^'
end
if Kboard.key($R_Key_CAPITAL, 1) # if caps lock is active then write the chars in higher case
if Kboard.keyboard($R_Key_A)
@text += "A"
end
if Kboard.keyboard($R_Key_B)
@text += "B"
end
if Kboard.keyboard($R_Key_C)
@text += "C"
end
if Kboard.keyboard($R_Key_D)
@text += "D"
end
if Kboard.keyboard($R_Key_E)
@text += "E"
end
if Kboard.keyboard($R_Key_F)
@text += "F"
end
if Kboard.keyboard($R_Key_G)
@text += "G"
end
if Kboard.keyboard($R_Key_H)
@text += "H"
end
if Kboard.keyboard($R_Key_I)
@text += "I"
end
if Kboard.keyboard($R_Key_J)
@text += "J"
end
if Kboard.keyboard($R_Key_K)
@text += "K"
end
if Kboard.keyboard($R_Key_L)
@text += "L"
end
if Kboard.keyboard($R_Key_M)
@text += "M"
end
if Kboard.keyboard($R_Key_N)
@text += "N"
end
if Kboard.keyboard($R_Key_O)
@text += "O"
end
if Kboard.keyboard($R_Key_P)
@text += "P"
end
if Kboard.keyboard($R_Key_Q)
@text += "Q"
end
if Kboard.keyboard($R_Key_R)
@text += "R"
end
if Kboard.keyboard($R_Key_S)
@text += "S"
end
if Kboard.keyboard($R_Key_T)
@text += "T"
end
if Kboard.keyboard($R_Key_U)
@text += "U"
end
if Kboard.keyboard($R_Key_V)
@text += "V"
end
if Kboard.keyboard($R_Key_W)
@text += "W"
end
if Kboard.keyboard($R_Key_X)
@text += "X"
end
if Kboard.keyboard($R_Key_Y)
@text += "Y"
end
if Kboard.keyboard($R_Key_Z)
@text += "Z"
end
elsif Kboard.key($R_Key_CAPITAL) # if caps lock is deactivated then write in lower case
if Kboard.keyboard($R_Key_A)
@text += "a"
end
if Kboard.keyboard($R_Key_B)
@text += "b"
end
if Kboard.keyboard($R_Key_C)
@text += "c"
end
if Kboard.keyboard($R_Key_D)
@text += "d"
end
if Kboard.keyboard($R_Key_E)
@text += "e"
end
if Kboard.keyboard($R_Key_F)
@text += "f"
end
if Kboard.keyboard($R_Key_G)
@text += "g"
end
if Kboard.keyboard($R_Key_H)
@text += "h"
end
if Kboard.keyboard($R_Key_I)
@text += "i"
end
if Kboard.keyboard($R_Key_J)
@text += "j"
end
if Kboard.keyboard($R_Key_K)
@text += "k"
end
if Kboard.keyboard($R_Key_L)
@text += "l"
end
if Kboard.keyboard($R_Key_M)
@text += "m"
end
if Kboard.keyboard($R_Key_N)
@text += "n"
end
if Kboard.keyboard($R_Key_O)
@text += "o"
end
if Kboard.keyboard($R_Key_P)
@text += "p"
end
if Kboard.keyboard($R_Key_Q)
@text += "q"
end
if Kboard.keyboard($R_Key_R)
@text += "r"
end
if Kboard.keyboard($R_Key_S)
@text += "s"
end
if Kboard.keyboard($R_Key_T)
@text += "t"
end
if Kboard.keyboard($R_Key_U)
@text += "u"
end
if Kboard.keyboard($R_Key_V)
@text += "v"
end
if Kboard.keyboard($R_Key_W)
@text += "w"
end
if Kboard.keyboard($R_Key_X)
@text += "x"
end
if Kboard.keyboard($R_Key_Y)
@text += "y"
end
if Kboard.keyboard($R_Key_Z)
@text += "z"
end
end
# numbers
if Kboard.keyboard($R_Key_0)
@text += "0"
end
if Kboard.keyboard($R_Key_1)
@text += "1"
end
if Kboard.keyboard($R_Key_2)
@text += "2"
end
if Kboard.keyboard($R_Key_3)
@text += "3"
end
if Kboard.keyboard($R_Key_4)
@text += "4"
end
if Kboard.keyboard($R_Key_5)
@text += "5"
end
if Kboard.keyboard($R_Key_6)
@text += "6"
end
if Kboard.keyboard($R_Key_7)
@text += "7"
end
if Kboard.keyboard($R_Key_8)
@text += "8"
end
if Kboard.keyboard($R_Key_9)
@text += "9"
end
# numpad
if Kboard.keyboard($R_Key_NUMPAD0)
@text += "0"
end
if Kboard.keyboard($R_Key_NUMPAD1)
@text += "1"
end
if Kboard.keyboard($R_Key_NUMPAD2)
@text += "2"
end
if Kboard.keyboard($R_Key_NUMPAD3)
@text += "3"
end
if Kboard.keyboard($R_Key_NUMPAD4)
@text += "4"
end
if Kboard.keyboard($R_Key_NUMPAD5)
@text += "5"
end
if Kboard.keyboard($R_Key_NUMPAD6)
@text += "6"
end
if Kboard.keyboard($R_Key_NUMPAD7)
@text += "7"
end
if Kboard.keyboard($R_Key_NUMPAD8)
@text += "8"
end
if Kboard.keyboard($R_Key_NUMPAD9)
@text += "9"
end
if Kboard.keyboard($R_Key_ADD) # + (numpad)
@text += "+"
end
if Kboard.keyboard($R_Key_SUBTRACT) # - (numpad)
@text += "-"
end
if Kboard.keyboard($R_Key_DIVIDE) # / (numpad)
@text += "/"
end
if Kboard.keyboard($R_Key_MULTIPLY) # * (numpad)
@text += "*"
end
if Kboard.key($R_Key_CAPITAL) # since i dont want to change my keyboard layout you need to test it for you'r self...
if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
@text += ","
end
if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
@text += "-"
end
if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
@text += "."
end
elsif Kboard.key($R_Key_CAPITAL, 1)
if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
@text += ";"
end
if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
@text += "_"
end
if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
@text += ":"
end
end
else
end
refresh
end
end
def text()
self.contents.dispose
self.dispose
return @text
end
end
# Personal Save Files
# By: Polraudio
# Credits: Polraudio, RPG Advocate, Cybersam
# Version: 1.0
#---------------------
=begin
#----------------------------------------------------
Features:
- Allows you to have up to Unlimited save files
- You can have a name for your save files
Instructions:
Place above main
Contact:
If you have any questions or comments you can find me
at www.rmxpunlimited.net(Best Method)
Or email me polraudio@gmail.com
=end
class Window_SaveFile < Window_Base
# -------------------
def initialize(file_index, filename, position)
y = 64 + position * 104
super(0, y, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
@file_index = file_index
@filename = "Save#{@file_index + 1}." + $savename
@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
def refresh
self.contents.clear
self.contents.font.color = normal_color
name = "Record #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
if @file_exist
for i in 0...@characters.size
bitmap = RPG::Cache.character(@characters[0], @characters[1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
def selected=(selected)
@selected = selected
update_cursor_rect
end
def update_cursor_rect
if @selected
self.cursor_rect.set(0, 0, @name_width + 8, 32)
else
self.cursor_rect.empty
end
end
end
class Scene_File
SAVEFILE_MAX = 99
# -------------------
def initialize(help_text)
@help_text = help_text
end
# -------------------
def main
@help_window = Window_Help.new
@help_window.set_text(@help_text)
@savefile_windows = []
@cursor_displace = 0
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
end
@file_index = 0
@savefile_windows[@file_index].selected = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
for i in @savefile_windows
i.dispose
end
end
# -------------------
def update
@help_window.update
for i in @savefile_windows
i.update
end
if Input.trigger?(Input::C)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
if Input.trigger?(Input::B)
on_cancel
return
end
if Input.repeat?(Input::DOWN)
if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
if @file_index == SAVEFILE_MAX - 1
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace += 1
if @cursor_displace == 4
@cursor_displace = 3
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 2 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows.selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + 1)
if @file_index == SAVEFILE_MAX
@file_index = SAVEFILE_MAX - 1
end
for i in 0..3
@savefile_windows.selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
if Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @file_index > 0
if @file_index == 0
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace -= 1
if @cursor_displace == -1
@cursor_displace = 0
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 1 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows.selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index - 1)
if @file_index == -1
@file_index = 0
end
for i in 0..3
@savefile_windows.selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
end
def make_filename(file_index)
return "Save#{file_index + 1}." + $savename
end
end
class Scene_Save < Scene_File
def initialize
super("Which file would you like to save to?")
end
def on_decision(filename)
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
end
def on_cancel
$game_system.se_play($data_system.cancel_se)
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(4)
end
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
characters.push([actor.character_name, actor.character_hue])
end
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
$game_system.save_count += 1
$game_system.magic_number = $data_system.magic_number
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_script_var, file)
Marshal.dump($game_script_swi, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
class Scene_Load < Scene_File
def initialize
$game_temp = Game_Temp.new
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end
def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end
def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
end
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_script_var = Marshal.load(file)
$game_script_swi = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end
class Scene_Title
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Shutdown"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
def command_new_game
$game_system.se_play($data_system.decision_se)
data = []
top_text = "Please create a name for your saves"
text = ""
font = "Arial"
max = 9
size = 24
$savename = Text_input.new(top_text, text, font, max, size).text
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
def command_continue
$game_system.se_play($data_system.decision_se)
data = []
top_text = "Please type your save name"
text = ""
font = "Arial"
max = 9
size = 24
$savename = Text_input.new(top_text, text, font, max, size).text
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load.new
end
def command_shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
end
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end
#======================================
# â– Keyboard Script
#---------------------------------------------------------------------------
#  By: Cybersam
# Date: 25/05/05
# Version 4
#======================================
# How to use
# if Kboard.keyboard($R_Key_A)
#
module Kboard
#--------------------------------------------------------------------------
$RMouse_BUTTON_L = 0x01 # left mouse button
$RMouse_BUTTON_R = 0x02 # right mouse button
$RMouse_BUTTON_M = 0x04 # middle mouse button
$RMouse_BUTTON_4 = 0x05 # 4th mouse button
$RMouse_BUTTON_5 = 0x06 # 5th mouse button
#--------------------------------------------------------------------------
$R_Key_BACK = 0x08 # BACKSPACE key
$R_Key_TAB = 0x09 # TAB key
$R_Key_RETURN = 0x0D # ENTER key
$R_Key_SHIFT = 0x10 # SHIFT key
$R_Key_CTLR = 0x11 # CTLR key
$R_Key_ALT = 0x12 # ALT key
$R_Key_PAUSE = 0x13 # PAUSE key
$R_Key_CAPITAL = 0x14 # CAPS LOCK key
$R_Key_ESCAPE = 0x1B # ESC key
$R_Key_SPACE = 0x20 # SPACEBAR
$R_Key_PRIOR = 0x21 # PAGE UP key
$R_Key_NEXT = 0x22 # PAGE DOWN key
$R_Key_END = 0x23 # END key
$R_Key_HOME = 0x24 # HOME key
$R_Key_LEFT = 0x25 # LEFT ARROW key
$R_Key_UP = 0x26 # UP ARROW key
$R_Key_RIGHT = 0x27 # RIGHT ARROW key
$R_Key_DOWN = 0x28 # DOWN ARROW key
$R_Key_SELECT = 0x29 # SELECT key
$R_Key_PRINT = 0x2A # PRINT key
$R_Key_SNAPSHOT = 0x2C # PRINT SCREEN key
$R_Key_INSERT = 0x2D # INS key
$R_Key_DELETE = 0x2E # DEL key
#--------------------------------------------------------------------------
$R_Key_0 = 0x30 # 0 key
$R_Key_1 = 0x31 # 1 key
$R_Key_2 = 0x32 # 2 key
$R_Key_3 = 0x33 # 3 key
$R_Key_4 = 0x34 # 4 key
$R_Key_5 = 0x35 # 5 key
$R_Key_6 = 0x36 # 6 key
$R_Key_7 = 0x37 # 7 key
$R_Key_8 = 0x38 # 8 key
$R_Key_9 = 0x39 # 9 key
#--------------------------------------------------------------------------
$R_Key_A = 0x41 # A key
$R_Key_B = 0x42 # B key
$R_Key_C = 0x43 # C key
$R_Key_D = 0x44 # D key
$R_Key_E = 0x45 # E key
$R_Key_F = 0x46 # F key
$R_Key_G = 0x47 # G key
$R_Key_H = 0x48 # H key
$R_Key_I = 0x49 # I key
$R_Key_J = 0x4A # J key
$R_Key_K = 0x4B # K key
$R_Key_L = 0x4C # L key
$R_Key_M = 0x4D # M key
$R_Key_N = 0x4E # N key
$R_Key_O = 0x4F # O key
$R_Key_P = 0x50 # P key
$R_Key_Q = 0x51 # Q key
$R_Key_R = 0x52 # R key
$R_Key_S = 0x53 # S key
$R_Key_T = 0x54 # T key
$R_Key_U = 0x55 # U key
$R_Key_V = 0x56 # V key
$R_Key_W = 0x57 # W key
$R_Key_X = 0x58 # X key
$R_Key_Y = 0x59 # Y key
$R_Key_Z = 0x5A # Z key
#--------------------------------------------------------------------------
$R_Key_LWIN = 0x5B # Left Windows key (Microsoft Natural keyboard)
$R_Key_RWIN = 0x5C # Right Windows key (Natural keyboard)
$R_Key_APPS = 0x5D # Applications key (Natural keyboard)
#--------------------------------------------------------------------------
$R_Key_NUMPAD0 = 0x60 # Numeric keypad 0 key
$R_Key_NUMPAD1 = 0x61 # Numeric keypad 1 key
$R_Key_NUMPAD2 = 0x62 # Numeric keypad 2 key
$R_Key_NUMPAD3 = 0x63 # Numeric keypad 3 key
$R_Key_NUMPAD4 = 0x64 # Numeric keypad 4 key
$R_Key_NUMPAD5 = 0x65 # Numeric keypad 5 key
$R_Key_NUMPAD6 = 0x66 # Numeric keypad 6 key
$R_Key_NUMPAD7 = 0x67 # Numeric keypad 7 key
$R_Key_NUMPAD8 = 0x68 # Numeric keypad 8 key
$R_Key_NUMPAD9 = 0x69 # Numeric keypad 9 key
$R_Key_MULTIPLY = 0x6A # Multiply key (*)
$R_Key_ADD = 0x6B # Add key (+)
$R_Key_SEPARATOR = 0x6C # Separator key
$R_Key_SUBTRACT = 0x6D # Subtract key (-)
$R_Key_DECIMAL = 0x6E # Decimal key
$R_Key_DIVIDE = 0x6F # Divide key (/)
#--------------------------------------------------------------------------
$R_Key_F1 = 0x70 # F1 key
$R_Key_F2 = 0x71 # F2 key
$R_Key_F3 = 0x72 # F3 key
$R_Key_F4 = 0x73 # F4 key
$R_Key_F5 = 0x74 # F5 key
$R_Key_F6 = 0x75 # F6 key
$R_Key_F7 = 0x76 # F7 key
$R_Key_F8 = 0x77 # F8 key
$R_Key_F9 = 0x78 # F9 key
$R_Key_F10 = 0x79 # F10 key
$R_Key_F11 = 0x7A # F11 key
$R_Key_F12 = 0x7B # F12 key
#--------------------------------------------------------------------------
$R_Key_NUMLOCK = 0x90 # NUM LOCK key
$R_Key_SCROLL = 0x91 # SCROLL LOCK key
#--------------------------------------------------------------------------
$R_Key_LSHIFT = 0xA0 # Left SHIFT key
$R_Key_RSHIFT = 0xA1 # Right SHIFT key
$R_Key_LCONTROL = 0xA2 # Left CONTROL key
$R_Key_RCONTROL = 0xA3 # Right CONTROL key
$R_Key_L_ALT = 0xA4 # Left ALT key
$R_Key_R_ALT = 0xA5 # Right ALT key
#--------------------------------------------------------------------------
$R_Key_SEP = 0xBC # , key
$R_Key_DASH = 0xBD # - key
$R_Key_DOTT = 0xBE # . key
#--------------------------------------------------------------------------
GetKeyState = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
GetKeyboardState = Win32API.new("user32","GetKeyState",['i'],'i')
GetSetKeyState = Win32API.new("user32","SetKeyboardState",['i'],'i')
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
def keyb(rkey)
if GetKeyState.call(rkey) != 0
return 1
end
return 0
end
#--------------------------------------------------------------------------
def keyboard(rkey)
GetKeyState.call(rkey) & 0x01 == 1 #
end
#--------------------------------------------------------------------------
def key(rkey, key = 0)
GetKeyboardState.call(rkey) & 0x01 == key #
end
end
#===============================================================================
#
# Text-Input Script v1 created by: cybersam
#
# hi boys and ladys.... and whatever else ^-^
#
# here comes the script that allows you to insert text with the keyboard
# in your game... ^-^
#
# i didnt make it work with the default name edit/input script
# but with this it should be easier for you guys to do it...
# the reason ?!.. i said it already in other scripts... ^-^
#
# "i dont wana do a complete script that you can post in your games and it works
# without a single modification"...
#
# since there are people here that just dont even wont try to learn ruby...
# this script works perfect of its own....
# but it wont let you edit the character name without modification...
# so go on and try it out...
#
# if you need help to edit something just ask...
# i would gladly help but i wont do all the work for you...
#
# thats it from my side...
# as for now... this will be the last update
# for this script (keyboard/mouse script) from my side...
# if you find any bugs please contact me... you should already now how... ^-^
# and dont tell me "there is a bug in you script!"
# that alone is not enough... ^-^
#
# cya all ^-^
# sam
#
#===============================================================================
class Text_input < Window_Base
def initialize(top_text = "Here comes the new Version of the keyboard script", text = "Keyboad - Script v3", font = "Arial", max = 20, size = 16, free = "_")
@toptext = top_text
@text = text
@font = font
@max = max
@size = size
@free = free
super(320 - (@max*@size+@size)/2, 240-@size*2-32, @max * @size + 32, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = @font
self.contents.font.size = @size
self.z = 256
@twidth = @max*@size
refresh
update
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, @twidth, @size, @toptext, 1)
for i in 0...@max
text = @text
if text == nil
text = @free
else
text = text.chr
end
self.contents.font.color = normal_color
self.contents.draw_text(@size * i, @size + 24, @size, @size, text, 1)
end
end
def update
loop do
Graphics.update
refresh
if Kboard.keyboard($R_Key_BACK) # delete (with backspace)
text = ""
if @text.size != 0
for i in 0...@text.size - 1
text += @text.chr
end
@text = text
else
end
end
if Kboard.keyboard($R_Key_RETURN) # Enter key... to end...
#$game_variables[1]=@text
return
end
if @text.size < @max
# putting Key's to the text
if Kboard.keyboard($R_Key_SPACE) # space key (to insert space between the chars... ^-^)
@text += " " # space.. you can set anything else if you want ^-^'
end
if Kboard.key($R_Key_CAPITAL, 1) # if caps lock is active then write the chars in higher case
if Kboard.keyboard($R_Key_A)
@text += "A"
end
if Kboard.keyboard($R_Key_B)
@text += "B"
end
if Kboard.keyboard($R_Key_C)
@text += "C"
end
if Kboard.keyboard($R_Key_D)
@text += "D"
end
if Kboard.keyboard($R_Key_E)
@text += "E"
end
if Kboard.keyboard($R_Key_F)
@text += "F"
end
if Kboard.keyboard($R_Key_G)
@text += "G"
end
if Kboard.keyboard($R_Key_H)
@text += "H"
end
if Kboard.keyboard($R_Key_I)
@text += "I"
end
if Kboard.keyboard($R_Key_J)
@text += "J"
end
if Kboard.keyboard($R_Key_K)
@text += "K"
end
if Kboard.keyboard($R_Key_L)
@text += "L"
end
if Kboard.keyboard($R_Key_M)
@text += "M"
end
if Kboard.keyboard($R_Key_N)
@text += "N"
end
if Kboard.keyboard($R_Key_O)
@text += "O"
end
if Kboard.keyboard($R_Key_P)
@text += "P"
end
if Kboard.keyboard($R_Key_Q)
@text += "Q"
end
if Kboard.keyboard($R_Key_R)
@text += "R"
end
if Kboard.keyboard($R_Key_S)
@text += "S"
end
if Kboard.keyboard($R_Key_T)
@text += "T"
end
if Kboard.keyboard($R_Key_U)
@text += "U"
end
if Kboard.keyboard($R_Key_V)
@text += "V"
end
if Kboard.keyboard($R_Key_W)
@text += "W"
end
if Kboard.keyboard($R_Key_X)
@text += "X"
end
if Kboard.keyboard($R_Key_Y)
@text += "Y"
end
if Kboard.keyboard($R_Key_Z)
@text += "Z"
end
elsif Kboard.key($R_Key_CAPITAL) # if caps lock is deactivated then write in lower case
if Kboard.keyboard($R_Key_A)
@text += "a"
end
if Kboard.keyboard($R_Key_B)
@text += "b"
end
if Kboard.keyboard($R_Key_C)
@text += "c"
end
if Kboard.keyboard($R_Key_D)
@text += "d"
end
if Kboard.keyboard($R_Key_E)
@text += "e"
end
if Kboard.keyboard($R_Key_F)
@text += "f"
end
if Kboard.keyboard($R_Key_G)
@text += "g"
end
if Kboard.keyboard($R_Key_H)
@text += "h"
end
if Kboard.keyboard($R_Key_I)
@text += "i"
end
if Kboard.keyboard($R_Key_J)
@text += "j"
end
if Kboard.keyboard($R_Key_K)
@text += "k"
end
if Kboard.keyboard($R_Key_L)
@text += "l"
end
if Kboard.keyboard($R_Key_M)
@text += "m"
end
if Kboard.keyboard($R_Key_N)
@text += "n"
end
if Kboard.keyboard($R_Key_O)
@text += "o"
end
if Kboard.keyboard($R_Key_P)
@text += "p"
end
if Kboard.keyboard($R_Key_Q)
@text += "q"
end
if Kboard.keyboard($R_Key_R)
@text += "r"
end
if Kboard.keyboard($R_Key_S)
@text += "s"
end
if Kboard.keyboard($R_Key_T)
@text += "t"
end
if Kboard.keyboard($R_Key_U)
@text += "u"
end
if Kboard.keyboard($R_Key_V)
@text += "v"
end
if Kboard.keyboard($R_Key_W)
@text += "w"
end
if Kboard.keyboard($R_Key_X)
@text += "x"
end
if Kboard.keyboard($R_Key_Y)
@text += "y"
end
if Kboard.keyboard($R_Key_Z)
@text += "z"
end
end
# numbers
if Kboard.keyboard($R_Key_0)
@text += "0"
end
if Kboard.keyboard($R_Key_1)
@text += "1"
end
if Kboard.keyboard($R_Key_2)
@text += "2"
end
if Kboard.keyboard($R_Key_3)
@text += "3"
end
if Kboard.keyboard($R_Key_4)
@text += "4"
end
if Kboard.keyboard($R_Key_5)
@text += "5"
end
if Kboard.keyboard($R_Key_6)
@text += "6"
end
if Kboard.keyboard($R_Key_7)
@text += "7"
end
if Kboard.keyboard($R_Key_8)
@text += "8"
end
if Kboard.keyboard($R_Key_9)
@text += "9"
end
# numpad
if Kboard.keyboard($R_Key_NUMPAD0)
@text += "0"
end
if Kboard.keyboard($R_Key_NUMPAD1)
@text += "1"
end
if Kboard.keyboard($R_Key_NUMPAD2)
@text += "2"
end
if Kboard.keyboard($R_Key_NUMPAD3)
@text += "3"
end
if Kboard.keyboard($R_Key_NUMPAD4)
@text += "4"
end
if Kboard.keyboard($R_Key_NUMPAD5)
@text += "5"
end
if Kboard.keyboard($R_Key_NUMPAD6)
@text += "6"
end
if Kboard.keyboard($R_Key_NUMPAD7)
@text += "7"
end
if Kboard.keyboard($R_Key_NUMPAD8)
@text += "8"
end
if Kboard.keyboard($R_Key_NUMPAD9)
@text += "9"
end
if Kboard.keyboard($R_Key_ADD) # + (numpad)
@text += "+"
end
if Kboard.keyboard($R_Key_SUBTRACT) # - (numpad)
@text += "-"
end
if Kboard.keyboard($R_Key_DIVIDE) # / (numpad)
@text += "/"
end
if Kboard.keyboard($R_Key_MULTIPLY) # * (numpad)
@text += "*"
end
if Kboard.key($R_Key_CAPITAL) # since i dont want to change my keyboard layout you need to test it for you'r self...
if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
@text += ","
end
if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
@text += "-"
end
if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
@text += "."
end
elsif Kboard.key($R_Key_CAPITAL, 1)
if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
@text += ";"
end
if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
@text += "_"
end
if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
@text += ":"
end
end
else
end
refresh
end
end
def text()
self.contents.dispose
self.dispose
return @text
end
end
And the Better Title Screen Script by SephirothSpawn
#==============================================================================
# ** Advanced Title Screen
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2
# 2007-03-01
# SDK : Version 2.0+, Part I, II & III
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (2006-08-30)
# Version 1.01 ------------------------------------------------ (2006-10-18)
# - Bug Fix : Fixed Spriteset and Map Updating and Disposing
# Version 1.1 ------------------------------------------------- (2007-01-02)
# - Bug Fix / Addition : Made Player Movement On Title Optional
# Version 2 ---------------------------------------------------- (2007-03-01)
# - Update : Rescripted much of the code
#------------------------------------------------------------------------------
# * Requirements :
#
# Method & Class Library 2.1+
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to add a little more flash to your title screen.
# You can add a fog, panorama, weather pattern or even show the map. It can
# load latest savefile if one is present to display for your map.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
# To Customize your title, refer to the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
# Options
#
# Show_Map = true or false
# Load_Recent_Save = true or false
# Map_ID = map id
# Player_X = x position
# Player_Y = y position
# Player_Image_Name = nil : none or 0 : default or 'filename'
# Player_Image_Hue = 0 - 360
# Allow_Player_Movement = true or false
#
# Show_Panorama = true of false
# Panorama_Name = 'panorama filename'
# Panorama_Hue = 0 - 360
# Panorama_Opacity = 0 - 255
# Panorama_Scroll_Dir = scroll_direction
# Panorama_Scroll_Spd = n
#
# Show_Fog = true or false
# Fog_Name = 'fog filename'
# Fog_Hue = 0 - 360
# Fog_Opacity = 0 - 255
# Fog_Zoom_X = n
# Fog_Zoom_Y = n
# Fog_Scroll_Dir = scroll_direction
# Fog_Scroll_Spd = n
#
# Show_Weather = true or false
# Weather_Type = 0 : None, 1 : Rain, 2 : Storm, 3 : Snow
# Weathor_Power_S = 0 - 40
# Weather_Power_F = 0 - 40
#
# Scroll Directions = 1 : Down-Left, 2 : Down, 3 : Down-Right,
# 4 : Left, 5 : None, 6 : Right,
# 7 : Up-Left, 8 : Up, 9 : Up-Right
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Advanced Title Screen', 'SephirothSpawn', 2, '2007-03-01')
SDK.check_requirements(2.0, [2, 3], {'Method & Class Library' => 2.1})
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Advanced Title Screen')
#==============================================================================
# ** Adv_Title_System
#==============================================================================
module Adv_Title_System
#--------------------------------------------------------------------------
# * Options
#
# Show_Map = true or false
# Load_Recent_Save = true or false
# Map_ID = map id
# Player_X = x position
# Player_Y = y position
# Player_Image_Name = nil : none or 0 : default or 'filename'
# Player_Image_Hue = 0 - 360
# Allow_Player_Movement = true or false
#
# Show_Panorama = true of false
# Panorama_Name = 'panorama filename'
# Panorama_Hue = 0 - 360
# Panorama_Opacity = 0 - 255
# Panorama_Scroll_Dir = scroll_direction
# Panorama_Scroll_Spd = n
#
# Show_Fog = true or false
# Fog_Name = 'fog filename'
# Fog_Hue = 0 - 360
# Fog_Opacity = 0 - 255
# Fog_Zoom_X = n
# Fog_Zoom_Y = n
# Fog_Scroll_Dir = scroll_direction
# Fog_Scroll_Spd = n
#
# Show_Weather = true or false
# Weather_Type = 0 : None, 1 : Rain, 2 : Storm, 3 : Snow
# Weathor_Power_S = 0 - 40
# Weather_Power_F = 0 - 40
#
# * Scroll Directions = 1 : Down-Left, 2 : Down, 3 : Down-Right,
# 4 : Left, 5 : None, 6 : Right,
# 7 : Up-Left, 8 : Up, 9 : Up-Right
#--------------------------------------------------------------------------
Show_Map = true
Load_Recent_Save = true
Map_ID = 1
Player_X = 12
Player_Y = 10
Player_Image_Name = 0
Player_Image_Hue = 0
Allow_Player_Movement = false
#--------------------------------------------------------------------------
Show_Panorama = true
Panorama_Name = '001-Sky01'
Panorama_Hue = 0
Panorama_Opacity = 255
Panorama_Scroll_Dir = 3
Panorama_Scroll_Spd = 4
#--------------------------------------------------------------------------
Show_Fog = true
Fog_Name = '001-Fog01'
Fog_Hue = 0
Fog_Opacity = 100
Fog_Zoom_X = 1
Fog_Zoom_Y = 1
Fog_Scroll_Dir = 6
Fog_Scroll_Spd = 4
#--------------------------------------------------------------------------
Show_Weather = true
Weather_Type = 2
Weathor_Power_S = 0
Weather_Power_F = 40
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_advttlscn_scnttl_mss, :main_spriteset
alias_method :seph_advttlscn_scnttl_mvar, :main_variable
alias_method :seph_advttlscn_scnttl_msp, :main_sprite
alias_method :seph_advttlscn_scnttl_update, :update
#--------------------------------------------------------------------------
# * Main Processing : Variable Initialization
#--------------------------------------------------------------------------
def main_variable
# Original Variable Initialization
seph_advttlscn_scnttl_mvar
# If Show Map
if Adv_Title_System::Show_Map
# Setup Map
seph_ats_setup_map
end
end
#--------------------------------------------------------------------------
# * Setup Advanced Title Screen : Map Data
#--------------------------------------------------------------------------
def seph_ats_setup_map
# If Load Recent Save File
if Adv_Title_System::Load_Recent_Save
# Set Nil File Index & Save Time
file_index, st = nil, nil
# Pass Through Save Files
for i in 0..3
# If File Exist
if FileTest.exist?("Save#{i+1}.rxdata")
# If Nil Save Time or Time Earlier
if st.nil? || (t = File.ctime("Save#{i+1}.rxdata")) > st
# Set File Index & Save File Time
file_index, st = i, t
end
end
end
end
# If Nil File Index
if file_index.nil?
# Setup Blank Game Data
commandnewgame_gamedata
# Set up initial map position
$game_map.setup(Adv_Title_System::Map_ID)
# Move player to initial position
$game_player.moveto(Adv_Title_System::Player_X,
Adv_Title_System::Player_Y)
# Refresh player
$game_player.refresh
# Set Player Graphic
if Adv_Title_System::Player_Image_Name.nil?
$game_player.character_name = ''
elsif Adv_Title_System::Player_Image_Name != 0
$game_player.character_name = Adv_Title_System::Player_Image_Name
end
# Set Player Hue
$game_player.character_hue = Adv_Title_System::Player_Image_Hue
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# If Load From File
else
# Creates Dummy Load File Object
load = Scene_Load.new
# Read save data
file = File.open(load.make_filename(file_index), "rb")
load.read_save_data(file)
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
end
# Unless Player Movement Allowed
unless Adv_Title_System::Allow_Player_Movement
# Disable Player Movement
$game_player.disable_player_movement = true
end
end
#--------------------------------------------------------------------------
# * Main Processing : Spriteset Initialization
#--------------------------------------------------------------------------
def main_spriteset
# Original Spriteset Initialization
seph_advttlscn_scnttl_mss
# If Show Map
if Adv_Title_System::Show_Map
# Make sprite set
@spriteset = Spriteset_Map.new
end
end
#--------------------------------------------------------------------------
# * Main Processing : Sprite Initialization
#--------------------------------------------------------------------------
def main_sprite
# Original Sprite Initialization
seph_advttlscn_scnttl_msp
# Gets ATS Settings
ats = Adv_Title_System
# Sets Up Panorama
if ats::Show_Panorama
@panorama = Plane.new
@panorama.bitmap = RPG::Cache.panorama(ats::Panorama_Name,
ats::Panorama_Hue)
@panorama.opacity = ats::Panorama_Opacity
@panorama.z -= 1000
end
# Sets Up Fog
if ats::Show_Fog
@fog = Plane.new
@fog.bitmap = RPG::Cache.fog(ats::Fog_Name, ats::Fog_Hue)
@fog.zoom_x = ats::Fog_Zoom_X
@fog.zoom_y = ats::Fog_Zoom_Y
@fog.opacity = ats::Fog_Opacity
@fog.z = 3000
end
# Sets Up Weather
if ats::Show_Weather
# Make weather
@weather = RPG::Weather.new
@weather.type = ats::Weathor_Power_S
@weather.max = ats::Weather_Power_F
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If Show Map
if Adv_Title_System::Show_Map
# Update Map & Spriteset
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
end
# Original Update Method
seph_advttlscn_scnttl_update
# Updates Panorama Scrolling
unless @panorama.nil?
dir = Adv_Title_System::Panorama_Scroll_Dir
spd = Adv_Title_System::Panorama_Scroll_Spd
@panorama.oy += spd if [1, 2, 3].include?(dir)
@panorama.oy -= spd if [7, 8, 9].include?(dir)
@panorama.ox += spd if [1, 4, 7].include?(dir)
@panorama.ox -= spd if [3, 6, 9].include?(dir)
end
# Updates Fog Scrolling
unless @fog.nil?
dir = Adv_Title_System::Fog_Scroll_Dir
spd = Adv_Title_System::Fog_Scroll_Spd
@fog.oy += spd if [1, 2, 3].include?(dir)
@fog.oy -= spd if [7, 8, 9].include?(dir)
@fog.ox += spd if [1, 4, 7].include?(dir)
@fog.ox -= spd if [3, 6, 9].include?(dir)
end
# Update Weather
unless @weather.nil?
@weather.max += 1 if @weather.max < Adv_Title_System::Weather_Power_F
@weather.update
end
end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
attr_accessor :character_name
attr_accessor :character_hue
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
# ** Advanced Title Screen
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2
# 2007-03-01
# SDK : Version 2.0+, Part I, II & III
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (2006-08-30)
# Version 1.01 ------------------------------------------------ (2006-10-18)
# - Bug Fix : Fixed Spriteset and Map Updating and Disposing
# Version 1.1 ------------------------------------------------- (2007-01-02)
# - Bug Fix / Addition : Made Player Movement On Title Optional
# Version 2 ---------------------------------------------------- (2007-03-01)
# - Update : Rescripted much of the code
#------------------------------------------------------------------------------
# * Requirements :
#
# Method & Class Library 2.1+
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to add a little more flash to your title screen.
# You can add a fog, panorama, weather pattern or even show the map. It can
# load latest savefile if one is present to display for your map.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
# To Customize your title, refer to the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
# Options
#
# Show_Map = true or false
# Load_Recent_Save = true or false
# Map_ID = map id
# Player_X = x position
# Player_Y = y position
# Player_Image_Name = nil : none or 0 : default or 'filename'
# Player_Image_Hue = 0 - 360
# Allow_Player_Movement = true or false
#
# Show_Panorama = true of false
# Panorama_Name = 'panorama filename'
# Panorama_Hue = 0 - 360
# Panorama_Opacity = 0 - 255
# Panorama_Scroll_Dir = scroll_direction
# Panorama_Scroll_Spd = n
#
# Show_Fog = true or false
# Fog_Name = 'fog filename'
# Fog_Hue = 0 - 360
# Fog_Opacity = 0 - 255
# Fog_Zoom_X = n
# Fog_Zoom_Y = n
# Fog_Scroll_Dir = scroll_direction
# Fog_Scroll_Spd = n
#
# Show_Weather = true or false
# Weather_Type = 0 : None, 1 : Rain, 2 : Storm, 3 : Snow
# Weathor_Power_S = 0 - 40
# Weather_Power_F = 0 - 40
#
# Scroll Directions = 1 : Down-Left, 2 : Down, 3 : Down-Right,
# 4 : Left, 5 : None, 6 : Right,
# 7 : Up-Left, 8 : Up, 9 : Up-Right
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Advanced Title Screen', 'SephirothSpawn', 2, '2007-03-01')
SDK.check_requirements(2.0, [2, 3], {'Method & Class Library' => 2.1})
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Advanced Title Screen')
#==============================================================================
# ** Adv_Title_System
#==============================================================================
module Adv_Title_System
#--------------------------------------------------------------------------
# * Options
#
# Show_Map = true or false
# Load_Recent_Save = true or false
# Map_ID = map id
# Player_X = x position
# Player_Y = y position
# Player_Image_Name = nil : none or 0 : default or 'filename'
# Player_Image_Hue = 0 - 360
# Allow_Player_Movement = true or false
#
# Show_Panorama = true of false
# Panorama_Name = 'panorama filename'
# Panorama_Hue = 0 - 360
# Panorama_Opacity = 0 - 255
# Panorama_Scroll_Dir = scroll_direction
# Panorama_Scroll_Spd = n
#
# Show_Fog = true or false
# Fog_Name = 'fog filename'
# Fog_Hue = 0 - 360
# Fog_Opacity = 0 - 255
# Fog_Zoom_X = n
# Fog_Zoom_Y = n
# Fog_Scroll_Dir = scroll_direction
# Fog_Scroll_Spd = n
#
# Show_Weather = true or false
# Weather_Type = 0 : None, 1 : Rain, 2 : Storm, 3 : Snow
# Weathor_Power_S = 0 - 40
# Weather_Power_F = 0 - 40
#
# * Scroll Directions = 1 : Down-Left, 2 : Down, 3 : Down-Right,
# 4 : Left, 5 : None, 6 : Right,
# 7 : Up-Left, 8 : Up, 9 : Up-Right
#--------------------------------------------------------------------------
Show_Map = true
Load_Recent_Save = true
Map_ID = 1
Player_X = 12
Player_Y = 10
Player_Image_Name = 0
Player_Image_Hue = 0
Allow_Player_Movement = false
#--------------------------------------------------------------------------
Show_Panorama = true
Panorama_Name = '001-Sky01'
Panorama_Hue = 0
Panorama_Opacity = 255
Panorama_Scroll_Dir = 3
Panorama_Scroll_Spd = 4
#--------------------------------------------------------------------------
Show_Fog = true
Fog_Name = '001-Fog01'
Fog_Hue = 0
Fog_Opacity = 100
Fog_Zoom_X = 1
Fog_Zoom_Y = 1
Fog_Scroll_Dir = 6
Fog_Scroll_Spd = 4
#--------------------------------------------------------------------------
Show_Weather = true
Weather_Type = 2
Weathor_Power_S = 0
Weather_Power_F = 40
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_advttlscn_scnttl_mss, :main_spriteset
alias_method :seph_advttlscn_scnttl_mvar, :main_variable
alias_method :seph_advttlscn_scnttl_msp, :main_sprite
alias_method :seph_advttlscn_scnttl_update, :update
#--------------------------------------------------------------------------
# * Main Processing : Variable Initialization
#--------------------------------------------------------------------------
def main_variable
# Original Variable Initialization
seph_advttlscn_scnttl_mvar
# If Show Map
if Adv_Title_System::Show_Map
# Setup Map
seph_ats_setup_map
end
end
#--------------------------------------------------------------------------
# * Setup Advanced Title Screen : Map Data
#--------------------------------------------------------------------------
def seph_ats_setup_map
# If Load Recent Save File
if Adv_Title_System::Load_Recent_Save
# Set Nil File Index & Save Time
file_index, st = nil, nil
# Pass Through Save Files
for i in 0..3
# If File Exist
if FileTest.exist?("Save#{i+1}.rxdata")
# If Nil Save Time or Time Earlier
if st.nil? || (t = File.ctime("Save#{i+1}.rxdata")) > st
# Set File Index & Save File Time
file_index, st = i, t
end
end
end
end
# If Nil File Index
if file_index.nil?
# Setup Blank Game Data
commandnewgame_gamedata
# Set up initial map position
$game_map.setup(Adv_Title_System::Map_ID)
# Move player to initial position
$game_player.moveto(Adv_Title_System::Player_X,
Adv_Title_System::Player_Y)
# Refresh player
$game_player.refresh
# Set Player Graphic
if Adv_Title_System::Player_Image_Name.nil?
$game_player.character_name = ''
elsif Adv_Title_System::Player_Image_Name != 0
$game_player.character_name = Adv_Title_System::Player_Image_Name
end
# Set Player Hue
$game_player.character_hue = Adv_Title_System::Player_Image_Hue
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# If Load From File
else
# Creates Dummy Load File Object
load = Scene_Load.new
# Read save data
file = File.open(load.make_filename(file_index), "rb")
load.read_save_data(file)
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
end
# Unless Player Movement Allowed
unless Adv_Title_System::Allow_Player_Movement
# Disable Player Movement
$game_player.disable_player_movement = true
end
end
#--------------------------------------------------------------------------
# * Main Processing : Spriteset Initialization
#--------------------------------------------------------------------------
def main_spriteset
# Original Spriteset Initialization
seph_advttlscn_scnttl_mss
# If Show Map
if Adv_Title_System::Show_Map
# Make sprite set
@spriteset = Spriteset_Map.new
end
end
#--------------------------------------------------------------------------
# * Main Processing : Sprite Initialization
#--------------------------------------------------------------------------
def main_sprite
# Original Sprite Initialization
seph_advttlscn_scnttl_msp
# Gets ATS Settings
ats = Adv_Title_System
# Sets Up Panorama
if ats::Show_Panorama
@panorama = Plane.new
@panorama.bitmap = RPG::Cache.panorama(ats::Panorama_Name,
ats::Panorama_Hue)
@panorama.opacity = ats::Panorama_Opacity
@panorama.z -= 1000
end
# Sets Up Fog
if ats::Show_Fog
@fog = Plane.new
@fog.bitmap = RPG::Cache.fog(ats::Fog_Name, ats::Fog_Hue)
@fog.zoom_x = ats::Fog_Zoom_X
@fog.zoom_y = ats::Fog_Zoom_Y
@fog.opacity = ats::Fog_Opacity
@fog.z = 3000
end
# Sets Up Weather
if ats::Show_Weather
# Make weather
@weather = RPG::Weather.new
@weather.type = ats::Weathor_Power_S
@weather.max = ats::Weather_Power_F
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If Show Map
if Adv_Title_System::Show_Map
# Update Map & Spriteset
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
end
# Original Update Method
seph_advttlscn_scnttl_update
# Updates Panorama Scrolling
unless @panorama.nil?
dir = Adv_Title_System::Panorama_Scroll_Dir
spd = Adv_Title_System::Panorama_Scroll_Spd
@panorama.oy += spd if [1, 2, 3].include?(dir)
@panorama.oy -= spd if [7, 8, 9].include?(dir)
@panorama.ox += spd if [1, 4, 7].include?(dir)
@panorama.ox -= spd if [3, 6, 9].include?(dir)
end
# Updates Fog Scrolling
unless @fog.nil?
dir = Adv_Title_System::Fog_Scroll_Dir
spd = Adv_Title_System::Fog_Scroll_Spd
@fog.oy += spd if [1, 2, 3].include?(dir)
@fog.oy -= spd if [7, 8, 9].include?(dir)
@fog.ox += spd if [1, 4, 7].include?(dir)
@fog.ox -= spd if [3, 6, 9].include?(dir)
end
# Update Weather
unless @weather.nil?
@weather.max += 1 if @weather.max < Adv_Title_System::Weather_Power_F
@weather.update
end
end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
attr_accessor :character_name
attr_accessor :character_hue
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end