- 664
- Posts
- 17
- Years
- Age 33
- England
- Seen May 16, 2024
This script imitates the feature from Pokemon Black/White which shows an image when you first start up the game showing whichever season it is.
Put this in a new script section above main:
Make 4 new images 480 x 320 and put them in Graphics/Pictures/
autumn.png
summer.png
winter.png
spring.png
Then just run the game and test it :D
Credits to me please if you use this.
If you like this script and would like more, check regularly on my site https://www.planetdev.ihubhost.net (Temporary free domain)
Put this in a new script section above main:
Spoiler:
Code:
#===============================================================================
# * Day/Season Checker
# * By Crazyninjaguy
# * https://www.planetdev.net
#===============================================================================
module TimeChecker
# Number of the switch to turn on per day of week
MONDAY = 30
TUESDAY = 31
WEDNESDAY = 32
THURSDAY = 33
FRIDAY = 34
SATURDAY = 35
SUNDAY = 36
# Switch to turn on according to season
WINTER = 37
SPRING = 38
SUMMER = 39
AUTUMN = 40
end
class CheckTime
include TimeChecker
def initialize
@day = Time.now.strftime("%A")
@month = Time.now.strftime("%m").to_i
@date = Time.now.strftime("%d").to_i
if @month >= 3 && @month <= 5
if @month == 5 && @date >= 21
$game_switches[WINTER] = false
$game_switches[SPRING] = true
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = false
elsif @date <= 20
$game_switches[WINTER] = true
$game_switches[SPRING] = false
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = false
end
elsif @month >= 6 && @month <= 8
if @month == 8 && @date >= 21
$game_switches[WINTER] = false
$game_switches[SPRING] = false
$game_switches[SUMMER] = true
$game_switches[AUTUMN] = false
elsif @date <= 20
$game_switches[WINTER] = false
$game_switches[SPRING] = true
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = false
end
elsif @month >= 9 && @month <= 11
if @month == 11 && @date >= 21
$game_switches[WINTER] = true
$game_switches[SPRING] = false
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = false
elsif @date <= 20
$game_switches[WINTER] = false
$game_switches[SPRING] = false
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = true
end
elsif @month >= 12 || @month <= 2
if @month == 2 && @date >= 21
$game_switches[WINTER] = true
$game_switches[SPRING] = false
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = false
elsif @date <= 20
$game_switches[WINTER] = false
$game_switches[SPRING] = false
$game_switches[SUMMER] = false
$game_switches[AUTUMN] = true
end
end
if @day == "Monday"
$game_switches[MONDAY] = true
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = false
elsif @day == "Tuesday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = true
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = false
elsif @day == "Wednesday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = true
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = false
elsif @day == "Thursday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = true
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = false
elsif @day == "Friday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = true
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = false
elsif @day == "Saturday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = true
$game_switches[SUNDAY] = false
elsif @day == "Sunday"
$game_switches[MONDAY] = false
$game_switches[TUESDAY] = false
$game_switches[WEDNESDAY] = false
$game_switches[THURSDAY] = false
$game_switches[FRIDAY] = false
$game_switches[SATURDAY] = false
$game_switches[SUNDAY] = true
end
end
end
class Scene_Map
alias cng_dayseason_map_main main
def main
CheckTime.new
if $game_switches[TimeChecker::SPRING] && $season == false
@season = Sprite.new
@season.bitmap = RPG::Cache.picture("spring")
@season.opacity = 0
elsif $game_switches[TimeChecker::SUMMER] && $season == false
@season = Sprite.new
@season.bitmap = RPG::Cache.picture("summer")
@season.opacity = 0
elsif $game_switches[TimeChecker::AUTUMN] && $season == false
@season = Sprite.new
@season.bitmap = RPG::Cache.picture("autumn")
@season.opacity = 0
elsif $game_switches[TimeChecker::WINTER] && $season == false
@season = Sprite.new
@season.bitmap = RPG::Cache.picture("winter")
@season.opacity = 0
end
@season.z = 9999997
cng_dayseason_map_main
@season.dispose
end
alias cng_dayseason_map_update update
def update
cng_dayseason_map_update
if $season == false
if @season.opacity < 255
@season.opacity += 5
elsif @season.opacity == 255
$season = true
Graphics.wait(60)
end
elsif $season == true
if @season.opacity > 0
@season.opacity -= 5
end
end
end
end
$season = false
Make 4 new images 480 x 320 and put them in Graphics/Pictures/
autumn.png
summer.png
winter.png
spring.png
Then just run the game and test it :D
Credits to me please if you use this.
If you like this script and would like more, check regularly on my site https://www.planetdev.ihubhost.net (Temporary free domain)