Project1
标题:
关于AVG游戏制作
[打印本页]
作者:
包子天空
时间:
2010-7-24 01:56
标题:
关于AVG游戏制作
本帖最后由 包子天空 于 2010-7-28 19:33 编辑
看来不问一下还真解决不了
如果看到我的账号应该知道我是这里潜水多年的老人了
那么言归正传
本包最近在制作一款AVG游戏 有了一些雏形
但是在脚本方面出了些问题
我参考了咱们这里的 AVG精装版1.05
发现有些脚本要用 但是不能直接拿过来用 特此需要解决几点问题
望各位出手想住 本包感激不尽
1.按CTRL跳过对话的脚本,谁给我提取出来一个不冲突的,在什么地方都能用的。自己不会C++ 抱歉
2.同样是脚本问题,我用了鼠标脚本,但是鼠标右键脚本没有 但是不知道在对话中鼠标右键出菜单 那个脚本怎么弄
3.我设置了地图名出现,然后让玩家知道自己在什么章节,但是我想在存档中看到地图名,这个怎么设置
目前没有CG 不准备弄CG系统 等游戏渐渐成熟再说
那么拜托各位了
作者:
逸豫
时间:
2010-7-24 19:13
你直接用AVG精装版不就行了= =|||
AVG精装版的章节是利用物品的名称……
作者:
包子天空
时间:
2010-7-24 20:21
我不想用那个…… 感觉很多东西没用 这是其一
其二 我已经做了游戏了,现在再用那个东西有些东西会冲突
其三 难道就不能告诉我怎么存档的时候告诉你你在哪个地图?
夏娜酱答非所问了
作者:
逸豫
时间:
2010-7-24 21:02
本帖最后由 逸豫 于 2010-7-24 21:04 编辑
咱不是夏娜酱……只是同用灼眼的夏娜里的人物罢了……
#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
# 显示存档以及读档画面、保存文件的窗口。
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :filename # 文件名
attr_reader :selected # 选择状态
#--------------------------------------------------------------------------
# ● 初始化对像
# file_index : 存档文件的索引 (0~3)
# filename : 文件名
#--------------------------------------------------------------------------
def initialize(file_index, filename)
super(0, 64 + file_index % 4 * 104, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
@file_index = file_index
@filename = "Save#{@file_index + 1}.rxdata"
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@game_system = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@game_self_switches = Marshal.load(file)
@game_screen = Marshal.load(file)
@game_actors = Marshal.load(file)
@game_party = Marshal.load(file)
@game_troop = Marshal.load(file)
@game_map = Marshal.load(file)
@game_player = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
file.close
end
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 描绘文件编号
self.contents.font.color = normal_color
name = "文件 #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
# 存档文件存在的情况下
if @file_exist
# 描绘角色
self.contents.draw_text(4, 8, 200, 32, $data_mapinfos[@game_map.map_id].name, 2)
for i in
[email protected]
bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
# 描绘游戏时间
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
# 描绘时间标记
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
#--------------------------------------------------------------------------
# ● 设置选择状态
# selected : 新的选择状态 (true=选择 false=不选择)
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor_rect
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
if @selected
self.cursor_rect.set(0, 0, @name_width + 8, 32)
else
self.cursor_rect.empty
end
end
end
复制代码
59行坐标自己调整
默认鼠标右键映射为按下ESC
不知道你用什么对话脚本,提供一下吧……
作者:
包子天空
时间:
2010-7-24 21:29
本帖最后由 包子天空 于 2010-7-24 21:34 编辑
我没有对话脚本 用的是默认的脚本
还有 我做的是AVG游戏 文本中及时存档怎么设置
好像是强制中断什么的 不是太懂 请说明 辛苦了
作者:
逸豫
时间:
2010-7-24 21:51
本帖最后由 逸豫 于 2010-7-25 21:34 编辑
今天晚上困了……占楼,明天编辑……
[line]1[/line]
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 处理地图画面的类。
#==============================================================================
class Scene_Map
=begin
def start_input(actor_id = 1,v = Viewport.new(160,230,320,20))
@actor_id = actor_id
@v = v
# @v.color.set(255,255,255,120)
@tf = Type_Field.new(@v,$game_actors[actor_id].name,16)
end
def end_input(name,change = true)
$game_actors[@actor_id].name = name if change
@v.dispose
@tf.dispose
@tf = nil
@v = nil
end
=end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成活动块
@spriteset = Spriteset_Map.new
# 生成信息窗口
@message_window = Window_Message.new
#菜单框图片背景
# @Cbg = Sprite.new
# @Cbg.bitmap = Bitmap.new("Graphics/Pictures/菜单")
# @Cbg.opacity = 200
# @Cbg.visible = false
# @Cbg.x = 400
# @Cbg.y = 120
# @Cbg.z = 300
# ——增加对话菜单—— #BB
s1 = "存储进度"
s2 = "读取进度"
# s3 = "对话回顾"
s4 = "返回标题"
s5 = "退出游戏"
@menu_window = Window_Command.new(120,[s1, s4, s5])
@menu_window.active = false
@menu_window.visible = false
@menu_window.back_opacity = 160
@menu_window.x = 430
@menu_window.y = 130
@menu_window.z = 9999
# ——增加对话菜单——
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放活动块
@spriteset.dispose
# 释放信息窗口
@message_window.dispose
# 释放菜单窗口#AVG
@menu_window.dispose
#@Cbg.dispose
# 标题画面切换中的情况下
if $scene.is_a?(Scene_Title)
# 淡入淡出画面
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
#@menu_window.disable_item(5) if $game_temp.message_window_showing
# 输入法活动中返回
#if @tf != nil and @tf.active
# @tf.update
# return
#end
# 循环
loop do
# 按照地图、实例、主角的顺序刷新
# (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动
# 的机会的重要因素)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# 系统 (计时器)、画面刷新
$game_system.update
$game_screen.update
# 如果主角在场所移动中就中断循环
unless $game_temp.player_transferring
break
end
# 执行场所移动
transfer_player
# 处理过渡中的情况下、中断循环
if $game_temp.transition_processing
break
end
end
# 刷新活动块
@spriteset.update
# 刷新菜单窗口,如果窗口活动则刷新指令信息 #BB
@menu_window.update
if @menu_window.active
update_command
return
end
# 刷新信息窗口
@message_window.update
# 游戏结束的情况下
if $game_temp.gameover
# 切换的游戏结束画面
$scene = Scene_Gameover.new
return
end
# 返回标题画面的情况下
if $game_temp.to_title
# 切换到标题画面
$scene = Scene_Title.new
return
end
# 处理过渡中的情况下
if $game_temp.transition_processing
# 清除过渡处理中标志
$game_temp.transition_processing = false
# 执行过渡
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# 显示信息窗口中的情况下
if $game_temp.message_window_showing
#return
end
# 遇敌计数为 0 且、且遇敌列表不为空的情况下
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# 不是在事件执行中或者禁止遇敌中
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# 确定队伍
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# 队伍有效的话
if $data_troops[troop_id] != nil
# 设置调用战斗标志
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# ——按ESC键呼出菜单窗口——
#禁示菜单为22号开关#AVG
unless $game_switches[22] == true
@menu_window.visible = !@menu_window.visible
@menu_window.active = !@menu_window.active
#@Cbg.visible =
[email protected]
end
end
# 调试模式为 ON 并且按下 F9 键的情况下
if $DEBUG and Input.press?(Input::F9)
# 设置调用调试标志
$game_temp.debug_calling = true
end
# 不在主角移动中的情况下
unless $game_player.moving?
# 执行各种画面的调用
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (菜单窗口被激活的情况下) #BB
#--------------------------------------------------------------------------
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
@menu_window.visible = false
@menu_window.active = false
#@Cbg.visible = false
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
##$game_system.save_backlog = $game_system.backlog.pop
#BB:把backlog的最后一单元砍去,存到save_backlog里
#这样既解决重复录入对话的问题又解决了存档部分要提示对话的问题
#$game_system.backlog_line -= $backlog_line unless $game_system.backlog_line == 0 #BB:扣除多录入的对话
#$game_system.map_interpreter.index -= 1 unless $game_system.map_interpreter.index <= 0 #BB:事件解释器index往前跳
#while($game_system.map_interpreter.list[$game_system.map_interpreter.index].code == 401)
# $game_system.map_interpreter.index -= 1
#end
# 命令窗口的光标位置分支
case @menu_window.index
when 0 # 存储进度
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
@menu_window.visible = false
@menu_window.active = false
# @Cbg.visible = false
# $Mbg.visible = false
# 切换到存档画面
$game_temp.save_calling = true
call_save
#when 1 # 读取进度
# 演奏确定 SE
# $game_system.se_play($data_system.decision_se)
# @menu_window.visible = false
# @menu_window.active = false
# @Cbg.visible = false
#$Mbg.visible = false
# 切换到读取画面
# $scene = Scene_Load.new
# when 2 # 对话回顾
# 演奏确定 SE
#$game_system.se_play($data_system.decision_se)
#@menu_window.visible = false
#@menu_window.active = false
#@Cbg.visible = false
#$Mbg.visible = false
# 切换到对话回顾画面
#$scene = Scene_Backlog.new
when 1 # 返回标题
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
@menu_window.visible = false
@menu_window.active = false
#@Cbg.visible = false
# $Mbg.visible = false
# 切换到标题
$scene = Scene_Title.new
when 2 # 退出游戏
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
@menu_window.visible = false
@menu_window.active = false
#@Cbg.visible = false
#$Mbg.visible = false
# 切换到退出游戏画面
$scene = nil
end
return
end
end
#--------------------------------------------------------------------------
# ● 调用战斗
#--------------------------------------------------------------------------
def call_battle
# 清除战斗调用标志
$game_temp.battle_calling = false
# 清除菜单调用标志
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# 生成遇敌计数
$game_player.make_encounter_count
# 记忆地图 BGM 、停止 BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# 演奏战斗开始 SE
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 矫正主角姿势
$game_player.straighten
# 切换到战斗画面
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# ● 调用商店
#--------------------------------------------------------------------------
def call_shop
# 清除商店调用标志
$game_temp.shop_calling = false
# 矫正主角姿势
$game_player.straighten
# 切换到商店画面
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# ● 调用名称输入
#--------------------------------------------------------------------------
def call_name
# 清除商店调用名称输入标志
$game_temp.name_calling = false
# 矫正主角姿势
$game_player.straighten
# 切换到名称输入画面
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# ● 调用菜单
#--------------------------------------------------------------------------
def call_menu
# 清除商店调用菜单标志
$game_temp.menu_calling = false
# 已经设置了菜单 SE 演奏标志的情况下
if $game_temp.menu_beep
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 清除菜单演奏 SE 标志
$game_temp.menu_beep = false
end
# 矫正主角姿势
$game_player.straighten
# 切换到菜单画面
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# ● 调用存档
#--------------------------------------------------------------------------
def call_save
# 矫正主角姿势
$game_player.straighten
# 切换到存档画面
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# ● 调用调试
#--------------------------------------------------------------------------
def call_debug
# 清除商店调用调试标志
$game_temp.debug_calling = false
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 矫正主角姿势
$game_player.straighten
# 切换到调试画面
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# ● 主角的场所移动
#--------------------------------------------------------------------------
def transfer_player
# 清除主角场所移动调试标志
$game_temp.player_transferring = false
# 移动目标与现在的地图有差异的情况下
if $game_map.map_id != $game_temp.player_new_map_id
# 设置新地图
$game_map.setup($game_temp.player_new_map_id)
end
# 设置主角位置
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# 设置主角朝向
case $game_temp.player_new_direction
when 2 # 下
$game_player.turn_down
when 4 # 左
$game_player.turn_left
when 6 # 右
$game_player.turn_right
when 8 # 上
$game_player.turn_up
end
# 矫正主角姿势
$game_player.straighten
# 刷新地图 (执行并行事件)
$game_map.update
# 在生成活动块
@spriteset.dispose
@spriteset = Spriteset_Map.new
# 处理过渡中的情况下
if $game_temp.transition_processing
# 清除过渡处理中标志
$game_temp.transition_processing = false
# 执行过渡
Graphics.transition(20)
end
# 执行地图设置的 BGM、BGS 的自动切换
$game_map.autoplay
# 设置画面
Graphics.frame_reset
# 刷新输入信息
Input.update
end
end
class Window_Message
alias bztk_update update
def update
if @input_number_window == nil and $game_temp.choice_max == 0
terminate_message if Input.repeat?(Input::CTRL)
end
bztk_update
end
end
复制代码
咱可是很守信用的,春原君
作者:
包子天空
时间:
2010-7-25 20:53
恩…… 还没好么……
作者:
包子天空
时间:
2010-7-27 12:37
多谢脚本 可是脚本还是有些问题
1.存读档时有BUG…… 用键盘的光标会定住 只能用鼠标存档 不过无所谓了
2.按键过的时候怎么改一下停止SE演奏?因为我的那个AVG有声优加盟的
3.按键速度过快了吧 不过无所谓了 如果可以的话 慢一点的话就更好了
4.在右键的菜单栏一加入一项快进如何?快进到选项 跟CLANNAD一样
5.存档的时候文字位置不对 改的话怎么改 还有 存档页里有那个文件1234 能去掉么?
还有,感激不尽。当然如果忙可以先无视下…… 反正我不是太急的 多谢了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1