赞 | 26 |
VIP | 203 |
好人卡 | 21 |
积分 | 4 |
经验 | 262420 |
最后登录 | 2024-4-30 |
在线时间 | 902 小时 |
Lv2.观梦者 (版主) 脚本白痴
- 梦石
- 0
- 星屑
- 412
- 在线时间
- 902 小时
- 注册时间
- 2007-7-9
- 帖子
- 1403
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 牛肉面 于 2010-9-29 22:34 编辑
此脚本原型是地图显示变量,被我改造成了变量控制的日夜系统:)
脚本功能:
日夜变化,1-24时的明暗效果,可在脚本中设置使用明暗效果的地图ID
分,时,年,月,日,星期,四季:全变量控制,可自行改变分的增进速度,各个单位的进制
并且可以随时调整分,时,年,月,日,星期,四季的数值。
可以控制脚本是否开启,窗口背景是否显示。
只有在地图时间才会流逝,并且对话时时间也不会流逝!
脚本在范例工程之中!此脚本请配合本人的工程使用。
完美日夜系统BY牛肉面.rar
(2.68 MB, 下载次数: 1347)
我在66找了不少日夜系统,不是计算公式不能改就是没有明暗,要不就是不能自由控制……
这回终于做了个任意控制的了!这也是我做的第一个脚本吧!(在原基础上学习制作)- #==============================================================================
- # 变量控制完美时间天气系统 V0.90 整合与重制作:牛肉面
- # 原地图显变量脚本来自66rpg
- # 请使用本人配套范例工程
- #==============================================================================
- VAR_SWITCH = 5 # 工作开关
- VAR_REFRESH_SWITCH = 6 # 强制刷新
- COLOURMAPID = [1,3] # 使用天气明暗效果的地图ID
- #1、把窗口由透明变为不透明(包括第一次使用时),2、游戏中用脚本更改了$var
- $var = []
- $var = [[2,20,0],[1,70,0],[6,130,0],[5,210,0],[3,260,0]]
- #所有需要显示在地图并且刷新的变量,可在游戏中用脚本更改。
- #格式:[变量编号,x坐标,y坐标]
- #==============================================================================
- # ■ Window_XY
- #------------------------------------------------------------------------------
- # 显示坐标的窗口。
- #==============================================================================
- class Window_MapVar < Window_Base #注意前面那个window_var是文件名
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- #=======================此处可任意调整窗口位置
- super(0,0,640,64)
-
- # 窗口内容的不透明度
- self.contents_opacity=255
- self.contents = Bitmap.new(width - 32, height - 32)
- self.z=9999
- #=======================
- @var_value_old = -1
- @var = $var
- @var_a = []
- for var_draw in $var
- @var_a[var_draw[0]] = $game_variables[var_draw[0]]
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if $game_switches[VAR_SWITCH]
- @var = $var # 记录现在变量数组结构
- self.contents.clear # 清除以前的东西
- for var_draw in @var
- @var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
- self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
- self.contents.draw_text(45, 0, 32, 32, '时')
- self.contents.draw_text(95, 0, 32, 32, '分')
- self.contents.draw_text(185, 0, 32, 32, '年')
- self.contents.draw_text(235, 0, 32, 32, '月')
- self.contents.draw_text(285, 0, 32, 32, '日')
- #self.contents.draw_text(330, 0, 64, 32, '星期')
- @game_variables = $game_variables
- case @game_variables[20]# 控制窗口背景变量 1显示0消失
- when 1
- self.opacity=150 # 窗口的不透明度
- self.back_opacity=150 # 窗口背景的不透明度
- when 0
- self.opacity=0
- self.back_opacity=0
- end
- case @game_variables[4]
- when 1
- self.contents.draw_text(330, 0, 96, 32, '星期一')
- when 2
- self.contents.draw_text(330, 0, 96, 32, '星期二')
- when 3
- self.contents.draw_text(330, 0, 96, 32, '星期三')
- when 4
- self.contents.draw_text(330, 0, 96, 32, '星期四')
- when 5
- self.contents.draw_text(330, 0, 96, 32, '星期五')
- when 6
- self.contents.draw_text(330, 0, 96, 32, '星期六')
- when 7
- self.contents.draw_text(330, 0, 96, 32, '星期日')
- else
- self.contents.draw_text(330, 0, 96, 32, '星期日')
- end
- case @game_variables[7]
- when 1
- self.contents.draw_text(420, 0, 64, 32, '春季')
- when 2
- self.contents.draw_text(420, 0, 64, 32, '夏天')
- when 3
- self.contents.draw_text(420, 0, 64, 32, '秋日')
- when 4
- self.contents.draw_text(420, 0, 64, 32, '寒冬')
- end
- @game_switches = $game_switches
- if COLOURMAPID.include?($game_map.map_id)
- #@game_switches[4]
- case @game_variables[2]
- when 1
- $game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
- when 2
- $game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
- when 3
- $game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
- when 4
- $game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
- when 5
- $game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
- when 6
- $game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
- when 7
- $game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
- when 8
- $game_screen.start_tone_change(Tone.new(0,0,0,0),5)
- when 9
- $game_screen.start_tone_change(Tone.new(0,0,0,0),5)
- when 10
- $game_screen.start_tone_change(Tone.new(0,0,0,0),5)
- when 11
- $game_screen.start_tone_change(Tone.new(34,34,0,0),5)
- when 12
- $game_screen.start_tone_change(Tone.new(34,34,0,0),5)
- when 13
- $game_screen.start_tone_change(Tone.new(34,34,0,0),5)
- when 14
- $game_screen.start_tone_change(Tone.new(17,17,0,0),5)
- when 15
- $game_screen.start_tone_change(Tone.new(17,17,0,0),5)
- when 16
- $game_screen.start_tone_change(Tone.new(17,17,0,0),5)
- when 17
- $game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
- when 18
- $game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
- when 19
- $game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
- when 20
- $game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
- when 21
- $game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
- when 22
- $game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
- when 23
- $game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
- when 0
- $game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
- end
- else
- $game_screen.start_tone_change(Tone.new(0,0,0,0),5)
-
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 判断文字刷新。节约内存用
- #--------------------------------------------------------------------------
- def judge
- for var_draw in $var
- if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
- return true
- end
- end
- if $game_switches[VAR_REFRESH_SWITCH] # 强制刷新的时候,刷新
- $game_switches[VAR_REFRESH_SWITCH] = false
- return true
- end
- return false
- end
- end
- class Scene_Map
- alias var_66rpg_main main
- def main
- @var_window = Window_MapVar.new
- # @var_window.opacity = 0
- var_66rpg_main
- @var_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias var_66rpg_update update
- def update
- var_66rpg_update
- if $game_switches[VAR_SWITCH]
- @var_window.visible = true
- @var_window.refresh
- #if @var_window.judge
- else
- @var_window.visible = false
- end
- end
- end
复制代码 此脚本不能直接外挂 |
评分
-
查看全部评分
|