Project1
标题:
在标题中加入新选项的问题
[打印本页]
作者:
Turtle
时间:
2009-9-27 16:17
标题:
在标题中加入新选项的问题
本帖最后由 Turtle 于 2009-10-2 15:59 编辑
用了图片显示标题。。
并整合了跳过标题画面脚本。。
想在标题选项中在添加一个特别篇选项。。
不知道在哪里添加。。。。。
自己不会脚本
#==============================================================================
# ■ 高自由度设定 图片标题菜单 动态标题画面 闪烁文字 整合
#
# §§ 简称:高自由度 整合 标题画面设置
#------------------------------------------------------------------------------
# 整合作者:TERENCE (龙皇)
#
# 图片标题菜单:By chaochao From 幻想森林论坛
# http://rpg.blue/web/htm/news167.htm
#
# 动态标题画面(流星雨版):By 柳柳
# http://rpg.blue/web/htm/news92.htm
#
# 闪烁标题脚本:未知作者,来源日本
# http://rpg.blue/web/htm/news107.htm
#==============================================================================
class Scene_Title
## ===================== ↓自定义设置区↓ ===================== ##
#--------------------------------------------------------------------------
# ● 标题画面闪烁文字自定义设定
#--------------------------------------------------------------------------
TITLE_STR = "MT" # 闪烁文字
FONT_NAME = ["華康娃娃體","標楷體", "黑体", "楷体"]
# 字体列表,当玩家电脑没有安装第一种字体会顺序往下寻找第二种
FONT_SIZE = 10# 字体大小
FONT_BOLD = true # 加粗 ( true 是 / false 否 )
FONT_ITALIC = false # 斜体 ( true 是 / false 否 )
STR_COLOR = Color.new( 0,0,0 ) # 文字颜色
# 文字颜色可以參考此帖
# [增补功能]136种颜色表 By 禾西
# http://rpg.blue/forumTopicRead.asp?id=88854
# 查考数字的地方→ def self.pink(opacity = 255);new(***,***,***,opacity);end
# 查考颜色的地方→ def self.***(opacity........
DRAW_FRAME = true
# 文字是否勾边 ( true 是 / false 否 )
FRAME_COLOR = Color.new(255, 255, 255) # 勾边颜色
LOCATE_X = 390 # 闪烁文字 X 座标
LOCATE_Y = 140 # 闪烁文字 Y 座标
DRAW_X = 0 # X 座标修正値(相对中心)
DRAW_Y = -100 # Y 座标修正値(相对中心)
BLINK = true # 闪烁
#--------------------------------------------------------------------------
# ● 标题画面SE音效自定义设定
#--------------------------------------------------------------------------
Cursor_SE = "Audio/SE/decide.wav" # Title 游标音效SE 文件名 路径
Buzzer_SE = "Audio/SE/no_buy.wav" # Title 无效音效SE 文件名 路径
Decision_SE = "Audio/SE/decide3.wav" # Title 确定音效SE 文件名 路径
#--------------------------------------------------------------------------
# ● 图片标题菜单自定义常量及相关设定
#--------------------------------------------------------------------------
STAR1 = "Graphics/Pictures/002.png" # 游标没在 "开始游戏" 所显示图片 的路径
STAR2 = "Graphics/Pictures/001.png" # 游标位在 "开始游戏" 所显示图片 的路径
Start_x = 250 # 开始游戏 图片X座标 (P.S.原点是左上)
Start_y = 300 # 开始游戏 图片Y座标 (P.S.原点是左上)
CONTINUE1 = "Graphics/Pictures/004.png" # 游标没在 "读取进度" 所显示图片 的路径
CONTINUE2 = "Graphics/Pictures/003.png" # 游标位在 "读取进度" 所显示图片 的路径
Continue_x = 240 # 读取进度 图片X座标 (P.S.原点是左上)
Continue_y = 350 # 读取进度 图片Y座标 (P.S.原点是左上)
EXIT1 = "Graphics/Pictures/006.png" # 游标没在 "离开游戏" 所显示图片 的路径
EXIT2 = "Graphics/Pictures/005.png" # 游标位在 "离开游戏" 所显示图片 的路径
Exit_x = 240 # 离开游戏 图片X座标 ( P.S.原点是左上 )
Exit_y = 400 # 离开游戏 图片Y座标 ( P.S.原点是左上 )
TitleTable_opacity = 210 # 标题图片透明度
TitleTable_change = 10 # 标题图片透明度变化速度( 建议范围:10~30 )
#--------------------------------------------------------------------------
# ● 动态标题画面自定义常量及相关设定
#--------------------------------------------------------------------------
WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
MAXNUMBER = 10 # 天气图片数量
WEATHER_FILE = "Graphics/Pictures/Star.png" # 自定义图片路径
BLEND_TYPE = 0 # 合成方式(0:普通,1:加法,2:减法)
WEATHER_X = 0 # X方向每回合减少象素
WEATHER_Y = -1 # Y方向每回合减少象素
WEATHER_OPACITY = 0.5 # 每回合减低透明度
START_OPACITY = 200 # 出现时的透明度
RAND_X = 1200 # 随机X范围
RAND_Y = 600 # 随机Y范围
HEIGHT = 300 # 出现时候的屏幕Y
WIDTH = 0 # 出现时候的屏幕X
#--------------------------------------------------------------------------
# ● 题画面图片先后顺序设定 (值越大图片越上一层)
#--------------------------------------------------------------------------
TITLE_NAME_Z = 0 # 闪烁文字
CHAOCHAO_Z = 3 # 图片标题
WEATHER_Z = 1 # 动态天气
## ===================== ↑自定义设置区↑ ===================== ##
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
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.new
@sprite = [Sprite.new]
for i in 0..3
for j in 0..1
@sprite[i] = [Sprite.new]
@sprite[i][j] = Sprite.new
@sprite[i][j].opacity = 0
end
end
# 生成标题图形
@sprite[0][0].bitmap = RPG::Cache.title($data_system.title_name)
@sprite[0][0].opacity = 0
#开始游戏的图片
@sprite[1][0].bitmap = Bitmap.new(STAR1)
@sprite[1][1].bitmap = Bitmap.new(STAR2)
#继续游戏的图片
@sprite[2][0].bitmap = Bitmap.new(CONTINUE1)
@sprite[2][1].bitmap = Bitmap.new(CONTINUE2)
#结束游戏的图片
@sprite[3][0].bitmap = Bitmap.new(EXIT1)
@sprite[3][1].bitmap = Bitmap.new(EXIT2)
#图片位置 及 初始透明度
for j in 0..1
@sprite[1][j].opacity = 0
@sprite[1][j].x = Start_x
@sprite[1][j].y = Start_y
@sprite[1][j].z = CHAOCHAO_Z
@sprite[2][j].opacity = 0
@sprite[2][j].x = Continue_x
@sprite[2][j].y = Continue_y
@sprite[2][j].z = CHAOCHAO_Z
@sprite[3][j].opacity = 0
@sprite[3][j].x = Exit_x
@sprite[3][j].y = Exit_y
@sprite[3][j].z = CHAOCHAO_Z
end
#跳过标题----------------------------------------------------------
# 生成系统对像
$game_system = Game_System.new
# 进入事件显示LOGO,如果您不想在调试时总是显示LOGO就加上下一行中注释部分
if $show_logo # and !$DEBUG
# 设置标记变量保证下次回到标题画面不会再显示片头
$show_logo = false
# 重置测量游戏时间用的画面计数器
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
# 与真正的新游戏唯一不同就是将变量1设置一个标记值(暂用8764)
$game_variables[1]=8764
# 主角暂时是不能显示出来的……
$game_player.transparent = true
# 切换地图画面
$scene = Scene_Map.new
# 否则是默认显示标题画面
else
#到这里为止先执行动画再返回标题
### ↓生成动态标题画面相关图片↓ ###
@ox = 0
@oy = 0
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
# 生成雨
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
# 生成风
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
# 生成雪
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
# 使用自定义判别
for i in 1..40
sprite = Sprite.new
case WEATHER
when 1
sprite.bitmap = @rain_bitmap
when 2
sprite.bitmap = @storm_bitmap
when 3
sprite.bitmap = @snow_bitmap
when 4
sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = WEATHER_Z
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
weather_update
### ↑生成动态标题画面相关图片↑ ###
### ↓スプライトの作成↓ ###
@title_name_sprite = RPG::Sprite.new
@title_name_sprite.z = TITLE_NAME_Z
@title_name_sprite.opacity = 0
bitmap = Bitmap.new(32, 32)
bitmap.font.name = FONT_NAME
bitmap.font.size = FONT_SIZE
bitmap.font.bold = FONT_BOLD
rect = bitmap.text_size(TITLE_STR)
bitmap.dispose
bitmap = nil
@title_name_sprite.bitmap = Bitmap.new(rect.width, rect.height)
@title_name_sprite.bitmap.font.name = FONT_NAME
@title_name_sprite.bitmap.font.size = FONT_SIZE
@title_name_sprite.bitmap.font.bold = FONT_BOLD
@title_name_sprite.bitmap.font.italic = FONT_ITALIC
str = TITLE_STR
if DRAW_FRAME
@title_name_sprite.bitmap.font.color = FRAME_COLOR
if defined?(@title_name_sprite.bitmap.draw_text_plan_frame)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, str)
else
@title_name_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text(1, 1, rect.width, rect.height, str)
end
else
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text(rect, str)
end
@title_name_sprite.x = LOCATE_X
@title_name_sprite.y = LOCATE_Y
if BLINK
@title_name_sprite.blink_on
end
### ↑スプライトの作成↑ ###
# 判定读取进度的有效性
# 游戏存档一个也不存在的时候也调查
# 有效為 @continue_enabled 為 true、无效為 false
@continue_enabled = false
for i in 0..9
if FileTest.exist?("Save/Save#{i}.rxdata")
@continue_enabled = true
end
end
# 读取进度為有效的情况下、游标停止在读取进度上
# 无效的情况下、读取进度的文字显示為灰色
if @continue_enabled
@command_index = 1
else
@command_index = 0
@sprite[2][0].tone = Tone.new(0, 0, 0, 255)
@sprite[2][1].tone = Tone.new(0, 0, 0, 255)
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition
# 主循环
loop do
# 更新游戏画面
Graphics.update
#淡出背景图形 闪烁文字
if @sprite[0][0].opacity <= 255
@sprite[0][0].opacity += 15
@title_name_sprite.opacity += 15
end
# 更新输入讯息
Input.update
# 更新画面
update
# 如果画面被切换就中断循环
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放图片标题
for i in 0..3
for j in 0..1
unless i==0 and j==1
@sprite[i][j].bitmap.dispose
@sprite[i][j].dispose
end
end
end
# 释放天气图片
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
# スプライトの解放
@title_name_sprite.bitmap.dispose
@title_name_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
chaochaocommandchaochao
# スプライトの更新
@title_name_sprite.update
if Input.trigger?(Input::C)
case @command_index
when 0 # 新游戏
command_new_game
when 1 # 继续
command_continue
when 2 # 退出
command_shutdown
end
end
weather_update
end
#--------------------------------------------------------------------------
# ● 命令 : 新的游戏
#--------------------------------------------------------------------------
def command_new_game
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# 停止 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
Audio.se_play(Buzzer_SE,80,100)
return
end
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# 切换到读取画面
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ● 命令 : 结束游戏
#--------------------------------------------------------------------------
def command_shutdown
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# BGM、BGS、ME 的淡入淡出
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 结束游戏
$scene = nil
end
#--------------------------------------------------------------------------
# ● 刷新天气
#--------------------------------------------------------------------------
def weather_update
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites[i]
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 2
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 2
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
end
end
end
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
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
复制代码
作者:
白鬼
时间:
2009-9-27 16:33
你要改的地方太多了
而且,不是一次就能弄好的
你还是先把开篇都做好吧
包括newgame和特别篇的开场地图,都做好,然后发工程上来找人帮忙吧。
另外,你用了图片标题,那么你也要把素材做好(就是特别篇所需要的素材)
作者:
Turtle
时间:
2009-9-27 16:41
本帖最后由 Turtle 于 2009-9-27 16:42 编辑
只要添加一个选项。 选择那个选项进入的是和新的游戏那个不一样的地图就可以了。。。。
上面的地方就照原来的脚本加上新的选项。。
加好但是在选择的时候不显示特别篇的那个选项。。
那个应该是在这里设置的吧。。看了半天。。看不懂。。
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 2
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 2
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
end
end
end
end
复制代码
作者:
白鬼
时间:
2009-9-27 16:48
如果你只修改了3楼的这些东西,那有用才怪呢
你说的“特别篇”这个东西,应该在这里也定义一下。
是否仅在这里,我也不是很清楚,没仔细看,只是第一眼就看到这里了。
#--------------------------------------------------------------------------
# ● 图片标题菜单自定义常量及相关设定
#--------------------------------------------------------------------------
STAR1 = "Graphics/Pictures/002.png" # 游标没在 "开始游戏" 所显示图片 的路径
STAR2 = "Graphics/Pictures/001.png" # 游标位在 "开始游戏" 所显示图片 的路径
Start_x = 250 # 开始游戏 图片X座标 (P.S.原点是左上)
Start_y = 300 # 开始游戏 图片Y座标 (P.S.原点是左上)
CONTINUE1 = "Graphics/Pictures/004.png" # 游标没在 "读取进度" 所显示图片 的路径
CONTINUE2 = "Graphics/Pictures/003.png" # 游标位在 "读取进度" 所显示图片 的路径
Continue_x = 240 # 读取进度 图片X座标 (P.S.原点是左上)
Continue_y = 350 # 读取进度 图片Y座标 (P.S.原点是左上)
EXIT1 = "Graphics/Pictures/006.png" # 游标没在 "离开游戏" 所显示图片 的路径
EXIT2 = "Graphics/Pictures/005.png" # 游标位在 "离开游戏" 所显示图片 的路径
Exit_x = 240 # 离开游戏 图片X座标 ( P.S.原点是左上 )
Exit_y = 400 # 离开游戏 图片Y座标 ( P.S.原点是左上 )
TitleTable_opacity = 210 # 标题图片透明度
TitleTable_change = 10 # 标题图片透明度变化速度( 建议范围:10~30 )
复制代码
作者:
Turtle
时间:
2009-9-27 17:07
本帖最后由 Turtle 于 2009-9-28 09:38 编辑
下面是我改好的。。。(我是脚本盲。 完全照着例子上面加上去的。。在158行出错)
#==============================================================================
# ■ 高自由度设定 图片标题菜单 动态标题画面 闪烁文字 整合
#
# §§ 简称:高自由度 整合 标题画面设置
#------------------------------------------------------------------------------
# 整合作者:TERENCE (龙皇)
#
# 图片标题菜单:By chaochao From 幻想森林论坛
# http://rpg.blue/web/htm/news167.htm
#
# 动态标题画面(流星雨版):By 柳柳
# http://rpg.blue/web/htm/news92.htm
#
# 闪烁标题脚本:未知作者,来源日本
# http://rpg.blue/web/htm/news107.htm
#==============================================================================
class Scene_Title
## ===================== ↓自定义设置区↓ ===================== ##
#--------------------------------------------------------------------------
# ● 标题画面闪烁文字自定义设定
#--------------------------------------------------------------------------
TITLE_STR = "MT" # 闪烁文字
FONT_NAME = ["華康娃娃體","標楷體", "黑体", "楷体"]
# 字体列表,当玩家电脑没有安装第一种字体会顺序往下寻找第二种
FONT_SIZE = 10# 字体大小
FONT_BOLD = true # 加粗 ( true 是 / false 否 )
FONT_ITALIC = false # 斜体 ( true 是 / false 否 )
STR_COLOR = Color.new( 0,0,0 ) # 文字颜色
# 文字颜色可以參考此帖
# [增补功能]136种颜色表 By 禾西
# http://rpg.blue/forumTopicRead.asp?id=88854
# 查考数字的地方→ def self.pink(opacity = 255);new(***,***,***,opacity);end
# 查考颜色的地方→ def self.***(opacity........
DRAW_FRAME = true
# 文字是否勾边 ( true 是 / false 否 )
FRAME_COLOR = Color.new(255, 255, 255) # 勾边颜色
LOCATE_X = 390 # 闪烁文字 X 座标
LOCATE_Y = 140 # 闪烁文字 Y 座标
DRAW_X = 0 # X 座标修正値(相对中心)
DRAW_Y = -100 # Y 座标修正値(相对中心)
BLINK = true # 闪烁
#--------------------------------------------------------------------------
# ● 标题画面SE音效自定义设定
#--------------------------------------------------------------------------
Cursor_SE = "Audio/SE/decide.wav" # Title 游标音效SE 文件名 路径
Buzzer_SE = "Audio/SE/no_buy.wav" # Title 无效音效SE 文件名 路径
Decision_SE = "Audio/SE/decide3.wav" # Title 确定音效SE 文件名 路径
#--------------------------------------------------------------------------
# ● 图片标题菜单自定义常量及相关设定
#--------------------------------------------------------------------------
STAR1 = "Graphics/Pictures/002.png" # 游标没在 "开始游戏" 所显示图片 的路径
STAR2 = "Graphics/Pictures/001.png" # 游标位在 "开始游戏" 所显示图片 的路径
Start_x = 250 # 开始游戏 图片X座标 (P.S.原点是左上)
Start_y = 300 # 开始游戏 图片Y座标 (P.S.原点是左上)
CONTINUE1 = "Graphics/Pictures/004.png" # 游标没在 "读取进度" 所显示图片 的路径
CONTINUE2 = "Graphics/Pictures/003.png" # 游标位在 "读取进度" 所显示图片 的路径
Continue_x = 240 # 读取进度 图片X座标 (P.S.原点是左上)
Continue_y = 350 # 读取进度 图片Y座标 (P.S.原点是左上)
EXIT1 = "Graphics/Pictures/006.png" # 游标没在 "离开游戏" 所显示图片 的路径
EXIT2 = "Graphics/Pictures/005.png" # 游标位在 "离开游戏" 所显示图片 的路径
Exit_x = 240 # 离开游戏 图片X座标 ( P.S.原点是左上 )
Exit_y = 400 # 离开游戏 图片Y座标 ( P.S.原点是左上 )
TBB1 = "Graphics/Pictures/008.png" # 游标没在 "特别篇" 所显示图片 的路径
TBB2 = "Graphics/Pictures/007.png" # 游标位在 "特别篇" 所显示图片 的路径
Tbb_x = 240 # 特别篇 图片X座标 ( P.S.原点是左上 )
Tbb_y = 400 # 特别篇 图片Y座标 ( P.S.原点是左上 )
TitleTable_opacity = 210 # 标题图片透明度
TitleTable_change = 10 # 标题图片透明度变化速度( 建议范围:10~30 )
#--------------------------------------------------------------------------
# ● 动态标题画面自定义常量及相关设定
#--------------------------------------------------------------------------
WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
MAXNUMBER = 10 # 天气图片数量
WEATHER_FILE = "Graphics/Pictures/Star.png" # 自定义图片路径
BLEND_TYPE = 0 # 合成方式(0:普通,1:加法,2:减法)
WEATHER_X = 0 # X方向每回合减少象素
WEATHER_Y = -1 # Y方向每回合减少象素
WEATHER_OPACITY = 0.5 # 每回合减低透明度
START_OPACITY = 200 # 出现时的透明度
RAND_X = 1200 # 随机X范围
RAND_Y = 600 # 随机Y范围
HEIGHT = 300 # 出现时候的屏幕Y
WIDTH = 0 # 出现时候的屏幕X
#--------------------------------------------------------------------------
# ● 题画面图片先后顺序设定 (值越大图片越上一层)
#--------------------------------------------------------------------------
TITLE_NAME_Z = 0 # 闪烁文字
CHAOCHAO_Z = 3 # 图片标题
WEATHER_Z = 1 # 动态天气
## ===================== ↑自定义设置区↑ ===================== ##
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
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.new
@sprite = [Sprite.new]
for i in 0..4
for j in 0..1
@sprite[i] = [Sprite.new]
@sprite[i][j] = Sprite.new
@sprite[i][j].opacity = 0
end
end
# 生成标题图形
@sprite[0][0].bitmap = RPG::Cache.title($data_system.title_name)
@sprite[0][0].opacity = 0
#开始游戏的图片
@sprite[1][0].bitmap = Bitmap.new(STAR1)
@sprite[1][1].bitmap = Bitmap.new(STAR2)
#继续游戏的图片
@sprite[2][0].bitmap = Bitmap.new(CONTINUE1)
@sprite[2][1].bitmap = Bitmap.new(CONTINUE2)
#结束游戏的图片
@sprite[3][0].bitmap = Bitmap.new(EXIT1)
@sprite[3][1].bitmap = Bitmap.new(EXIT2)
#特别篇的图片
@sprite[4][0].bitmap = Bitmap.new(TBB1)
@sprite[4][1].bitmap = Bitmap.new(TBB2)
#图片位置 及 初始透明度
for j in 0..1
@sprite[1][j].opacity = 0
@sprite[1][j].x = Start_x
@sprite[1][j].y = Start_y
@sprite[1][j].z = CHAOCHAO_Z
@sprite[2][j].opacity = 0
@sprite[2][j].x = Continue_x
@sprite[2][j].y = Continue_y
@sprite[2][j].z = CHAOCHAO_Z
@sprite[3][j].opacity = 0
@sprite[3][j].x = Exit_x
@sprite[3][j].y = Exit_y
@sprite[3][j].z = CHAOCHAO_Z
@sprite[4][j].opacity = 0
@sprite[4][j].x = Tbb_x
@sprite[4][j].y = Tbb_y
@sprite[4][j].z = CHAOCHAO_Z
end
#跳过标题----------------------------------------------------------
# 生成系统对像
$game_system = Game_System.new
# 进入事件显示LOGO,如果您不想在调试时总是显示LOGO就加上下一行中注释部分
if $show_logo # and !$DEBUG
# 设置标记变量保证下次回到标题画面不会再显示片头
$show_logo = false
# 重置测量游戏时间用的画面计数器
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
# 与真正的新游戏唯一不同就是将变量1设置一个标记值(暂用8764)
$game_variables[1]=8764
# 主角暂时是不能显示出来的……
$game_player.transparent = true
# 切换地图画面
$scene = Scene_Map.new
# 否则是默认显示标题画面
else
#到这里为止先执行动画再返回标题
### ↓生成动态标题画面相关图片↓ ###
@ox = 0
@oy = 0
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
# 生成雨
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
# 生成风
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
# 生成雪
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
# 使用自定义判别
for i in 1..40
sprite = Sprite.new
case WEATHER
when 1
sprite.bitmap = @rain_bitmap
when 2
sprite.bitmap = @storm_bitmap
when 3
sprite.bitmap = @snow_bitmap
when 4
sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = WEATHER_Z
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
weather_update
### ↑生成动态标题画面相关图片↑ ###
### ↓スプライトの作成↓ ###
@title_name_sprite = RPG::Sprite.new
@title_name_sprite.z = TITLE_NAME_Z
@title_name_sprite.opacity = 0
bitmap = Bitmap.new(32, 32)
bitmap.font.name = FONT_NAME
bitmap.font.size = FONT_SIZE
bitmap.font.bold = FONT_BOLD
rect = bitmap.text_size(TITLE_STR)
bitmap.dispose
bitmap = nil
@title_name_sprite.bitmap = Bitmap.new(rect.width, rect.height)
@title_name_sprite.bitmap.font.name = FONT_NAME
@title_name_sprite.bitmap.font.size = FONT_SIZE
@title_name_sprite.bitmap.font.bold = FONT_BOLD
@title_name_sprite.bitmap.font.italic = FONT_ITALIC
str = TITLE_STR
if DRAW_FRAME
@title_name_sprite.bitmap.font.color = FRAME_COLOR
if defined?(@title_name_sprite.bitmap.draw_text_plan_frame)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, str)
else
@title_name_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, str)
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text(1, 1, rect.width, rect.height, str)
end
else
@title_name_sprite.bitmap.font.color = STR_COLOR
@title_name_sprite.bitmap.draw_text(rect, str)
end
@title_name_sprite.x = LOCATE_X
@title_name_sprite.y = LOCATE_Y
if BLINK
@title_name_sprite.blink_on
end
### ↑スプライトの作成↑ ###
# 判定读取进度的有效性
# 游戏存档一个也不存在的时候也调查
# 有效為 @continue_enabled 為 true、无效為 false
@continue_enabled = false
for i in 0..9
if FileTest.exist?("Save/Save#{i}.rxdata")
@continue_enabled = true
end
end
# 读取进度為有效的情况下、游标停止在读取进度上
# 无效的情况下、读取进度的文字显示為灰色
if @continue_enabled
@command_index = 1
else
@command_index = 0
@sprite[2][0].tone = Tone.new(0, 0, 0, 255)
@sprite[2][1].tone = Tone.new(0, 0, 0, 255)
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition
# 主循环
loop do
# 更新游戏画面
Graphics.update
#淡出背景图形 闪烁文字
if @sprite[0][0].opacity <= 255
@sprite[0][0].opacity += 15
@title_name_sprite.opacity += 15
end
# 更新输入讯息
Input.update
# 更新画面
update
# 如果画面被切换就中断循环
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放图片标题
for i in 0..4
for j in 0..1
unless i==0 and j==1
@sprite[i][j].bitmap.dispose
@sprite[i][j].dispose
end
end
end
# 释放天气图片
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
# スプライトの解放
@title_name_sprite.bitmap.dispose
@title_name_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
chaochaocommandchaochao
# スプライトの更新
@title_name_sprite.update
if Input.trigger?(Input::C)
case @command_index
when 0 # 新游戏
command_new_game
when 1 # 继续
command_continue
when 2 # 退出
command_shutdown
when 3 #特别篇
command_tbb
end
end
weather_update
end
#--------------------------------------------------------------------------
# ● 命令 : 新的游戏
#--------------------------------------------------------------------------
def command_new_game
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# 停止 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_Tbb
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# 停止 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(2)
# 主角向初期位置移动
$game_player.moveto(10,11)
# 更新主角
$game_player.refresh
# 执行地图设定的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 更新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 命令 : 读取进度
#--------------------------------------------------------------------------
def command_continue
# 继续无效的情况下
unless @continue_enabled
# 演奏无效 SE
Audio.se_play(Buzzer_SE,80,100)
return
end
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# 切换到读取画面
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ● 命令 : 结束游戏
#--------------------------------------------------------------------------
def command_shutdown
# 演奏确定 SE
Audio.se_play(Decision_SE,100,100)
# BGM、BGS、ME 的淡入淡出
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 结束游戏
$scene = nil
end
#--------------------------------------------------------------------------
# ● 刷新天气
#--------------------------------------------------------------------------
def weather_update
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites[i]
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 2
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 2
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
end
end
end
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
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
复制代码
作者:
well
时间:
2009-9-28 06:26
注意138行
for i in 0..3
i的范围0~3,你不修改这里。擅自加一个4,不错才出鬼了。
378销毁图片地方也要改。
此外563行以下。补全when 3 的内容。否则不会出错,只是没有选中特别篇后选项图片的变化。
作者:
Turtle
时间:
2009-9-28 09:36
本帖最后由 Turtle 于 2009-9-28 09:38 编辑
563行以下看不懂了。。。 照搬的改乜改不了- -。。
上面那些可以照着原句改
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 2
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 2
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
end
end
end
end
复制代码
作者:
well
时间:
2009-9-30 05:05
给你个参考
5#
well
就是分析一下when不同数字时各组图片的变化规律,复制一份,然后全体加入一组图片。
可以一点点改。这部分改错了也不至于出错跳出。顶多没效果罢了。
作者:
Turtle
时间:
2009-9-30 13:47
本帖最后由 Turtle 于 2009-10-2 13:21 编辑
嗯 - - 尝试加入一个when 3以后运行在when 3这一行出错.. 76...132:}
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 3
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 3
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
when 3
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
end
end
end
end
复制代码
作者:
well
时间:
2009-10-1 05:47
看得出来你是把when 2 复制了一份。这肯定是没效果的。每个分支下至少加上@sprite[4][0]和@sprite[4][1]。另外完全看不出为什么出错。错误提示是什么?有没有多个end少个end
作者:
Turtle
时间:
2009-10-1 11:17
本帖最后由 Turtle 于 2009-10-1 11:18 编辑
未命名.jpg
(14.8 KB, 下载次数: 2)
下载附件
保存到相册
2009-10-1 11:17 上传
这样子的 就在when 3的那一行出错.. 加了end或少end乜不行..
作者:
well
时间:
2009-10-2 04:50
syntax error十有八九是配套问题。而且多半显示位置在实际出错行之后。
So,仔细检查一下啊!(这句话吼出来)
when 3 上面就少个end
作者:
Turtle
时间:
2009-10-2 13:20
本帖最后由 Turtle 于 2009-10-2 14:16 编辑
把when 3上面的那个end加上以后就可以正常开始了...
感动的痛哭流涕.....
选择的时候虽然是看不到第四个选项..但是在第三个选项选下去之后下面还有选项在..
接下来就是设置显示了
-----------------------------------------------------------------------------------------
把上面的when设置复制了下....
已经可以选择和显示图片了...
#--------------------------------------------------------------------------
# ● 刷新选项
#--------------------------------------------------------------------------
def chaochaocommandchaochao
if Input.trigger?(Input::UP)
@command_index -= 1
if @command_index < 0
@command_index = 3
end
Audio.se_play(Cursor_SE,80,100)
end
if Input.trigger?(Input::DOWN)
@command_index += 1
if @command_index > 3
@command_index = 0
end
Audio.se_play(Cursor_SE,80,100)
end
case @command_index
when 0
if @sprite[1][0].opacity >= 0
@sprite[1][0].opacity -= TitleTable_change
end
if @sprite[1][1].opacity <= TitleTable_opacity #240
@sprite[1][1].opacity += TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
if @sprite[4][0].opacity <= TitleTable_opacity #240
@sprite[4][0].opacity += TitleTable_change #30
end
if @sprite[4][1].opacity >= 0
@sprite[4][1].opacity -= TitleTable_change #30
end
when 1
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity >= 0
@sprite[2][0].opacity -= TitleTable_change #30
end
if @sprite[2][1].opacity <= TitleTable_opacity #240
@sprite[2][1].opacity += TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
if @sprite[4][0].opacity <= TitleTable_opacity #240
@sprite[4][0].opacity += TitleTable_change #30
end
if @sprite[4][1].opacity >= 0
@sprite[4][1].opacity -= TitleTable_change #30
end
when 2
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity >= 0
@sprite[3][0].opacity -= TitleTable_change #30
end
if @sprite[3][1].opacity <= TitleTable_opacity #240
@sprite[3][1].opacity += TitleTable_change #30
end
if @sprite[4][0].opacity <= TitleTable_opacity #240
@sprite[4][0].opacity += TitleTable_change #30
end
if @sprite[4][1].opacity >= 0
@sprite[4][1].opacity -= TitleTable_change #30
end
when 3
if @sprite[1][0].opacity <= TitleTable_opacity #210
@sprite[1][0].opacity += TitleTable_change #30
end
if @sprite[1][1].opacity >= 0
@sprite[1][1].opacity -= TitleTable_change #30
end
if @sprite[2][0].opacity <= TitleTable_opacity #240
@sprite[2][0].opacity += TitleTable_change #30
end
if @sprite[2][1].opacity >= 0
@sprite[2][1].opacity -= TitleTable_change #30
end
if @sprite[3][0].opacity <= TitleTable_opacity #240
@sprite[3][0].opacity += TitleTable_change #30
end
if @sprite[3][1].opacity >= 0
@sprite[3][1].opacity -= TitleTable_change #30
end
if @sprite[4][0].opacity >= 0
@sprite[4][0].opacity -= TitleTable_change
end
if @sprite[4][1].opacity <= TitleTable_opacity #240
@sprite[4][1].opacity += TitleTable_change #30
end
end
end
end
end
复制代码
真的很感谢... 终于完成
认可答案
顺便问一下- - ...怎么把自己的经验加给别人
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1