Project1
标题:
怎样才能背景音乐一直播放
[打印本页]
作者:
1163833985
时间:
2012-1-18 17:48
标题:
怎样才能背景音乐一直播放
怎样才能让游戏开始菜单的背景音乐一直播放(换地图也继续播放,要没有瑕疵的) dsu_plus_rewardpost_czw
作者:
zeroorez
时间:
2012-1-21 23:52
标题:
音效
本帖最后由 zeroorez 于 2012-1-22 00:57 编辑
这个,下一张地图不设定音效的话,会沿用用前一张地图的音效的。就是这样的,绝对没瑕疵
作者:
八宝粥先生
时间:
2012-1-24 17:51
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# 这个类用来执行显示标题画面的程式。
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * 主程式
#--------------------------------------------------------------------------
def main
if $BTEST # 战斗测试?
battle_test # 开始战斗测试
else # 正常游戏
super # 正常执行主程式
end
end
#--------------------------------------------------------------------------
# * 程式开始
#--------------------------------------------------------------------------
def start
super
load_database # 加载数据库
create_game_objects # 创建游戏对象
check_continue # 读档可行性判定
create_title_graphic # 创建标题图形
create_command_window # 创建命令窗口
play_title_music # 播放标题画面BGM
end
#--------------------------------------------------------------------------
# * 执行画面过渡显示渐变
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(20)
end
#--------------------------------------------------------------------------
# * 程式开始后的处理
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * 程式终止前的处理
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * 终止程式
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
snapshot_for_background
dispose_title_graphic
end
#--------------------------------------------------------------------------
# * 更新帧
#--------------------------------------------------------------------------
def update
super
@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 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
#--------------------------------------------------------------------------
# * 读取数据(战斗测试用)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * 创建游戏对象
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * 读档可行性判定
#--------------------------------------------------------------------------
def check_continue
@continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
end
#--------------------------------------------------------------------------
# * 创建标题图形
#--------------------------------------------------------------------------
def create_title_graphic
@sprite = Sprite.new
@sprite.bitmap = Cache.system("Title")
end
#--------------------------------------------------------------------------
# * 清除标题图形
#--------------------------------------------------------------------------
def dispose_title_graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * 创建命令窗口
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::new_game
s2 = Vocab::continue
s3 = Vocab::shutdown
@command_window = Window_Command.new(172, [s1, s2, s3])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = 288
if @continue_enabled # 如果[读取存档]可用
@command_window.index = 1 # 移动光标至该命令项目上
else # 如果[读取存档]不可用
@command_window.draw_item(1, false) # 半透明显示该命令项目
end
@command_window.openness = 0
@command_window.open
end
#--------------------------------------------------------------------------
# * 清除命令窗口
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
end
#--------------------------------------------------------------------------
# * 展开命令窗口
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * 合拢命令窗口
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * 播放标题画面BGM
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# * 检查玩家起点事件块是否存在
#--------------------------------------------------------------------------
def confirm_player_location
if $data_system.start_map_id == 0
print "玩家起始位置没有被指定。"
exit
end
end
#--------------------------------------------------------------------------
# * 命令项目:新的剧情
#--------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$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
$scene = Scene_Map.new
close_command_window
Graphics.fadeout(60)
Graphics.wait(40)
Graphics.frame_count = 0
$game_map.autoplay
end
#--------------------------------------------------------------------------
# * 命令项目:读取存档
#--------------------------------------------------------------------------
def command_continue
if @continue_enabled
Sound.play_decision
$scene = Scene_File.new(false, true, false)
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# * 命令项目:退出游戏
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
# * 战斗测试
#--------------------------------------------------------------------------
def battle_test
load_bt_database # 从数据库中加载战斗测试所需数据
create_game_objects # 创建游戏对象
Graphics.frame_count = 0 # 初始化游戏时间
$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
复制代码
用这个把Scene_Title脚本替换掉,再把你游戏中所有地图BGM都设置为“无”,背景音乐就会从游戏开始菜单一直播放到地图画面。
作者:
yychchhh
时间:
2012-1-25 14:35
很简单。在你要开始播放BGM的地图上,
右键,地图属性,在左边自动切换BGM下设置
如此法设置,则该游戏中的主角一旦进入此场景,只要没有在其他地图设置“自动切换BGM”或在事件中切换BGM
无论该角色做了任何事情(战斗后BGM会继续播放),都不会改变该BGM(一旦被切换BGM,可以再返回地图又再次切换)
如想要在特定地区取消该BGM,只要在该地图的地图属性中,设置自动切换BGM(不要选择,只要打钩)就可以。
额……语言风格就是这样,三国杀的卡牌制作多了……
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1