Game_System Add-on (Playtime) v 1.1
by shadowball
01.11.2008
I don't know if someone already released a script like this one, but this script is how I would set the playtime in game.
It allows you to set a specific time or to add / substract a certain amount of months, days, hours or minutes.
If you try to set the time like this:
$game_system.set_time(0, 102)
it'll set the minutes to 59 min automatically.
$game_system.set_time(1, 30)
it'll add 30 min to the previous playtime
$game_system.set_time(2, 30)
it'll substract 30 min to the previous playtime
by shadowball
01.11.2008
I don't know if someone already released a script like this one, but this script is how I would set the playtime in game.
It allows you to set a specific time or to add / substract a certain amount of months, days, hours or minutes.
If you try to set the time like this:
$game_system.set_time(0, 102)
it'll set the minutes to 59 min automatically.
$game_system.set_time(1, 30)
it'll add 30 min to the previous playtime
$game_system.set_time(2, 30)
it'll substract 30 min to the previous playtime
Code:
#============================
# * Game_System Add-on (Playtime) v 1.1
# by shadowball
# 01.11.2008
#============================
class Game_System
def set_time(alter = 0, min = 0, hour = 0, day = 0, mon = 0, year = 0)
if min >= 0
if min >= 60
min = 59
end
set_min = Graphics.frame_rate * 60 * min
end
if hour >= 0
if hour >= 24
hour = 23
end
set_hour = Graphics.frame_rate * 60 * 60 * hour
end
if day >= 0
if day >= 31
day = 30
end
set_day = Graphics.frame_rate * 60 * 60 * 24 * day
end
if mon >= 0
if mon > 11
mon = 11
end
set_mon = Graphics.frame_rate * 60 * 60 * 24 * 31 * mon
end
if year >= 0 && year < 2
set_mon = Graphics.frame_rate * 60 * 60 * 24 * 31 * 12 * year
end
case alter
when 0
Graphics.frame_count = 0 + set_mon + set_day + set_hour + set_min
when 1
Graphics.frame_count = Graphics.frame_count + set_mon + set_day + set_hour + set_min
when 2
Graphics.frame_count = Graphics.frame_count - set_mon - set_day - set_hour - set_min
end
end
end