Title Screen Mod - Hadriel - 02-19-2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
I was looking through the default scripts and I did some modifications to the Title Screen that I thought would be usefull for someone who wants the title menu to appear horizontaly and doesn't know to make one ( basically for script n00bs ).
Hope it helps somebody! I'm a moderate maker so don't expect much, but I'd like feedback.
---------Installation------------------
Insert a new script page in the editor under Window_Command and name it Window_Command2. Then Paste this into it:
Code: class Window_Command2 < Window_Selectable
#--------------------------------------------------------------------------
# —? オブジェクトåˆ?期化
# width : ウィンドウ�幅
# commands : コマンド文å—列ã?®é…?列
#--------------------------------------------------------------------------
def initialize(width, commands)
# コマンド�個数�らウィンドウ�高�を算出
super(0, 0, width, 64) # This is also changed, I've put 64 instead of @item_max * 32 +32 and you should
# leave it.
@item_max = commands.size
@commands = commands
# I changed the column_max so every item is in a different column
# I think you should leave it be, but it can be changed
@column_max = 3
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# —? リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# —? …ç›®ã?®æ??ç”»
# index : …目番å?·
# color : æ–‡å—色
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
# This is also modified so it shows each item in a separate column
rect = Rect.new(4 + 200 * index, 0, self.contents.width - 8, 32)
#----------------------------------------------------------------------------------------------
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
# —? …ç›®ã?®ç„¡ ¹åŒ–
# index : …目番å?·
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
Second, if you want, backup the Scene_Title somehow, but just overwrite its contents with this:
Code: #==============================================================================
# –� Scene_Title
#------------------------------------------------------------------------------
#  タイトル画��処� を行� クラス��。
#==============================================================================
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 = "Load Game"
s3 = "End Game"
@command_window = Window_Command2.new(600, [s1, s2, s3])
@command_window.back_opacity = 64
@command_window.x = 20
@command_window.y = 360
#------------------------------------------------------------------------------------
#--------------------- Hadriel's changes ---------------------------------
# the thing I have changed here is the background opacity of the window
# you can set it to what you like
# you shouldn't change the x coord. but you can change the y so it fits
# your desires
# I have changed the selectable Load Game and End Game which are originally
# Continue and Shutdown. You can write whatever you want
#------------------------------------------------------------------------------------
# 有å� ¹ã?ªã‚‰ @continue_enabled ã‚’ trueã€?ç„¡å� ¹ã?ªã‚‰ false ã?«ã?™ã‚‹
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# コンãƒ� ィニューã?Œæœ‰å� ¹ã?ªå� ´å?ˆã€?カーソルをコンãƒ� ィニューã?«å?ˆã‚?ã?›ã‚‹
# ç„¡å� ¹ã?ªå� ´å?ˆã€?コンãƒ� ィニューã?®æ–‡å—をグレー表示ã?«ã?™ã‚‹
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# タイトル BGM を演�
$game_system.bgm_play($data_system.title_bgm)
# MEã€?BGS ã?®æ¼”å¥?ã‚’å?œæ¢
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
#--------------------------------------------------------------------------
# —? フレーãƒ� æ›´æ–°
#--------------------------------------------------------------------------
def update
# コマンドウィンドウを更æ–
@command_window.update
# C ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
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
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# BGM ã‚’å?œæ¢
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
# マップã?«è¨å®šã?•ã‚Œã?¦ã?„ã‚‹ BGM ã?¨ BGS ã?®è‡ªå‹•åˆ‡ã‚� 替ã?ˆã‚’実行
$game_map.autoplay
# マップを更新 (並列イベント実行)
$game_map.update
# マップ画��切� 替�
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# —? コマンド : コンãƒ� ィニュー
#--------------------------------------------------------------------------
def command_continue
# コンãƒ� ィニューã?Œç„¡å� ¹ã?®å� ´å?ˆ
unless @continue_enabled
# ブザー SE を演�
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# ãƒãƒ¼ãƒ‰ç”»é?¢ã?«åˆ‡ã‚� 替ã?ˆ
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# —? コマンド : シャットダウン
#--------------------------------------------------------------------------
def command_shutdown
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# BGM�BGS�ME をフェードアウト
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
# トループ IDã€?逃走å?¯èƒ½ãƒ•ãƒ©ã‚°ã€?ãƒ?トルãƒ?ックをè¨å®š
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# �トル開始 SE を演�
$game_system.se_play($data_system.battle_start_se)
# �トル BGM を演�
$game_system.bgm_play($game_system.battle_bgm)
# �トル画��切� 替�
$scene = Scene_Battle.new
end
end
As I said, I hope it helps someone!
(This is me first script submission )
|