Project1
标题:
[Scene篇]简陋任务列表
[打印本页]
作者:
fux2
时间:
2010-12-28 13:24
标题:
[Scene篇]简陋任务列表
本帖最后由 fux2 于 2010-12-29 10:24 编辑
喵,咱只是尝试写一个Scene,很渣,各位就不要吐槽了,非常简陋,范例就不发了。
感谢
EngShun
纠正错误喵~
[line]2[/line]
2.jpg
(31.73 KB, 下载次数: 26)
下载附件
保存到相册
2010-12-28 13:24 上传
1.jpg
(100.33 KB, 下载次数: 29)
下载附件
保存到相册
2010-12-28 13:24 上传
于是还是比较朴实啦~
以下献给新手
1.插入下面的脚本在main以上
2.进入游戏按Z键呼出任务列表
3.变量100控制任务进度
4.脚本42行修改任务描述
喵就这样了
class Scene_Fux2
def main
@help_window = Window_Help.new
@item_window = Window_Fux2.new
@item_window.help_window = @help_window
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@item_window.dispose
end
def update
@help_window.update
@item_window.update
if @item_window.active
update_item
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
end
########################################################
class Window_Fux2 < Window_Selectable
FUX_BLOCK = [["任务1","杀死所有敌人"],["任务2","喵喵"]]
def initialize
super(0, 64, 640, 416)
@column_max = 1
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_variables[100]
@data.push i
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
@data[index] == @data.size ? self.contents.font.color = Color.new(255, 255, 0, 255) : self.contents.font.color = normal_color
x = 12
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.draw_text(x + 28, y, 212, 32, FUX_BLOCK[index][0], 0)
end
def update_help
@help_window.set_text(self.item == nil ? "" : FUX_BLOCK[self.index][1])
end
end
########################################
class Scene_Map
alias:fuxupdate:update
def update
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if Input.trigger?(Input::A)
$scene = Scene_Fux2.new
end
fuxupdate
end
end
end
复制代码
作者:
血のばら
时间:
2010-12-28 13:47
咱是沙发,果然,有点简陋,我要个美化版的
作者:
EngShun
时间:
2010-12-29 09:29
本帖最后由 EngShun 于 2010-12-29 09:54 编辑
万一我要重中间插入某些剧情以外的任务
(比如某人叫你找某某东西,找到给你钱)
这种情况要怎么办?
建议增加多一个变量,
一个主要任务,
一个次要任务。
突然发现一个大大大错误,
class Scene_Map
alias:fuxupdate:update
def update
if Input.trigger?(Input::A)
$scene = Scene_Fux2.new
end
fuxupdate
end
end
复制代码
这样会导致事件执行中也能叫出任务画面
应该替换成这个
class Scene_Map
alias:fuxupdate:update
def update
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if Input.trigger?(Input::A)
$scene = Scene_Fux2.new
end
fuxupdate
end
end
end
复制代码
作者:
退屈£无聊
时间:
2011-1-8 11:43
每个任务都应该有自己的一个独立的进度.
不过这个...很难改啊.
跟原版的任务提示有很大的不同><我到现在还不知道它是做什么用的..
虽然建议每个任务都设置一个独立的类似于task[1] = [名称,介绍,进度]
但是那样又变成原版的了><
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1