RPGmaker vxrpg maker mv 计时器器的使用?

求一个脚本,能使计时器能够增加和减少时间。【rpgmakervxace吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:9,977贴子:
求一个脚本,能使计时器能够增加和减少时间。收藏
要求:能在已经启动的计时器上通过事件增加和减少计时器的时间。在网上寻找了一下,没有类似的脚本,不知道有没有高手愿意帮忙,先在这里谢过。
不知道有没有这种脚本,你照我这么改看看是不是这个效果
class Game_Timer
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def viparcher(count)
= true if !@working
endend未测试
登录百度帐号推荐应用RM的脚本可以用在VX上吗?【时间系统脚本】【rpgmakervxace吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:9,977贴子:
RM的脚本可以用在VX上吗?【时间系统脚本】收藏
教程说明 日夜控制系统完美版![功能说明:]时间为四个时段晨、日、午、夜,每个时段有对应的自动开关,方便设计各时段特殊事件的启动。(比如时段为午,则会自动开启开关2号。玩家可利用此开关设计特殊事件)日夜控制系统总开关预设为开关6,可控制此系统是否运作。自设起始时间预设为变数6,比如:当变数6设定为5,表示此系统由 5:00 开始计时。屋内/洞穴亮度恢复开关预设为开关5。即当玩家进入屋内/洞穴需要把亮度恢复,可利用此开关控制。请将下面脚本内容复制/插入到 main 上即可使用! 脚本内容 #==========================================================================# ■ Window_Base#--------------------------------------------------------------------------#  游戏中全部窗口的超级程式。#
由 Kevin Chang 制作,发布请保留原作者讯息。#==========================================================================class Window_Base & Window #------------------------------------------------------------------------ #●日夜控制系统初始控制设定 #------------------------------------------------------------------------ Ctrl_daylight_sys = 6 #日夜控制系统开关编号,预设开关6 Ctrl_in_house = 5 #屋内/洞穴亮度恢复开关编号,预设开关5 Ctrl_morning = 4 #晨间作息开关编号,预设开关4 Ctrl_day = 1
#日间作息开关编号,预设开关1 Ctrl_afternoon = 2 #午间作息开关编号,预设开关2 Ctrl_night = 3 #夜间作息开关编号,预设开关3
$Ctrl_Set_hour = 6 #设定起始时间(小时)之变数编号,预设变数6 $Day_sec = 5 #时间轴秒的进制预设为 6 进制(0~5) $Day_min = 5 #ㄧ小时几分钟的进制预设为 6 进制(0~5) $Day_hour = 11 #每天为几小时的进制预设为 12 小时1天(0~11) #------------------------------------------------------------------------ # ●初始化对像 #
: 窗口的 X 坐标 #
: 窗口的 Y 坐标 #
: 窗口的宽 #
height : 窗口的宽 #------------------------------------------------------------------------ def initialize(x, y, width, height)
@windowskin_name = $game_system.windowskin_name
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
self.x = x
self.y = y
self.width = width
self.height = height
self.z = 100 end #------------------------------------------------------------------------ #洞穴屋内亮度正常化 #------------------------------------------------------------------------ def inside_normal
if $game_switches[Ctrl_in_house] == true
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
end end #------------------------------------------------------------------------ #--------------------------------------- #时段使用图案代表 #--------------------------------------- def show_day #时段图案函式
testname=$hour.to_s#将角色ID编号,转成字串变数(to_s) 并存到testname
bitmap=Bitmap.new(&Graphics/pictures/#{testname}&)#取出路径Graphics/pictures/下 testname 档名的图
src_rect=Rect.new(0,0,bitmap.width,bitmap.height)
self.contents.blt(20,4,bitmap,src_rect) end
#--------------------------------------- #----------------------------------------- #天气变化 #----------------------------------------- def weather_decision
if $game_switches[Ctrl_in_house] == true
$game_screen.weather(0, 3, 1)
w_d = rand(100)
if w_d &= 0 and w_d &= 80
$game_screen.weather(0, 3, 50) #正常(类型0正常1雨天2刮风3下雪,强度,时间/10)
if w_d & 80 and w_d &= 90
$game_screen.weather(1, 5, 50)#雨天
if w_d & 90 and w_d &= 100
$game_screen.weather(1, 10, 500)#刮风
end #--------------------------------------- #------------各时间颜色变化---------------------
def the_time
case $hour
#self.contents.draw_text(0, 0, 120, 32, &『夜』&)
$game_screen.start_tone_change(Tone.new(-136,-136,0,136),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = true
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『晨』&)
$game_screen.start_tone_change(Tone.new(0,0,85,85),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = true
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『晨』&)
$game_screen.start_tone_change(Tone.new(0,0,51,68),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = true
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『晨』&)
$game_screen.start_tone_change(Tone.new(0,0,0,40),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = true
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『日』&)
$game_screen.start_tone_change(Tone.new(0,0,0,0),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = true
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『日』&)
$game_screen.start_tone_change(Tone.new(50,0,0,0),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = true
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『日』&)
$game_screen.start_tone_change(Tone.new(100,34,51,0),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = true
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『午』&)
$game_screen.start_tone_change(Tone.new(100,34,-17,68),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = true
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『午』&)
$game_screen.start_tone_change(Tone.new(100,34,-20,170),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = true
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『午』&)
$game_screen.start_tone_change(Tone.new(68,0,-17,204),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = true
#午间作息开关
$game_switches[Ctrl_night] = false
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『夜』&)
$game_screen.start_tone_change(Tone.new(0,0,0,204),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = true
#夜间作息开关
#self.contents.draw_text(0, 0, 120, 32, &『夜』&)
$game_screen.start_tone_change(Tone.new(-51,-51,-51,170),50)
inside_normal
#设定时段图案
weather_decision
$game_switches[Ctrl_morning] = false
#晨间作息开关
$game_switches[Ctrl_day] = false
#日间作息开关
$game_switches[Ctrl_afternoon] = false
#午间作息开关
$game_switches[Ctrl_night] = true
#夜间作息开关
end #end case
endend#==========================================================================#==========================================================================# ■ Window_DayLight#--------------------------------------------------------------------------#
显示日夜/时间的窗口。#==========================================================================class Window_DayLight & Window_Base #-------------------------------------------- #时间轴的进制 #--------------------------------------------
$sec_count = $Day_sec#5 #时间轴的进制预设为 5 进制
$min_count = $Day_min#5 #ㄧ小时几分钟的进制预设为5进制
$hour_count = $Day_hour#12 #每天为几小时的进制预设为12小时1天 #------------------------------------------------------------------------ # ●初始化窗口 #------------------------------------------------------------------------ def initialize
super(0, 0, 160, 60) #(X,Y,宽,高)
self.contents = Bitmap.new(width - 32, height - 32)
$set_hour = $game_variables[$Ctrl_Set_hour]
refresh end #------------------------------------------------------------------------ # ●初始化对象 #------------------------------------------------------------------------ def refresh
self.contents.clear
self.back_opacity = 0 #背景透明
self.opacity = 0 #外框透明
if $hour & $hour_count #当计时时间超过实际时间
Graphics.frame_count = 0 #计时器归零
$set_hour = 0
if $game_switches[Ctrl_daylight_sys] == false
= $game_variables[11] #设定变数11的值,来改变字时间体颜色
self.contents.font.color = text_color(@color) @total_sec = Graphics.frame_count / Graphics.frame_rate
(@total_sec / $sec_count /$sec_count %$hour_count) + $set_hour
$min = @total_sec / $sec_count % $min_count
$sec = @total_sec % $sec_count
text = sprintf(&T:%02d:%02d&, $hour, $min)
#self.contents.font.color = Color.new(255,255,255,255)#设定颜色(R,G,B,亮度)
self.contents.draw_text(25, 5, 100, 20, text, 2)#(x,y宽,高,变数,字型颜色)
#------------------------------------------------------------------------ # ●刷新 #------------------------------------------------------------------------ def update
if Graphics.frame_count / Graphics.frame_rate != @total_sec
end endend#--------------------------------------------------------------------------#==========================================================================# ■ Scene_Map#--------------------------------------------------------------------------#  处理地图画面的程式。#==========================================================================class Scene_Mapdef main
# 生成游戏时间窗口
@daylight_window = Window_DayLight.new
@daylight_window.x = 450
@daylight_window.y = 0
# 生成活动块
@spriteset = Spriteset_Map.new
# 生成讯息窗口
@message_window = Window_Message.new
# 执行过渡
Graphics.transition
# 刷新游戏画面
Graphics.update
# 刷新输入讯息
Input.update
# 刷新画面
# 如果画面切换的话就中断循环
if $scene != self
# 准备过渡
Graphics.freeze
# 释放活动块
@spriteset.dispose
@daylight_window.dispose #释放时间窗口
# 释放讯息窗口
@message_window.dispose
# 标题画面切换中的情况下
if $scene.is_a?(Scene_Title)
# 淡入淡出画面
Graphics.transition
Graphics.freeze
alias daylight_sys_update update def update
@daylight_window.refresh #刷新时间显示
daylight_sys_update endend ==============================================================以上是脚本内容,目前不在家。。。好不容易找到这个脚本 想问问可以用在VX上么?
作者:kevin5408
收录日期:
另外还找到个VA的
不知道可不可以用在VX上。吧主大人快来解答啊
登录百度帐号推荐应用

参考资料

 

随机推荐