加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 gaofei677 于 2013-2-21 11:17 编辑
-------------------update(start)--------------------------------
自己研究了半天,最后自己找出了问题
问题1,把所有的逻辑或(or)取消,写成并列条件,虽然不知道为什么,大概是 or 的用法没写对
问题2,年份进制写法错误,应该修改成
if $game_variables[31][1] == 1 and $game_variables[31][2] == 2 and $game_variables[31][3] == 3 and $game_variables[31][4] == 2 $game_variables[31][3] = 0 $game_variables[31][4] = 1 $game_variables[31][1] = 0 $game_variables[31][2] = 1 $game_variables[31][0] += 1 end if $game_variables[31][1] > 0 and $game_variables[31][2] > 2 $game_variables[31][3] = 0 $game_variables[31][4] = 1 $game_variables[31][1] = 0 $game_variables[31][2] = 1 $game_variables[31][0] += 1 end
if $game_variables[31][1] == 1 and $game_variables[31][2] == 2 and $game_variables[31][3] == 3 and $game_variables[31][4] == 2
$game_variables[31][3] = 0
$game_variables[31][4] = 1
$game_variables[31][1] = 0
$game_variables[31][2] = 1
$game_variables[31][0] += 1
end
if $game_variables[31][1] > 0 and $game_variables[31][2] > 2
$game_variables[31][3] = 0
$game_variables[31][4] = 1
$game_variables[31][1] = 0
$game_variables[31][2] = 1
$game_variables[31][0] += 1
end
-------------------update(end)--------------------------------
我在执行以下的时间系统的时候,当时间从 2014,01,01 增加到 2014,03,31 的时候没有问题
但是当时间应该为2014,04,01的时候,系统却显示为 2014,03,32
往后我再怎么增加天,只有号数增加正常,号数甚至可以到100,但是月份和年份就是不增加
这两天被这个时间系统弄得心力交瘁
求大侠帮我纠正一下错误
#此定义了一个2014-2016 的时间系统 #game_variables[31][0] 为2014年 #game_variables[31][1] 为月份的十位 #game_variables[31][2] 为月份的个位 #game_variables[31][3] 为天数的十位 #game_variables[31][4] 为天数的个位 $game_variables[31] = [4,0,1,0,1] #此定义了号数的个位到十位的十进制 if $game_variables[31][4] > 9 $game_variables[31][3] += 1 $game_variables[31][4] = 0 end #此定义了月份的个位到十位的十进制 if $game_variables[31][2] > 9 $game_variables[31][1] += 1 $game_variables[31][2] = 0 end #此定义了年份满12月,年数进一位 if $game_variables[31][1] == 1 and $game_variables[31][2] == 3 $game_variables[31][1] = 0 $game_variables[31][2] = 1 $game_variables[31][0] += 1 end #此定义了大月31天月份进一位 if ($game_variables[31][1] == 0 and $game_variables[31][2] == 1 or 3 or 5 or 7 or 8) or ($game_variables[31][1] == 1 and $game_variables[31][2] == 0 or 2) if $game_variables[31][3] == 3 and $game_variables[31][4] == 2 $game_variables[31][3] = 0 $game_variables[31][4] = 1 $game_variables[31][2] += 1 end end #此定义了小月30天月份进一位 if ($game_variables[31][1] == 0 and $game_variables[31][2] == 4 or 6 or 9) or ($game_variables[31][1] == 1 and $game_variables[31][2] == 1) if $game_variables[31][3] == 3 and $game_variables[31][4] == 1 $game_variables[31][3] = 0 $game_variables[31][4] = 1 $game_variables[31][2] += 1 end end #此定义了2月28天月份进一位(2014年到2016年没有闰年) if $game_variables[31][1] == 0 and $game_variables[31][2] == 2 if $game_variables[31][3] == 2 and $game_variables[31][4] == 9 $game_variables[31][3] = 0 $game_variables[31][4] = 1 $game_variables[31][2] += 1 end end
#此定义了一个2014-2016 的时间系统
#game_variables[31][0] 为2014年
#game_variables[31][1] 为月份的十位
#game_variables[31][2] 为月份的个位
#game_variables[31][3] 为天数的十位
#game_variables[31][4] 为天数的个位
$game_variables[31] = [4,0,1,0,1]
#此定义了号数的个位到十位的十进制
if $game_variables[31][4] > 9
$game_variables[31][3] += 1
$game_variables[31][4] = 0
end
#此定义了月份的个位到十位的十进制
if $game_variables[31][2] > 9
$game_variables[31][1] += 1
$game_variables[31][2] = 0
end
#此定义了年份满12月,年数进一位
if $game_variables[31][1] == 1 and $game_variables[31][2] == 3
$game_variables[31][1] = 0
$game_variables[31][2] = 1
$game_variables[31][0] += 1
end
#此定义了大月31天月份进一位
if ($game_variables[31][1] == 0 and $game_variables[31][2] == 1 or 3 or 5 or 7 or 8) or ($game_variables[31][1] == 1 and $game_variables[31][2] == 0 or 2)
if $game_variables[31][3] == 3 and $game_variables[31][4] == 2
$game_variables[31][3] = 0
$game_variables[31][4] = 1
$game_variables[31][2] += 1
end
end
#此定义了小月30天月份进一位
if ($game_variables[31][1] == 0 and $game_variables[31][2] == 4 or 6 or 9) or ($game_variables[31][1] == 1 and $game_variables[31][2] == 1)
if $game_variables[31][3] == 3 and $game_variables[31][4] == 1
$game_variables[31][3] = 0
$game_variables[31][4] = 1
$game_variables[31][2] += 1
end
end
#此定义了2月28天月份进一位(2014年到2016年没有闰年)
if $game_variables[31][1] == 0 and $game_variables[31][2] == 2
if $game_variables[31][3] == 2 and $game_variables[31][4] == 9
$game_variables[31][3] = 0
$game_variables[31][4] = 1
$game_variables[31][2] += 1
end
end
|