Wprowadzenie
Nie jest to ogromny skrypt lecz upiększa nasze Title
Zrzuty Ekranu
Spoiler:
Jak korzystac?
Umiesc nad Main,najlepiej na szczycie wszystkich skryptów ze względu na kompatybilnosc,a następnie usuń orginalny Scene_Title.Do działania tego skryptu potrzeba piec obrazków: new_game, continue, exit, title_image, and title_bg.Przykładowe obrazki podane są w Demo
Skrypt Nie przetłumaczony
Spoiler:
##############################################################
# Discovery Title Screen
#
# Script By TheRexion/Rekx
# Program: Rpg Maker VX
# Language: RGSS2
#
# Credits to:
# Johnny Mercy
##############################################################
# Class SceneTitle
##############################################################
module CustomTitle
# Falling objects on or off
FALLING = true
# Three options side by side or three on top of each other
STYLE = 2 # 1 or 2
# 1 = Left Aligned, 2 = Centered, 3 = Right Aligned. Only applies for Style 2
PLACEMENT = 1
# Would you like the title image to be wavy?
WAVY = true
# Screen Resolution
# ONLY needed if you're using Center Aligned
RESO = 544
# How quickly things fade in and out
# I recommend 5 - 30, anything else is too slow or too fast.
FADE_DURATION = 7
# How fast menu items slide
# ONLY VALID IN PLACEMENTS 1 AND 3 WITH STYLE 2 ACTIVATED
# For this, I recommend 3 - 15.
SLIDE_SPEED = 3
# The transparency of the menu items
HOVER = 225
INACTIVE = 50
# Automatically change the menu input keys when the style changes?
AUTO_CONTROL_CHANGE = true
# If AUTO_CONTROL_CHANGE = false, which do you want active?
UP_DOWN = true
LEFT_RIGHT = true
end
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# Processo principal
#--------------------------------------------------------------------------
def main
if $BTEST
battle_test
else
super
end
end
#--------------------------------------------------------------------------
# Initialize the process
#--------------------------------------------------------------------------
def start
# Name of the background image
$up = true
@nBgImage = "title_bg"
# Name of the leaves
@nfall1 = "fall1"
@nfall2 = "fall2"
# Name of the menu items used in the title
@nnew_game = "new_game"
@ncontinue = "continue"
@nexit = "exit"
# Name of the title image
@ntitle = "title_image"
# Name of the credits image
@ncredits = "credits"
#----------------------------------------------------------------------
# End of configuration
#----------------------------------------------------------------------
@menu_index = 0
load_images()
end
#--------------------------------------------------------------------------
# Screen Update
#--------------------------------------------------------------------------
def update
current_menu_index()
falling_animation() if CustomTitle::FALLING
keyboard_input()
@title.update
end
#--------------------------------------------------------------------------
# End the process
#--------------------------------------------------------------------------
def terminate
@bg.dispose
@new_game.dispose
@continue.dispose
@exit.dispose
@title.dispose
@credits.dispose
@fall1.dispose if CustomTitle::FALLING
@fall2.dispose if CustomTitle::FALLING
end
#--------------------------------------------------------------------------
# Keyboard Input
#--------------------------------------------------------------------------
def keyboard_input
if CustomTitle::AUTO_CONTROL_CHANGE
case CustomTitle::STYLE
when 1
if Input.trigger?(Input::RIGHT) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::RIGHT) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
when 2
# Up and down keys
if Input.trigger?(Input::DOWN) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::DOWN) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
else
print "STYLE has an incorrect value!"
exit
end
else
if CustomTitle::UP_DOWN
# Up and down keys
if Input.trigger?(Input::DOWN) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::DOWN) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
end
if CustomTitle::LEFT_RIGHT
if Input.trigger?(Input::RIGHT) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::RIGHT) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
end
end
if Input.trigger?(Input::C)
case @menu_index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# Animates the leaves
#--------------------------------------------------------------------------
def falling_animation
@fall2.ox += 2
@fall2.oy -= 1
@fall1.ox -= 1
@fall1.oy -= 1
end
#--------------------------------------------------------------------------
# Updates the menu
#--------------------------------------------------------------------------
def current_menu_index
if CustomTitle::PLACEMENT == 1
$MOVE = (Graphics.width / 3 - 165) - 10
$NOMOVE = (Graphics.width / 3 - 165) + 30
elsif CustomTitle::PLACEMENT == 3
$MOVE = (Graphics.width - @new_game.width - 15) + 10
$NOMOVE = (Graphics.width - @new_game.width - 15) - 30
else
$NOMOVE = CustomTitle::RESO / 3 + 19
$MOVE = CustomTitle::RESO / 3 + 19
end
a = CustomTitle::HOVER
b = CustomTitle::INACTIVE
case @menu_index
when 0
menu_opacity(a,b,b)
if CustomTitle::STYLE == 2
menu_slide($NOMOVE,$MOVE,$MOVE)
#menu_slide(30,-10,-10) if CustomTitle::PLACEMENT == 2
end
when 1
if @continue_enabled
menu_opacity(b,a,b)
else
menu_opacity(b,20,b)
end
if CustomTitle::STYLE == 2
menu_slide($MOVE,$NOMOVE,$MOVE)
end
when 2
menu_opacity(b,b,a)
if CustomTitle::STYLE == 2
menu_slide($MOVE,$MOVE,$NOMOVE)
end
end
end
#--------------------------------------------------------------------------
# Sets the opacity of the menu items
#--------------------------------------------------------------------------
def menu_opacity(a,b,c)
CustomTitle::FADE_DURATION.times {
@new_game.opacity -= 1 if @new_game.opacity > a
@new_game.opacity += 1 if @new_game.opacity < a
@new_game.update
break if @new_game.opacity == a
}
CustomTitle::FADE_DURATION.times {
@continue.opacity -= 1 if @continue.opacity > b
@continue.opacity += 1 if @continue.opacity < b
@continue.update
break if @continue.opacity == b
}
CustomTitle::FADE_DURATION.times {
@exit.opacity -= 1 if @exit.opacity > c
@exit.opacity += 1 if @exit.opacity < c
@exit.update
break if @exit.opacity == c
}
@title.update
end
#--------------------------------------------------------------------------
# Slide the menu button
#--------------------------------------------------------------------------
def menu_slide(a, b, c)
CustomTitle::SLIDE_SPEED.times {
@new_game.x -= 1 if @new_game.x > a
@new_game.x += 1 if @new_game.x < a
@new_game.update
break if @new_game.x == a
}
CustomTitle::SLIDE_SPEED.times {
@continue.x -= 1 if @continue.x > b
@continue.x += 1 if @continue.x < b
@continue.update
break if @continue.x == b
}
CustomTitle::SLIDE_SPEED.times {
@exit.x -= 1 if @exit.x > c
@exit.x += 1 if @exit.x < c
@exit.update
break if @exit.x == c
}
end
#--------------------------------------------------------------------------
# Loads the images used in the title screen
#--------------------------------------------------------------------------
def load_images
#Background
@bg = Sprite.new
@bg.bitmap = Cache.picture(@nBgImage)
#Menu
@new_game = Sprite.new
@new_game.bitmap = Cache.picture(@nnew_game)
if CustomTitle::STYLE == 2
@new_game.y = 288
if CustomTitle::PLACEMENT == 1
@new_game.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@new_game.x = Graphics.width / 3 + 19
else
@new_game.x = Graphics.width - @new_game.width - 15
end
elsif CustomTitle::STYLE == 1
@new_game.x = Graphics.width / 3 - 165
@new_game.y = 338
end
@continue = Sprite.new
@continue.bitmap = Cache.picture(@ncontinue)
if CustomTitle::STYLE == 2
#@continue.x = -10
@continue.y = 318
if CustomTitle::PLACEMENT == 1
@continue.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@continue.x = Graphics.width / 3 + 19
else
@continue.x = Graphics.width - @continue.width - 15
end
elsif CustomTitle::STYLE == 1
@continue.x = Graphics.width / 3 + 19
@continue.y = 338
end
@continue.opacity = 100
@exit = Sprite.new
@exit.bitmap = Cache.picture(@nexit)
if CustomTitle::STYLE == 2
#@exit.x = -10
@exit.y = 348
if CustomTitle::PLACEMENT == 1
@exit.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@exit.x = Graphics.width / 3 + 19
else
@exit.x = Graphics.width - @exit.width - 15
end
elsif CustomTitle::STYLE == 1
@exit.x = Graphics.width - @exit.width - 15
@exit.y = 338
end
@exit.opacity = 100
@title = Sprite.new
@title.bitmap = Cache.picture(@ntitle)
@title.x = Graphics.width / 2 - @title.width / 2
@title.y = 3
@title.z = 10
@title.opacity = 200
if CustomTitle::WAVY
@title.wave_amp = 8
@title.wave_length = 240
@title.wave_speed = 160#320
end
#Credit Image
@credits = Sprite.new
@credits.bitmap = Cache.picture(@ncredits)
@credits.x = Graphics.width / 2 - (@credits.width / 2)
@credits.y = 377
if CustomTitle::FALLING
# Leaves
@fall1 = Plane.new
@fall1.bitmap = Cache.picture(@nfall1)
@fall1.opacity = 130
@fall2 = Plane.new
@fall2.bitmap = Cache.picture(@nfall2)
@fall2.opacity = 100
@fall1.z = 9
@fall2.z = 11
end
end
#--------------------------------------------------------------------------
# Loading the database
#--------------------------------------------------------------------------
def load_database
$data_actors = load_data("Data/Actors.rvdata")
$data_classes = load_data("Data/Classes.rvdata")
$data_skills = load_data("Data/Skills.rvdata")
$data_items = load_data("Data/Items.rvdata")
$data_weapons = load_data("Data/Weapons.rvdata")
$data_armors = load_data("Data/Armors.rvdata")
$data_enemies = load_data("Data/Enemies.rvdata")
$data_troops = load_data("Data/Troops.rvdata")
$data_states = load_data("Data/States.rvdata")
$data_animations = load_data("Data/Animations.rvdata")
$data_common_events = load_data("Data/CommonEvents.rvdata")
$data_system = load_data("Data/System.rvdata")
$data_areas = load_data("Data/Areas.rvdata")
end
#--------------------------------------------------------------------------
# Loads the database for the test battle
#--------------------------------------------------------------------------
def load_bt_database
$data_actors = load_data("Data/BT_Actors.rvdata")
$data_classes = load_data("Data/BT_Classes.rvdata")
$data_skills = load_data("Data/BT_Skills.rvdata")
$data_items = load_data("Data/BT_Items.rvdata")
$data_weapons = load_data("Data/BT_Weapons.rvdata")
$data_armors = load_data("Data/BT_Armors.rvdata")
$data_enemies = load_data("Data/BT_Enemies.rvdata")
$data_troops = load_data("Data/BT_Troops.rvdata")
$data_states = load_data("Data/BT_States.rvdata")
$data_animations = load_data("Data/BT_Animations.rvdata")
$data_common_events = load_data("Data/BT_CommonEvents.rvdata")
$data_system = load_data("Data/BT_System.rvdata")
end
#--------------------------------------------------------------------------
# Creation of game objects
#--------------------------------------------------------------------------
def create_game_objects
$game_temp = Game_Temp.new
$game_message = Game_Message.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.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
end
#--------------------------------------------------------------------------
# Verifies that there are saves
#--------------------------------------------------------------------------
def check_continue
@continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
end
#--------------------------------------------------------------------------
# Checks for the starting position
#--------------------------------------------------------------------------
def confirm_player_location
if $data_system.start_map_id == 0
print "The starting position has not been set!"
exit
end
end
#--------------------------------------------------------------------------
# Command: New Game
#--------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Setup the initial party
$game_map.setup($data_system.start_map_id) # Set the initial map and position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(1500)
Graphics.fadeout(120)
Graphics.wait(60)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#--------------------------------------------------------------------------
# Command: Continue
#--------------------------------------------------------------------------
def command_continue
if @continue_enabled
Sound.play_decision
$scene = Scene_File.new(false, true, false)
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# Command: Exit
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
# Play the title music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# Battle Test
#--------------------------------------------------------------------------
def battle_test
load_bt_database # Loads the database for the test
create_game_objects # Create the game objects
Graphics.frame_count = 0 # Initialize frame count
$game_party.setup_battle_test_members
$game_troop.setup($data_system.test_troop_id)
$game_troop.can_escape = true
$game_system.battle_bgm.play
snapshot_for_background
$scene = Scene_Battle.new
end
end
1.Jeżeli używasz skryptu w grze(dla celów komercyjnych) będzie cie to kosztować 1dolar'a
2.Jeżeli link wygasł proszę powiadomić mnie albo autra
Autor:
TheRexion
Tłumaczenie:
isDaViT
Kompatybilność:
RPG Maker VX
Skrypt:
Spoiler:
Kod:
[spoiler]##############################################################
# Discovery Title Screen
#
# Script By TheRexion/Rekx
# Program: Rpg Maker VX
# Language: RGSS2
#
# Credits to:
# Johnny Mercy
##############################################################
# Class SceneTitle
##############################################################
module CustomTitle
# Falling objects on or off
FALLING = true
# Three options side by side or three on top of each other
STYLE = 2 # 1 or 2
# 1 = Left Aligned, 2 = Centered, 3 = Right Aligned. Only applies for Style 2
PLACEMENT = 1
# Would you like the title image to be wavy?
WAVY = true
# Screen Resolution
# ONLY needed if you're using Center Aligned
RESO = 544
# How quickly things fade in and out
# I recommend 5 - 30, anything else is too slow or too fast.
FADE_DURATION = 7
# How fast menu items slide
# ONLY VALID IN PLACEMENTS 1 AND 3 WITH STYLE 2 ACTIVATED
# For this, I recommend 3 - 15.
SLIDE_SPEED = 3
# The transparency of the menu items
HOVER = 225
INACTIVE = 50
# Automatically change the menu input keys when the style changes?
AUTO_CONTROL_CHANGE = true
# If AUTO_CONTROL_CHANGE = false, which do you want active?
UP_DOWN = true
LEFT_RIGHT = true
end
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# Processo principal
#--------------------------------------------------------------------------
def main
if $BTEST
battle_test
else
super
end
end
#--------------------------------------------------------------------------
# Initialize the process
#--------------------------------------------------------------------------
def start
# Name of the background image
$up = true
@nBgImage = "title_bg"
# Name of the leaves
@nfall1 = "fall1"
@nfall2 = "fall2"
# Name of the menu items used in the title
@nnew_game = "new_game"
@ncontinue = "continue"
@nexit = "exit"
# Name of the title image
@ntitle = "title_image"
# Name of the credits image
@ncredits = "credits"
#----------------------------------------------------------------------
# End of configuration
#----------------------------------------------------------------------
@menu_index = 0
load_images()
end
#--------------------------------------------------------------------------
# Screen Update
#--------------------------------------------------------------------------
def update
current_menu_index()
falling_animation() if CustomTitle::FALLING
keyboard_input()
@title.update
end
#--------------------------------------------------------------------------
# End the process
#--------------------------------------------------------------------------
def terminate
@bg.dispose
@new_game.dispose
@continue.dispose
@exit.dispose
@title.dispose
@credits.dispose
@fall1.dispose if CustomTitle::FALLING
@fall2.dispose if CustomTitle::FALLING
end
#--------------------------------------------------------------------------
# Keyboard Input
#--------------------------------------------------------------------------
def keyboard_input
if CustomTitle::AUTO_CONTROL_CHANGE
case CustomTitle::STYLE
when 1
if Input.trigger?(Input::RIGHT) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::RIGHT) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
when 2
# Up and down keys
if Input.trigger?(Input::DOWN) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::DOWN) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
else
print "STYLE has an incorrect value!"
exit
end
else
if CustomTitle::UP_DOWN
# Up and down keys
if Input.trigger?(Input::DOWN) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::DOWN) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::UP) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
end
if CustomTitle::LEFT_RIGHT
if Input.trigger?(Input::RIGHT) and @menu_index < 2
@menu_index += 1
Sound.play_cursor
elsif Input.trigger?(Input::RIGHT) and @menu_index == 2
@menu_index = 0
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index > 0
@menu_index -= 1
Sound.play_cursor
elsif Input.trigger?(Input::LEFT) and @menu_index == 0
@menu_index = 2
Sound.play_cursor
end
end
end
if Input.trigger?(Input::C)
case @menu_index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# Animates the leaves
#--------------------------------------------------------------------------
def falling_animation
@fall2.ox += 2
@fall2.oy -= 1
@fall1.ox -= 1
@fall1.oy -= 1
end
#--------------------------------------------------------------------------
# Updates the menu
#--------------------------------------------------------------------------
def current_menu_index
if CustomTitle::PLACEMENT == 1
$MOVE = (Graphics.width / 3 - 165) - 10
$NOMOVE = (Graphics.width / 3 - 165) + 30
elsif CustomTitle::PLACEMENT == 3
$MOVE = (Graphics.width - @new_game.width - 15) + 10
$NOMOVE = (Graphics.width - @new_game.width - 15) - 30
else
$NOMOVE = CustomTitle::RESO / 3 + 19
$MOVE = CustomTitle::RESO / 3 + 19
end
a = CustomTitle::HOVER
b = CustomTitle::INACTIVE
case @menu_index
when 0
menu_opacity(a,b,b)
if CustomTitle::STYLE == 2
menu_slide($NOMOVE,$MOVE,$MOVE)
#menu_slide(30,-10,-10) if CustomTitle::PLACEMENT == 2
end
when 1
if @continue_enabled
menu_opacity(b,a,b)
else
menu_opacity(b,20,b)
end
if CustomTitle::STYLE == 2
menu_slide($MOVE,$NOMOVE,$MOVE)
end
when 2
menu_opacity(b,b,a)
if CustomTitle::STYLE == 2
menu_slide($MOVE,$MOVE,$NOMOVE)
end
end
end
#--------------------------------------------------------------------------
# Sets the opacity of the menu items
#--------------------------------------------------------------------------
def menu_opacity(a,b,c)
CustomTitle::FADE_DURATION.times {
@new_game.opacity -= 1 if @new_game.opacity > a
@new_game.opacity += 1 if @new_game.opacity < a
@new_game.update
break if @new_game.opacity == a
}
CustomTitle::FADE_DURATION.times {
@continue.opacity -= 1 if @continue.opacity > b
@continue.opacity += 1 if @continue.opacity < b
@continue.update
break if @continue.opacity == b
}
CustomTitle::FADE_DURATION.times {
@exit.opacity -= 1 if @exit.opacity > c
@exit.opacity += 1 if @exit.opacity < c
@exit.update
break if @exit.opacity == c
}
@title.update
end
#--------------------------------------------------------------------------
# Slide the menu button
#--------------------------------------------------------------------------
def menu_slide(a, b, c)
CustomTitle::SLIDE_SPEED.times {
@new_game.x -= 1 if @new_game.x > a
@new_game.x += 1 if @new_game.x < a
@new_game.update
break if @new_game.x == a
}
CustomTitle::SLIDE_SPEED.times {
@continue.x -= 1 if @continue.x > b
@continue.x += 1 if @continue.x < b
@continue.update
break if @continue.x == b
}
CustomTitle::SLIDE_SPEED.times {
@exit.x -= 1 if @exit.x > c
@exit.x += 1 if @exit.x < c
@exit.update
break if @exit.x == c
}
end
#--------------------------------------------------------------------------
# Loads the images used in the title screen
#--------------------------------------------------------------------------
def load_images
#Background
@bg = Sprite.new
@bg.bitmap = Cache.picture(@nBgImage)
#Menu
@new_game = Sprite.new
@new_game.bitmap = Cache.picture(@nnew_game)
if CustomTitle::STYLE == 2
@new_game.y = 288
if CustomTitle::PLACEMENT == 1
@new_game.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@new_game.x = Graphics.width / 3 + 19
else
@new_game.x = Graphics.width - @new_game.width - 15
end
elsif CustomTitle::STYLE == 1
@new_game.x = Graphics.width / 3 - 165
@new_game.y = 338
end
@continue = Sprite.new
@continue.bitmap = Cache.picture(@ncontinue)
if CustomTitle::STYLE == 2
#@continue.x = -10
@continue.y = 318
if CustomTitle::PLACEMENT == 1
@continue.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@continue.x = Graphics.width / 3 + 19
else
@continue.x = Graphics.width - @continue.width - 15
end
elsif CustomTitle::STYLE == 1
@continue.x = Graphics.width / 3 + 19
@continue.y = 338
end
@continue.opacity = 100
@exit = Sprite.new
@exit.bitmap = Cache.picture(@nexit)
if CustomTitle::STYLE == 2
#@exit.x = -10
@exit.y = 348
if CustomTitle::PLACEMENT == 1
@exit.x = Graphics.width / 3 - 165
elsif CustomTitle::PLACEMENT == 2
@exit.x = Graphics.width / 3 + 19
else
@exit.x = Graphics.width - @exit.width - 15
end
elsif CustomTitle::STYLE == 1
@exit.x = Graphics.width - @exit.width - 15
@exit.y = 338
end
@exit.opacity = 100
@title = Sprite.new
@title.bitmap = Cache.picture(@ntitle)
@title.x = Graphics.width / 2 - @title.width / 2
@title.y = 3
@title.z = 10
@title.opacity = 200
if CustomTitle::WAVY
@title.wave_amp = 8
@title.wave_length = 240
@title.wave_speed = 160#320
end
#Credit Image
@credits = Sprite.new
@credits.bitmap = Cache.picture(@ncredits)
@credits.x = Graphics.width / 2 - (@credits.width / 2)
@credits.y = 377
if CustomTitle::FALLING
# Leaves
@fall1 = Plane.new
@fall1.bitmap = Cache.picture(@nfall1)
@fall1.opacity = 130
@fall2 = Plane.new
@fall2.bitmap = Cache.picture(@nfall2)
@fall2.opacity = 100
@fall1.z = 9
@fall2.z = 11
end
end
#--------------------------------------------------------------------------
# Loading the database
#--------------------------------------------------------------------------
def load_database
$data_actors = load_data("Data/Actors.rvdata")
$data_classes = load_data("Data/Classes.rvdata")
$data_skills = load_data("Data/Skills.rvdata")
$data_items = load_data("Data/Items.rvdata")
$data_weapons = load_data("Data/Weapons.rvdata")
$data_armors = load_data("Data/Armors.rvdata")
$data_enemies = load_data("Data/Enemies.rvdata")
$data_troops = load_data("Data/Troops.rvdata")
$data_states = load_data("Data/States.rvdata")
$data_animations = load_data("Data/Animations.rvdata")
$data_common_events = load_data("Data/CommonEvents.rvdata")
$data_system = load_data("Data/System.rvdata")
$data_areas = load_data("Data/Areas.rvdata")
end
#--------------------------------------------------------------------------
# Loads the database for the test battle
#--------------------------------------------------------------------------
def load_bt_database
$data_actors = load_data("Data/BT_Actors.rvdata")
$data_classes = load_data("Data/BT_Classes.rvdata")
$data_skills = load_data("Data/BT_Skills.rvdata")
$data_items = load_data("Data/BT_Items.rvdata")
$data_weapons = load_data("Data/BT_Weapons.rvdata")
$data_armors = load_data("Data/BT_Armors.rvdata")
$data_enemies = load_data("Data/BT_Enemies.rvdata")
$data_troops = load_data("Data/BT_Troops.rvdata")
$data_states = load_data("Data/BT_States.rvdata")
$data_animations = load_data("Data/BT_Animations.rvdata")
$data_common_events = load_data("Data/BT_CommonEvents.rvdata")
$data_system = load_data("Data/BT_System.rvdata")
end
#--------------------------------------------------------------------------
# Creation of game objects
#--------------------------------------------------------------------------
def create_game_objects
$game_temp = Game_Temp.new
$game_message = Game_Message.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.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
end
#--------------------------------------------------------------------------
# Verifies that there are saves
#--------------------------------------------------------------------------
def check_continue
@continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
end
#--------------------------------------------------------------------------
# Checks for the starting position
#--------------------------------------------------------------------------
def confirm_player_location
if $data_system.start_map_id == 0
print "The starting position has not been set!"
exit
end
end
#--------------------------------------------------------------------------
# Command: New Game
#--------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Setup the initial party
$game_map.setup($data_system.start_map_id) # Set the initial map and position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(1500)
Graphics.fadeout(120)
Graphics.wait(60)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#--------------------------------------------------------------------------
# Command: Continue
#--------------------------------------------------------------------------
def command_continue
if @continue_enabled
Sound.play_decision
$scene = Scene_File.new(false, true, false)
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# Command: Exit
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
# Play the title music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# Battle Test
#--------------------------------------------------------------------------
def battle_test
load_bt_database # Loads the database for the test
create_game_objects # Create the game objects
Graphics.frame_count = 0 # Initialize frame count
$game_party.setup_battle_test_members
$game_troop.setup($data_system.test_troop_id)
$game_troop.can_escape = true
$game_system.battle_bgm.play
snapshot_for_background
$scene = Scene_Battle.new
end
end
Loki - Czw 26 Lip, 2012 10:35 Bardzo dobry skrypt, sam też go używam