赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 1 |
经验 | 1589 |
最后登录 | 2017-8-14 |
在线时间 | 454 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 51
- 在线时间
- 454 小时
- 注册时间
- 2012-7-31
- 帖子
- 579
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我今天在66RPG闲逛,突然发现一个VX的【显示游戏进度】的脚本,
但是我不会用啊。。。。
我试着在事件中写入脚本,但是没用啊。
以下是脚本:
#==============================================================================
# ■ 显示进度脚本 by StarWatcher
#------------------------------------------------------------------------------
# 1-插入此段脚本到Main前面
# 2-仔细设置下面的变量
# 3-启用方式$Scene=Scene_Progress.new
# 4-如果有其他什么问题(如何插入菜单)请自行寻找教程
#==============================================================================
#==============================================================================
# ■ Scene_Progress
#------------------------------------------------------------------------------
# 显示进度的脚本
#==============================================================================
class Scene_Progress<Scene_Base
def initialize(menu_index = 0)
#下面设置返回菜单的选项序号
$backindex=5
#下面设置的是如何返回,false返回菜单,true返回地图
$FromMap=false
#下面设置总共进度的选项卡数
$MaxIndex=5
#下面设置控制游戏进度的变量号
$UseIndex=101
#介绍:变量的值-1为什么都没有达成
#0..x则分别达成了1~x+1的进度
#下面的请无视他
$indexer=0
$ConIndex=0
#下面设置每一个进度的名称
#=后面格式["进度1内容","进度2内容","进度3内容"……]
$ChapNa=["序章:启程","第一章:中品法师考试"]
#下面设置每一个进度的介绍
#=后面格式[["进度1介绍1","进度1介绍2","进度1介绍3"],[],[]…………]
$InfoMa=[["发现了异空间的秘密,还有幽灵阿塞米的阴谋。","于是瓦拉齐和卡西亚就踏上了恢复人类的旅途。",""],
["被传送到了亚玛西海域后,他们遇到了盗贼丝拉尔","都是工会的成员瓦拉齐和丝拉尔","进入了工会大门,开始解决事情……"]]
#下面设置每一个进度如果没有达成显示的内容
$Nothing="未达成"
#下面设置每一个进度如果没有达成显示的介绍
$Nothing2="未达成"
end
#--------------------------------------------------------------------------
# ● 开始后处理
#--------------------------------------------------------------------------
def start
super
create_menu_background
@progress = Progress.new
@progressinf = ProgressInf.new
@progressinf2 = ProgressInf2.new
@progressinf.active=false
@progressinf2.active=false
@progress.active=true
end
#--------------------------------------------------------------------------
# ● 结束后处理
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@progress.dispose
@progressinf.dispose
@progressinf2.dispose
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
super
update_menu_background
[email protected]
@progress.update
if $indexer!=j then
[email protected]
@progress.refresh
@progressinf.update
end
update_window_selection
end
#--------------------------------------------------------------------------
# ● 更新选项卡
#--------------------------------------------------------------------------
def update_window_selection
if Input.trigger?(Input::B)
Sound.play_cancel
if $FromMap then
$scene = Scene_Map.new
else
$scene = Scene_Menu.new($backindex)
end
end
end
end
#==============================================================================
# ■ Progress
#------------------------------------------------------------------------------
# 选择进度查看的窗体
#==============================================================================
class Progress<Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize
super(0,0,544,200)
@item_max = $MaxIndex
@column_max = 2
@row_max=$MaxIndex / 2 +1
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ● 请无视
#--------------------------------------------------------------------------
def getindex
return @index
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
$s=@index
self.contents.clear
self.contents.font.size = 20
self.contents.font.name = "微软雅黑"
for i in $ConIndex..$ConIndex+7
xx=(i-$ConIndex) % 2 * 257+30
yy=((i-$ConIndex) / 2 ).to_i*30+20
if i<=$game_variables[$UseIndex] then
self.contents.draw_text(xx,yy,250,30,$ChapNa)
else
if i<$MaxIndex then
self.contents.draw_text(xx,yy,250,30,$Nothing)
end
end
end
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# ● 更新指针
#--------------------------------------------------------------------------
def update_cursor
$ConIndex+=2 if @index-$ConIndex>=8
$ConIndex-=2 if @index-$ConIndex<=-1
i= @index-$ConIndex
xxx=i % 2 * 257+20
yyy=(i / 2).to_i*30+20
self.cursor_rect.set(xxx,yyy,230,30)
end
end
#==============================================================================
# ■ ProgressInf
#------------------------------------------------------------------------------
# 进度的具体内容显示
#==============================================================================
class ProgressInf<Window_Base
def initialize
super(0,201,544,150)
refresh(0)
end
#--------------------------------------------------------------------------
# ● 刷新(参数请无视)
#--------------------------------------------------------------------------
def refresh (ab)
self.contents.clear
self.contents.font.size = 20
self.contents.font.name = "微软雅黑"
if ab<=$game_variables[$UseIndex] then
for i in 0..2
self.contents.draw_text(20,20+contents.text_size($InfoMa[ab]).height*i,494,contents.text_size($InfoMa[ab]).height,$InfoMa[ab])
end
else
self.contents.draw_text(20,20,494,30,$Nothing2)
end
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
super
refresh($s)
end
end
#==============================================================================
# ■ ProgressInf2
#------------------------------------------------------------------------------
# 『脚本内容』显示
#==============================================================================
class ProgressInf2<Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize
super(0,352,544,64)
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.font.size = 20 #字体大小
self.contents.font.name = "微软雅黑"
self.contents.draw_text(227,5,504,24,"游戏进度")
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
super #调用父类中的方法
refresh
end
end
原址:http://rpg.blue/thread-131098-1-1.html
其实我是想加入菜单使用,我用了一个菜单脚本,我自己摸索改了一点。。。。
可能我很笨啊。。。。不过我是个脚本小白,不要笑我啊。。。。
以下是我用的菜单脚本,不晓得要不要。
#============================================================================
# ○ VX·新简易菜单
# -By.冰舞蝶恋
#----------------------------------------------------------------------------
# 用法神马的…不解释……
#============================================================================
class Scene_Menu
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@mapwindow = Window_Draw_Mapname.new
@status_window = Window_MenuStatus.new(160, 0)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@mapwindow.dispose
@status_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
@mapwindow.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = "进度"# Vocab::Progress
s7 = Vocab::game_end
@command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6, s7], 7)
@command_window.index = @menu_index
if $game_party.members.size == 0 # 如果队伍为空
@command_window.draw_item(0, false) # 无效化物品选项
@command_window.draw_item(1, false) # 无效化技能选项
@command_window.draw_item(2, false) # 无效化装备选项
@command_window.draw_item(3, false) # 无效化状态选项
end
if $game_system.save_disabled # 如果禁止存档
@command_window.draw_item(4, false) # 无效化存档选项
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # 物品
$scene = Scene_Item.new
when 1,2,3 # 技能、装备、状态
start_actor_selection
when 4 # 存档
$scene = Scene_File.new(true, false, false)
when 5 # 进度
$Scene = Scene_Progress.new
when 6 # 结束游戏
$scene = Scene_End.new
end
end
end
end
class Window_MenuStatus < Window_Selectable
def initialize(x, y)
super(x, y+56, 384, 416-56)
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.members.size
for actor in $game_party.members
draw_actor_shortface(actor, 2, actor.index * 82 + 2, 92)
x = 104
y = actor.index * 82 + WLH / 2
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 120, y)
draw_actor_level(actor, x, y + WLH * 1)
draw_actor_state(actor, x, y + WLH * 2)
draw_actor_hp(actor, x + 120, y + WLH * 1)
end
end
def update_cursor
if @index < 0
self.cursor_rect.empty
elsif @index < @item_max
self.cursor_rect.set(0, @index * 82, contents.width, 82)
elsif @index >= 100
self.cursor_rect.set(0, (@index - 100) * 82, contents.width, 82)
else
self.cursor_rect.set(0, 0, contents.width, @item_max * 82)
end
end
end
class Window_Base
def draw_shortface(face_name, face_index, x, y, size = 96)
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 + (96 - size) / 2 + 16
rect.width = size
rect.height = size - 32
self.contents.blt(x, y+8, bitmap, rect)
bitmap.dispose
end
def draw_actor_shortface(actor, x, y, size = 96)
draw_shortface(actor.face_name, actor.face_index, x, y, size)
end
end
class Game_Map
attr_reader :map_id
def mapname
$mapname = load_data("Data/MapInfos.rvdata")
$mapname[@map_id].name
end
end
class Window_Draw_Mapname < Window_Base
def initialize
super(0, 56, 160, 304)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 4, 160, WLH, "位置:")
self.contents.font.color = normal_color
self.contents.draw_text(4+8, WLH + 12, 160, WLH, $game_map.mapname.to_s)
end
end
原址:http://rpg.blue/thread-210654-1-1.html
求高手帮忙啊。。。。。 |
|