Project1
标题:
事件计时器多元化控制
[打印本页]
作者:
TERENCE
时间:
2011-5-27 17:38
标题:
事件计时器多元化控制
前言:
其实这是很旧的产物了
这是旧6R之前死后没多久写出来的东西,
因为当初没地方分享,所以一直放在空间里,
今天 把陈年旧物给翻出来 分享 (希望还没有人写过这东西 =D
RMXP事件只能做出倒数的动作,不能暂停,也不能正数,
但却能把计时的结果带入游戏变量之中,
如此一来会显得事件的计时器其实有点美中不足。
效果:
以下脚本就是可以帮忙实现...
(1)控制计时器正数及倒数
(2)控制计时器计算速度
(3)控制计时器暂时停止
(4)中途改变计数方式
#==============================================================================
# ■ 事件計時器多元化控制 Diversiform Timer Control
#-----------------------------------------------------------------------------
# 作者:TERENCE (龙皇)
# 本類別的實例請參考 $game_system
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 自定义设定
#--------------------------------------------------------------------------
Timer_Pause = 11 # 計時器暫停的開關編號
Timer_CountUp = 10 # 計時器 "啟動" 正數 的開關編號
Midway_CountUp = 12 # 計時器 "中途" 改變計數方式 的開關編號
Count_speed = 12 # 計時器計算速度的變量編號
#--------------------------------------------------------------------------
# ● 更新畫面
#--------------------------------------------------------------------------
def update
unless $game_switches[Timer_CountUp] #若要正數,使遊戲的10號開關為ON
# 計時器減 1
if @timer_working and @timer > 0*40
if $game_switches[Timer_Pause] # 計時器是否暫停
@timer -= 0
else
unless $game_switches[Midway_CountUp]
if $game_variables[Count_speed]<=0
@timer -= 1
else
@timer -= 1*$game_variables[Count_speed]
end
else
if @timer_working and @timer < 5999*40
if $game_variables[Count_speed]<=0
@timer += 1
else
@timer += 1*$game_variables[Count_speed]
end
end
end
end
end
else
# 計時器加 1
if @timer_working and @timer < 5999*40
if $game_switches[Timer_Pause] # 計時器是否暫停
@timer += 0
else
unless $game_switches[Midway_CountUp]
if $game_variables[Count_speed]<=0
@timer += 1
else
@timer += 1*$game_variables[Count_speed]
end
else
if @timer_working and @timer > 0*40
if $game_variables[Count_speed]<=0
@timer -= 1
else
@timer -= 1*$game_variables[Count_speed]
end
end
end
end
end
end
end
end
复制代码
範例::
Diversiform Timer Control.rar
(814.89 KB, 下载次数: 135)
2011-5-27 17:35 上传
点击文件名下载附件
本人是使用 繁体 中文 请注意,
简体用户 想要在工程里 看见我的 繁体字,请使用app开起
作者:
arnie510
时间:
2011-5-29 15:24
很有用的系統! 謝謝你了!!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1