设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 9960|回复: 27
打印 上一主题 下一主题

超自定义时间日期天气昼夜脚本系统(新增优化方法)

 关闭 [复制链接]

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

跳转到指定楼层
1
发表于 2007-7-10 20:30:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
超自定义时间日期天气昼夜脚本系统

有人可能会说:「站上不是早就有这类脚本了吗?还发来作啥?」
但是我这与站上其他脚本不同的地方是「超自定义」四个字
啥叫「超自定义」呢?
就是说所有的东西,包括窗口座标, 字形颜色、大小,显示的文字,排版的方式
都可以按照你所要的去编排

写这个脚本的起因是因为我载了站上的时间脚本系统,但是想要把他改成适合我游戏风格的样式却很很很麻烦,於是发狠自己写了一个。……刚开始也没想到会成功 =_=”

後来写成功後,考虑到可能有其他像我一样的脚本新人会有同样的问题
於是乎…就把它发上来了

功能吗…看下面的介绍吧:

snstar2006 超自定义时间日期天气昼夜系统
  站上已经有许多类似的脚本, 只是如果要修改成有游戏的特色的方式实在不容易
  所以我自己重新写一个脚本, 顺便练习脚本的写法,
  方法绝对不是最好的,可能也很复杂,但是我用了大量的变量来定义
  所以对像我一样的新手来说,要修改起来,难度应该不会很大
  只要把字符串替换掉,或是把窗口坐标修改成想要的地方就好了
  几乎所有的变量定义都在脚本最上面, 其他的我在后面有说明
  要修改的话最大的问题应该是排版问题
  我在脚本里定义了三个排版,只要把7号变量改成 1 就能切换了
      
参考脚本:
      kira 的       事件+脚本 时间系统
      黑羽毛的      完美昼夜脚本
      灼眼的夏娜的  日期,天气,昼夜系统(养成游戏可用)
      sphinger 的   带远景图的小地图(缩略图)
      
  我不是很熟悉脚本语法,所以参考了以上所列的脚本的内容
  snstar2006 向以上诸位致上最高的敬意, 因为我终于完成了人生中第一个脚本系统
  
  功能:
  1. 显示游戏内日期时间, 全部文字和位置都能自己设定.
  2. 按 A 或是 shift 可以显示真实时间, 方便全屏幕时察看时间.
  3. 全部日期时间等都使用变量, 方便在游戏中设定时间.
     (比如说: 过了几天后, 在事件中增加天数的变量就好了)
  4. 打开4号开关开启计时和显示时间功能
     打开5号开关开启天气变化
     打开6号开关开启色调功能
     打开7号开关开启自动隐藏时间窗口功能, 类似window的自动隐藏工具栏
                    与4号开关不同的是, 这个开关只是隐藏窗口, 并不取消
                    计时功能
     打开8号开关变更真实时间显示格式  true = 12小时制  false = 24小时制
  5. 季节和区域天气比例变化
     可以设定不同季节和不同区域所发生的天气
     如:冬天的时候下雪的机率较大, 夏天则多雨
     或是到了沙漠地区就多刮风少下雨, 而到了沼泽区则多下雨少刮风等等
  6. 特定日期指定天气
     如:圣诞节那天一定会下雪
  7. 综合以上两项, 可能会导致在沙漠中圣诞节时下雪 囧
     所以天气选择的优先度是 区域>日期>季节
  8. 模拟真实季节昼夜长短情况
     夏天的时候白天会比较长, 冬天则比较短等
  9. 地图名称自动判断是否在室内
     如果地图名称内有[内]字或在名称之后加上 [,IN], 自动关闭天气功能
10. 本脚本支持鼠标, 只要把215行的注释取消掉就好了

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
  #分两部分是因为本脚本太长了
  #第一部分脚本是主处理,不会改的话就别改了
  #第二部分脚本是自定义变量, 文字, 排版等, 要改都到那里改去
           默认定义了24节气
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
第一部分定义修改部分
148 行 定义天气音效
362 行 定义真实时间 AM/PM 的字
372 行 定义真实时间 星期 的字

第二部分定义修改部分
22 行 窗口自定义
38 行 时间换算率
45 行 时间变量ID
55 行 天气机率百分比
79 行 窗口字型颜色定义
131 行 定义[年]的字
147 行 定义[月]的字
201 行 定义[日]的字
296 行 定义[时]的字
328 行 定义[刻]的字
192 行 定义[季节]的字
273 行 定义[星期]的字
346 行 定义[天气]的字
367 行 定义 二十八星宿
451 行 定义时间色调
585 行 定义区域和区域天气
653 行 定义窗口模式所有坐标长度等等等...
       窗口隐藏方向:2→下 4→左 6→右 8→上
800 行 节日自定义

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
二十八星宿使用思路

站上有关于二十八星宿的数据, 可以参考看看
二十八星宿包含三个部分: 名称, 七耀, 对应动物
所以总共要三个部份可以拿来用, 其中七耀又包含日月 + 五行

首先我们可以设置(用公共事件)当某个星宿出现时, 开启XX功能
如: 当[胃土雉]出现时, 任何地方都可以存盘

再者我们可以设置当某个星宿出现时, X系魔法功能加倍, Y系魔法减弱
如: 当[尾火虎]出现时, 火系魔法功能加倍
    当[心月狐]或[参水猿]出现时, 最适合打火系BOSS

最后我们可以设置当某个星宿出现时, X怪出线机率最频繁, 或是某张地图的入口开启
如: 当[牛金牛]出现时, 牛魔王的子孙会常常遇到
    当[觜火猴]出现时, 水濂洞的入口出现

又想到另外一条思路
可以把控制二十八星宿的变量改为[月份]
然后把二十八星宿改成12生肖或是星座, 用星座的话就可以用在非东方背景的游戏了
超自定义时间日期天气昼夜脚本系统

截图:





冲突可能:其他时间系统脚本(废话~~)、其馀不确定(应该没有吧)

使用地图名称显示脚本时请注意:
本脚本有三种方法分辨角色是否在室内
1. 地图名称包含「内」字
2. 地图名称以 ,IN 结尾(注意有",")
3. 设定地图地形为 98
4. 直接关掉天气开关
看情况使用

功能增新:时段作息变数控制
类似作息开关的功能,只是改用变数控制

脚本1
  1. #================================================================================#
  2. #****Window_Time                                                                 #
  3. #--------------------------------------------------------------------------------#
  4. #    显示时间的窗口类                                                            #
  5. #================================================================================#
  6. class Window_Time < Window_Base
  7.   #----------------------#
  8.   #*初始化对象           #
  9.   #----------------------#
  10.   def initialize
  11.     #更新窗口坐标
  12.     $game_variables[$time_window_pattern] = $default_pattern
  13.     @pattern_now = $default_pattern
  14.     time_date_window_update
  15.    
  16.     #设定窗口
  17.     super($time_date_X, $time_date_Y, $time_date_W, $time_date_H)
  18.     self.contents = Bitmap.new($time_date_W - 32, $time_date_H - 32)
  19.     #self.contents.font.name = (["标楷体"]) #防错用
  20.     self.opacity = $time_window_opacity
  21.    
  22.     #开关初始化 -- 预设防错的 不喜欢再用事件初始化
  23.     $game_switches[$time_date_running] = true #时间功能开启
  24.     $game_switches[$time_date_tone] = true    #色调功能开启
  25.     $game_switches[$hide_window] = false      #隐藏功能关闭
  26.     $game_switches[$real_time_format] = true  #真实时间12小时制
  27.     $game_switches[$time_date_weather] = true #天气功能开启
  28.     $game_switches[$time_map_region] = true   #区域功能开启
  29.    
  30.     #变数归零
  31.     $weather_hour = nil
  32.     $weather_type_rand = 0
  33.     $hour_count = 0
  34.     $weather_hour = 0
  35.     $game_variables[$week] = 1
  36.     @id = $game_map.map_id
  37.     for i in [$min, $hour, $day, $month, $year]
  38.       if $game_variables[i] == 0
  39.         $game_variables[i] = 1
  40.         i+=1
  41.       end # end if
  42.     end # end for
  43.    
  44.     #刷新窗口
  45.     refresh
  46.   end # end def initialize
  47.   #----------------------#
  48.   #*刷新                 #
  49.   #----------------------#
  50.   def refresh
  51.     self.contents.clear
  52.     self.contents.font.size = $time_window_font_size
  53.     self.contents.font.color = game_date
  54.    
  55.     #计算时间
  56.     if $game_switches[$time_date_running] == true
  57.       @total_sec = Graphics.frame_count
  58.       if @total_sec % $min_rate ==0
  59.         $game_variables[$min] += 1
  60.       end
  61.       if $game_variables[$min] >= $hour_rate + 1
  62.         $game_variables[$min] = 1
  63.         $game_variables[$hour] += 1
  64.         $hour_count += 1
  65.       end
  66.       if $game_variables[$hour] >= $day_rate + 1
  67.         $game_variables[$hour] = 1
  68.         $game_variables[$day] += 1
  69.         $game_variables[$week] += 1
  70.         if $game_variables[$week] == 8
  71.           $game_variables[$week] = 1
  72.         end
  73.       end
  74.       if $game_variables[$day] >= $month_rate + 1
  75.         $game_variables[$day] = 1
  76.         $game_variables[$month] += 1
  77.       end
  78.       if $game_variables[$month] >= $year_rate + 1
  79.         $game_variables[$month] = 1
  80.         $game_variables[$year] += 1
  81.       end
  82.     end
  83.    
  84.    
  85.     #判断是否在室内
  86.     newid = $game_map.map_id                        #获取地图ID
  87.     if newid != @id
  88.         @id = newid
  89.     end
  90.     $mapnames = load_data("Data/MapInfos.rxdata")   #读取地图名称
  91.     map_name = $mapnames[@id].name
  92.     if map_name.include?("内") or map_name.include?(",IN")
  93.     #如果地图名称包含"内"或",IN"
  94.       $game_switches[$time_date_weather] = false    #则不显示天气
  95.       $weather_hour = 0
  96.       $weather_type = 99                            #99是让窗口不会显示天气
  97.                                                     #应该不会有人定义99种天气吧
  98.       $game_variables[$time_map_region] = 98
  99.     end
  100.     time_date_window_update                         #窗口文字坐标调整
  101.     print_date                                      #显示文字
  102.     get_season_weather                              #计算季节天气机率
  103.     show_festival                                   #显示节日
  104.     get_region_weather                              #计算区域天气机率
  105.     get_time_range                                  #计算时段
  106.                                              
  107.     #时段控制
  108.     case $game_variables[$time_range]
  109.     when 1  # 午夜
  110.       $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]
  111.     when 2 # 日出
  112.       $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]
  113.     when 3 # 凌晨
  114.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]
  115.     when 4 # 天亮
  116.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]
  117.     when 5 # 中午
  118.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]
  119.     when 6 # 天亮
  120.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]
  121.     when 7 # 黄昏
  122.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]
  123.     when 8 # 日落
  124.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]
  125.     when 9 # 天黑
  126.       $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]
  127.     when 10 # 午夜
  128.       $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]
  129.     end
  130.    
  131.    
  132.     if $game_switches[$time_date_weather] == true  #天气功能开关为ON时
  133.       #如果天气需要归零
  134.       if $hour_count >= $weather_hour or $weather_hour == 0
  135.         $hour_count = 0                             #天气持续时间归零
  136.         $weather_type_rand = rand(100) + 1          #随机数生成天气类型
  137.         $weather_power =     rand(9) + 1            #随机数生成天气强度
  138.         $weather_hour = rand($weather_hour_max) + 1 #随机数出现天气时间
  139.         $weather_dur = 50
  140.       else
  141.         $weather_1_min = 1                                #天气一最低机率
  142.         $weather_1_max = $weather_1_rate                  #天气一最高机率
  143.         $weather_2_min = $weather_1_max + 1               #天气二最低机率
  144.         $weather_2_max = $weather_2_min + $weather_2_rate #天气二最高机率
  145.         $weather_3_min = $weather_2_max + 1               #天气三最低机率
  146.         $weather_3_max = $weather_3_min + $weather_3_rate #天气三最高机率
  147.         $weather_4_min = $weather_3_max + 1               #天气四最低机率
  148.         $weather_4_max = $weather_4_min + $weather_4_rate #天气四最高机率
  149.         
  150.         if $weather_1_rate != 0
  151.           if $weather_type_rand >= $weather_1_min and $weather_type_rand <=$weather_1_max
  152.             $weather_type = 0 #无
  153.           end
  154.         end
  155.         if $weather_2_rate != 0
  156.           if $weather_type_rand >= $weather_2_min and $weather_type_rand <=$weather_2_max
  157.             $weather_type = 1 #雨
  158.           end
  159.         end
  160.         if $weather_3_rate != 0
  161.           if $weather_type_rand >= $weather_3_min and $weather_type_rand <=$weather_3_max
  162.             $weather_type = 2 #风
  163.           end
  164.         end
  165.         if $weather_4_rate != 0
  166.           if $weather_type_rand >= $weather_4_min and $weather_type_rand <=$weather_4_max
  167.             $weather_type = 3 #雪
  168.           end
  169.         end
  170.         
  171.         #播放天气BGS
  172.         #Audio.bgs_play("文件名",音量,节奏速度)
  173.         case $weather_type #当天气
  174.         when 0
  175.           Audio.bgs_stop
  176.         when 1             #是雨的情况下
  177.           Audio.bgs_play("Audio/BGS/005-Rain01", 60)
  178.          
  179.         when 2             #是风的情况下
  180.           Audio.bgs_play("Audio/BGS/001-Wind01", 70)
  181.          
  182.         when 3             #是雪的情况下
  183.           Audio.bgs_play("Audio/BGS/003-Wind03", 80)
  184.          
  185.         end# end case
  186.       end # end if
  187.       $weather_dur = 50
  188.     else                                            #如果天气开关为off
  189.       $weather_type, $weather_power, $weather_dur = [0,0,0]#将天气回复为无
  190.     end # end if
  191.    
  192.     $game_screen.weather($weather_type, $weather_power, $weather_dur)   #显示天气
  193.    
  194.     if $game_switches[$time_date_tone] == true      #如果色调开关为on
  195.       $game_screen.start_tone_change(Tone.new($tone_R, $tone_G, $tone_B, $tone_K), 50)
  196.     else                                            #如果为off
  197.                                                     #色调回复正常
  198.       $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 1)
  199.     end # end if
  200.    
  201.     #当人物走到窗口坐标时移动时间窗口
  202.     if $game_player.screen_x >= ($time_date_X - 16) && $game_player.screen_x <= ($time_date_X + $time_date_W + 16)
  203.       if $game_player.screen_y >= ($time_date_Y - 16) && $game_player.screen_y <= ($time_date_Y + $time_date_H + 16)
  204.                                             # +/- 16 像素是调整手感
  205.         self.x = $time_date_XM
  206.         self.y = $time_date_YM
  207.         time_date_screen_moved = true               #避免与自动隐藏功能互相冲突
  208.         
  209.         case $hide_direction                        #将隐藏方向改为相反的方向
  210.         when 2
  211.           $hide_direction = 8
  212.         when 4
  213.           $hide_direction = 6
  214.         when 6
  215.           $hide_direction = 4
  216.         when 8
  217.           $hide_direction = 2
  218.         end # end case
  219.         
  220.       else                                          #窗口回到原位
  221.         self.x = $time_date_X
  222.         self.y = $time_date_Y
  223.         time_date_screen_moved = false              #避免与自动隐藏功能互相冲突
  224.       end # end if
  225.     else                                            #窗口回到原位
  226.       self.x = $time_date_X
  227.       self.y = $time_date_Y
  228.       time_date_screen_moved = false                #避免与自动隐藏功能互相冲突
  229.     end # end if

  230.     mouse_x, mouse_y = [-1, -1]                     #没使用鼠标脚本时防错
  231.     #如果使用鼠标脚本的话就取消注释
  232.     #如果不使用鼠标脚本的话就注释掉,否则会报错
  233.     #mouse_x, mouse_y = Mouse.get_mouse_pos         #获得鼠标位置
  234.    
  235.     #当按住A键时
  236.       #显示现实时间
  237.     if Input.press?(Input::A)
  238.       show_real_time      
  239.     end # end if
  240.    
  241.     #当鼠标移动到窗口时位置 或是按下Z键时
  242.       #显示已自动隐藏的时间窗口
  243.     if $game_switches[$hide_window] == true
  244.       case $hide_direction                          #调整隐藏方向
  245.       when 2
  246.         self.y = $time_date_Y + $time_date_H - $hide_window_width
  247.       when 4
  248.         self.x = -($time_date_W) + $hide_window_width
  249.       when 6
  250.         self.x = $time_date_X + $time_date_W - $hide_window_width
  251.       when 8
  252.         self.y = -($time_date_H) + $hide_window_width
  253.       end # end case
  254.       if Input.press?(Input::Z) or (mouse_x >= $time_date_X && mouse_x <= ($time_date_X + $time_date_W)) && (mouse_y >= $time_date_Y and mouse_y <= ($time_date_Y + $time_date_H))
  255.         if time_date_screen_moved == false          #避免与自动移动功能互相冲突
  256.           self.x = $time_date_X
  257.           self.y = $time_date_Y
  258.         else
  259.           self.x = $time_date_XM
  260.           self.y = $time_date_YM
  261.         end
  262.       end # end if
  263.     else
  264.       if time_date_screen_moved == false            #避免与自动移动功能互相冲突
  265.         self.x = $time_date_X
  266.         self.y = $time_date_Y
  267.       end
  268.     end # end if
  269.    
  270.     #更新窗口坐标等
  271.     if $game_variables[$time_window_pattern] != @pattern_now
  272.       time_date_window_update
  273.       self.x = $time_date_X
  274.       self.y = $time_date_Y
  275.       self.z = $time_window_z
  276.       self.width = $time_date_W
  277.       self.height = $time_date_H
  278.       self.contents = Bitmap.new($time_date_W - 32, $time_date_H - 32)
  279.       @pattern_now = $game_variables[$time_window_pattern]
  280.     end

  281.   end # end def refresh

  282.   #----------------------#
  283.   #*刷新画面             #
  284.   #----------------------#
  285.   def update
  286.     super
  287.     refresh
  288.   end # end def update
  289. end# end class Window_time

  290. #================================================================================#
  291. #****Scene_Map                                                                   #
  292. #--------------------------------------------------------------------------------#
  293. #    处理地图画面的类别。                                                        #
  294. #================================================================================#
  295. class Scene_Map
  296.   #--------------------------------------------------------------------------
  297.   # ● 主处理
  298.   #--------------------------------------------------------------------------
  299.   alias timedate_main main
  300.   def main
  301.     # 产生活动区块
  302.     @spriteset = Spriteset_Map.new
  303.     # 产生讯息窗口
  304.     @message_window = Window_Message.new
  305.     # 产生时间窗口
  306.     @time_window = Window_Time.new
  307.     if $game_switches[$time_date_running] == false
  308.       @time_window.visible = false
  309.     end # end if
  310.     # 执行过渡
  311.     Graphics.transition
  312.     # 主循环
  313.     loop do
  314.       # 更新游戏画面
  315.       Graphics.update
  316.       # 更新输入讯息
  317.       Input.update
  318.       # 更新画面
  319.       update
  320.       # 如果画面切换的话就中断循环
  321.       if $scene != self
  322.         break
  323.       end # end if
  324.     end # end loop
  325.     # 准备过渡
  326.     Graphics.freeze
  327.     # 释放活动区块
  328.     @spriteset.dispose
  329.     # 释放讯息窗口
  330.     @message_window.dispose
  331.     # 释放时间窗口
  332.     @time_window.dispose
  333.     # 标题画面切换中的情况下
  334.     if $scene.is_a?(Scene_Title)
  335.       # 淡入淡出画面
  336.       Graphics.transition
  337.       Graphics.freeze
  338.     end # end if
  339.   end # end def main
  340.   
  341.   alias timedate_update update
  342.   def update
  343.    
  344.     #如果时间日期功能开关为OFF则不显示时间窗口
  345.     if $game_switches[$time_date_running] == false
  346.       @time_window.visible = false
  347.     else
  348.       @time_window.visible = true
  349.     end # end if

  350.     @time_window.refresh
  351.     timedate_update
  352.   end # end def update
  353. end #end class Scene_Map

  354. #================================================================================#
  355. #****Window_Time                                                                 #
  356. #--------------------------------------------------------------------------------#
  357. #    显示时间的窗口类                                                            #
  358. #================================================================================#
  359. class Window_Time < Window_Base
  360.   
  361.   def show_real_time
  362.     @time = Time.now
  363.     @time_hour = @time.hour  # 用来计算十二小时制的 注意 . 和 _ 的差别
  364.    
  365.     #text = sprintf("%02d年%02d月%02d日 [   ] %02d:%002d ", @time.year, @time.month, @time.day, @time_hour, @time.min)
  366.     self.contents.clear
  367.     self.contents.font.color = real_date
  368.     self.contents.font.size = 22
  369.    
  370.     if $game_switches[$real_time_format] == true
  371.       if @time_hour >= 12
  372.         @time_hour -= 12
  373.         text = "PM"
  374.       else
  375.         text = "AM"
  376.       end # end if
  377.     else
  378.       text = ""
  379.     end # end if
  380.    
  381.     self.contents.draw_text($APM_x, $APM_y, 128, 32, text)
  382.     self.contents.draw_text($year_x, $year_y, 128, $year_font_size + 14, @time.year.to_s + "年")
  383.     self.contents.draw_text($month_x, $month_y, 128, $month_font_size + 14, @time.month.to_s + "月")
  384.     self.contents.draw_text($day_x, $day_y, 128, $day_font_size + 14, @time.day.to_s + "日")
  385.     self.contents.draw_text($hour_x , $hour_y, 128, $hour_font_size + 14, @time_hour.to_s)
  386.     self.contents.draw_text($hour_x + 26, $hour_y - 3, 128, $hour_font_size + 14, ":")
  387.     @time_min = sprintf("%02d", @time.min.to_s)
  388.     self.contents.draw_text($min_x - 3, $min_y, 128, $min_font_size + 14, @time_min)
  389.       
  390.     #!!!!注意!!!!
  391.     #这里是真实时间的星期名称,
  392.     #若是要改变游戏时间的星期名称,请到第二部分282行
  393.     case @time.wday
  394.     when 0
  395.       weektxt = "周日"
  396.     when 1
  397.       weektxt = "周一"
  398.     when 2
  399.       weektxt = "周二"
  400.     when 3
  401.       weektxt = "周三"
  402.     when 4
  403.       weektxt = "周四"
  404.     when 5
  405.       weektxt = "周五"
  406.     when 6
  407.       weektxt = "周六"
  408.     end # end case
  409.     self.contents.draw_text($week_x, $week_y, 128, $week_font_size + 14, weektxt)
  410.   end# end def show_real_time
  411.   
  412.   def get_season_weather
  413.     # 用季节区分天气类型出现机率

  414.     # 春天
  415.     case $game_variables[$season]
  416.     when 1
  417.       $weather_1_rate = $spring_none
  418.       $weather_2_rate = $spring_rain
  419.       $weather_3_rate = $spring_wind
  420.       $weather_4_rate = $spring_snow
  421.       
  422.     # 夏天
  423.     when 2
  424.       $weather_1_rate = $summer_none
  425.       $weather_2_rate = $summer_rain
  426.       $weather_3_rate = $summer_wind
  427.       $weather_4_rate = $summer_snow

  428.     # 秋天
  429.     when 3
  430.       $weather_1_rate = $autumn_none
  431.       $weather_2_rate = $autumn_rain
  432.       $weather_3_rate = $autumn_wind
  433.       $weather_4_rate = $autumn_snow

  434.     # 冬天
  435.     when 4
  436.       $weather_1_rate = $winter_none
  437.       $weather_2_rate = $winter_rain
  438.       $weather_3_rate = $winter_wind
  439.       $weather_4_rate = $winter_snow
  440.       
  441.     end # end case
  442.   end #end definition
  443.   
  444. end
复制代码




              [本贴由 K’ 于 2007-7-31 8:28:00 进行了编辑]
VA脚本开工中...
偷窃脚本1.0 - 已完成

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

2
 楼主| 发表于 2007-7-10 20:30:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
超自定义时间日期天气昼夜脚本系统

有人可能会说:「站上不是早就有这类脚本了吗?还发来作啥?」
但是我这与站上其他脚本不同的地方是「超自定义」四个字
啥叫「超自定义」呢?
就是说所有的东西,包括窗口座标, 字形颜色、大小,显示的文字,排版的方式
都可以按照你所要的去编排

写这个脚本的起因是因为我载了站上的时间脚本系统,但是想要把他改成适合我游戏风格的样式却很很很麻烦,於是发狠自己写了一个。……刚开始也没想到会成功 =_=”

後来写成功後,考虑到可能有其他像我一样的脚本新人会有同样的问题
於是乎…就把它发上来了

功能吗…看下面的介绍吧:

snstar2006 超自定义时间日期天气昼夜系统
  站上已经有许多类似的脚本, 只是如果要修改成有游戏的特色的方式实在不容易
  所以我自己重新写一个脚本, 顺便练习脚本的写法,
  方法绝对不是最好的,可能也很复杂,但是我用了大量的变量来定义
  所以对像我一样的新手来说,要修改起来,难度应该不会很大
  只要把字符串替换掉,或是把窗口坐标修改成想要的地方就好了
  几乎所有的变量定义都在脚本最上面, 其他的我在后面有说明
  要修改的话最大的问题应该是排版问题
  我在脚本里定义了三个排版,只要把7号变量改成 1 就能切换了
      
参考脚本:
      kira 的       事件+脚本 时间系统
      黑羽毛的      完美昼夜脚本
      灼眼的夏娜的  日期,天气,昼夜系统(养成游戏可用)
      sphinger 的   带远景图的小地图(缩略图)
      
  我不是很熟悉脚本语法,所以参考了以上所列的脚本的内容
  snstar2006 向以上诸位致上最高的敬意, 因为我终于完成了人生中第一个脚本系统
  
  功能:
  1. 显示游戏内日期时间, 全部文字和位置都能自己设定.
  2. 按 A 或是 shift 可以显示真实时间, 方便全屏幕时察看时间.
  3. 全部日期时间等都使用变量, 方便在游戏中设定时间.
     (比如说: 过了几天后, 在事件中增加天数的变量就好了)
  4. 打开4号开关开启计时和显示时间功能
     打开5号开关开启天气变化
     打开6号开关开启色调功能
     打开7号开关开启自动隐藏时间窗口功能, 类似window的自动隐藏工具栏
                    与4号开关不同的是, 这个开关只是隐藏窗口, 并不取消
                    计时功能
     打开8号开关变更真实时间显示格式  true = 12小时制  false = 24小时制
  5. 季节和区域天气比例变化
     可以设定不同季节和不同区域所发生的天气
     如:冬天的时候下雪的机率较大, 夏天则多雨
     或是到了沙漠地区就多刮风少下雨, 而到了沼泽区则多下雨少刮风等等
  6. 特定日期指定天气
     如:圣诞节那天一定会下雪
  7. 综合以上两项, 可能会导致在沙漠中圣诞节时下雪 囧
     所以天气选择的优先度是 区域>日期>季节
  8. 模拟真实季节昼夜长短情况
     夏天的时候白天会比较长, 冬天则比较短等
  9. 地图名称自动判断是否在室内
     如果地图名称内有[内]字或在名称之后加上 [,IN], 自动关闭天气功能
10. 本脚本支持鼠标, 只要把215行的注释取消掉就好了

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
  #分两部分是因为本脚本太长了
  #第一部分脚本是主处理,不会改的话就别改了
  #第二部分脚本是自定义变量, 文字, 排版等, 要改都到那里改去
           默认定义了24节气
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
第一部分定义修改部分
148 行 定义天气音效
362 行 定义真实时间 AM/PM 的字
372 行 定义真实时间 星期 的字

第二部分定义修改部分
22 行 窗口自定义
38 行 时间换算率
45 行 时间变量ID
55 行 天气机率百分比
79 行 窗口字型颜色定义
131 行 定义[年]的字
147 行 定义[月]的字
201 行 定义[日]的字
296 行 定义[时]的字
328 行 定义[刻]的字
192 行 定义[季节]的字
273 行 定义[星期]的字
346 行 定义[天气]的字
367 行 定义 二十八星宿
451 行 定义时间色调
585 行 定义区域和区域天气
653 行 定义窗口模式所有坐标长度等等等...
       窗口隐藏方向:2→下 4→左 6→右 8→上
800 行 节日自定义

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
二十八星宿使用思路

站上有关于二十八星宿的数据, 可以参考看看
二十八星宿包含三个部分: 名称, 七耀, 对应动物
所以总共要三个部份可以拿来用, 其中七耀又包含日月 + 五行

首先我们可以设置(用公共事件)当某个星宿出现时, 开启XX功能
如: 当[胃土雉]出现时, 任何地方都可以存盘

再者我们可以设置当某个星宿出现时, X系魔法功能加倍, Y系魔法减弱
如: 当[尾火虎]出现时, 火系魔法功能加倍
    当[心月狐]或[参水猿]出现时, 最适合打火系BOSS

最后我们可以设置当某个星宿出现时, X怪出线机率最频繁, 或是某张地图的入口开启
如: 当[牛金牛]出现时, 牛魔王的子孙会常常遇到
    当[觜火猴]出现时, 水濂洞的入口出现

又想到另外一条思路
可以把控制二十八星宿的变量改为[月份]
然后把二十八星宿改成12生肖或是星座, 用星座的话就可以用在非东方背景的游戏了
超自定义时间日期天气昼夜脚本系统

截图:





冲突可能:其他时间系统脚本(废话~~)、其馀不确定(应该没有吧)

使用地图名称显示脚本时请注意:
本脚本有三种方法分辨角色是否在室内
1. 地图名称包含「内」字
2. 地图名称以 ,IN 结尾(注意有",")
3. 设定地图地形为 98
4. 直接关掉天气开关
看情况使用

功能增新:时段作息变数控制
类似作息开关的功能,只是改用变数控制

脚本1
  1. #================================================================================#
  2. #****Window_Time                                                                 #
  3. #--------------------------------------------------------------------------------#
  4. #    显示时间的窗口类                                                            #
  5. #================================================================================#
  6. class Window_Time < Window_Base
  7.   #----------------------#
  8.   #*初始化对象           #
  9.   #----------------------#
  10.   def initialize
  11.     #更新窗口坐标
  12.     $game_variables[$time_window_pattern] = $default_pattern
  13.     @pattern_now = $default_pattern
  14.     time_date_window_update
  15.    
  16.     #设定窗口
  17.     super($time_date_X, $time_date_Y, $time_date_W, $time_date_H)
  18.     self.contents = Bitmap.new($time_date_W - 32, $time_date_H - 32)
  19.     #self.contents.font.name = (["标楷体"]) #防错用
  20.     self.opacity = $time_window_opacity
  21.    
  22.     #开关初始化 -- 预设防错的 不喜欢再用事件初始化
  23.     $game_switches[$time_date_running] = true #时间功能开启
  24.     $game_switches[$time_date_tone] = true    #色调功能开启
  25.     $game_switches[$hide_window] = false      #隐藏功能关闭
  26.     $game_switches[$real_time_format] = true  #真实时间12小时制
  27.     $game_switches[$time_date_weather] = true #天气功能开启
  28.     $game_switches[$time_map_region] = true   #区域功能开启
  29.    
  30.     #变数归零
  31.     $weather_hour = nil
  32.     $weather_type_rand = 0
  33.     $hour_count = 0
  34.     $weather_hour = 0
  35.     $game_variables[$week] = 1
  36.     @id = $game_map.map_id
  37.     for i in [$min, $hour, $day, $month, $year]
  38.       if $game_variables[i] == 0
  39.         $game_variables[i] = 1
  40.         i+=1
  41.       end # end if
  42.     end # end for
  43.    
  44.     #刷新窗口
  45.     refresh
  46.   end # end def initialize
  47.   #----------------------#
  48.   #*刷新                 #
  49.   #----------------------#
  50.   def refresh
  51.     self.contents.clear
  52.     self.contents.font.size = $time_window_font_size
  53.     self.contents.font.color = game_date
  54.    
  55.     #计算时间
  56.     if $game_switches[$time_date_running] == true
  57.       @total_sec = Graphics.frame_count
  58.       if @total_sec % $min_rate ==0
  59.         $game_variables[$min] += 1
  60.       end
  61.       if $game_variables[$min] >= $hour_rate + 1
  62.         $game_variables[$min] = 1
  63.         $game_variables[$hour] += 1
  64.         $hour_count += 1
  65.       end
  66.       if $game_variables[$hour] >= $day_rate + 1
  67.         $game_variables[$hour] = 1
  68.         $game_variables[$day] += 1
  69.         $game_variables[$week] += 1
  70.         if $game_variables[$week] == 8
  71.           $game_variables[$week] = 1
  72.         end
  73.       end
  74.       if $game_variables[$day] >= $month_rate + 1
  75.         $game_variables[$day] = 1
  76.         $game_variables[$month] += 1
  77.       end
  78.       if $game_variables[$month] >= $year_rate + 1
  79.         $game_variables[$month] = 1
  80.         $game_variables[$year] += 1
  81.       end
  82.     end
  83.    
  84.    
  85.     #判断是否在室内
  86.     newid = $game_map.map_id                        #获取地图ID
  87.     if newid != @id
  88.         @id = newid
  89.     end
  90.     $mapnames = load_data("Data/MapInfos.rxdata")   #读取地图名称
  91.     map_name = $mapnames[@id].name
  92.     if map_name.include?("内") or map_name.include?(",IN")
  93.     #如果地图名称包含"内"或",IN"
  94.       $game_switches[$time_date_weather] = false    #则不显示天气
  95.       $weather_hour = 0
  96.       $weather_type = 99                            #99是让窗口不会显示天气
  97.                                                     #应该不会有人定义99种天气吧
  98.       $game_variables[$time_map_region] = 98
  99.     end
  100.     time_date_window_update                         #窗口文字坐标调整
  101.     print_date                                      #显示文字
  102.     get_season_weather                              #计算季节天气机率
  103.     show_festival                                   #显示节日
  104.     get_region_weather                              #计算区域天气机率
  105.     get_time_range                                  #计算时段
  106.                                              
  107.     #时段控制
  108.     case $game_variables[$time_range]
  109.     when 1  # 午夜
  110.       $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]
  111.     when 2 # 日出
  112.       $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]
  113.     when 3 # 凌晨
  114.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]
  115.     when 4 # 天亮
  116.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]
  117.     when 5 # 中午
  118.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]
  119.     when 6 # 天亮
  120.       $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]
  121.     when 7 # 黄昏
  122.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]
  123.     when 8 # 日落
  124.       $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]
  125.     when 9 # 天黑
  126.       $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]
  127.     when 10 # 午夜
  128.       $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]
  129.     end
  130.    
  131.    
  132.     if $game_switches[$time_date_weather] == true  #天气功能开关为ON时
  133.       #如果天气需要归零
  134.       if $hour_count >= $weather_hour or $weather_hour == 0
  135.         $hour_count = 0                             #天气持续时间归零
  136.         $weather_type_rand = rand(100) + 1          #随机数生成天气类型
  137.         $weather_power =     rand(9) + 1            #随机数生成天气强度
  138.         $weather_hour = rand($weather_hour_max) + 1 #随机数出现天气时间
  139.         $weather_dur = 50
  140.       else
  141.         $weather_1_min = 1                                #天气一最低机率
  142.         $weather_1_max = $weather_1_rate                  #天气一最高机率
  143.         $weather_2_min = $weather_1_max + 1               #天气二最低机率
  144.         $weather_2_max = $weather_2_min + $weather_2_rate #天气二最高机率
  145.         $weather_3_min = $weather_2_max + 1               #天气三最低机率
  146.         $weather_3_max = $weather_3_min + $weather_3_rate #天气三最高机率
  147.         $weather_4_min = $weather_3_max + 1               #天气四最低机率
  148.         $weather_4_max = $weather_4_min + $weather_4_rate #天气四最高机率
  149.         
  150.         if $weather_1_rate != 0
  151.           if $weather_type_rand >= $weather_1_min and $weather_type_rand <=$weather_1_max
  152.             $weather_type = 0 #无
  153.           end
  154.         end
  155.         if $weather_2_rate != 0
  156.           if $weather_type_rand >= $weather_2_min and $weather_type_rand <=$weather_2_max
  157.             $weather_type = 1 #雨
  158.           end
  159.         end
  160.         if $weather_3_rate != 0
  161.           if $weather_type_rand >= $weather_3_min and $weather_type_rand <=$weather_3_max
  162.             $weather_type = 2 #风
  163.           end
  164.         end
  165.         if $weather_4_rate != 0
  166.           if $weather_type_rand >= $weather_4_min and $weather_type_rand <=$weather_4_max
  167.             $weather_type = 3 #雪
  168.           end
  169.         end
  170.         
  171.         #播放天气BGS
  172.         #Audio.bgs_play("文件名",音量,节奏速度)
  173.         case $weather_type #当天气
  174.         when 0
  175.           Audio.bgs_stop
  176.         when 1             #是雨的情况下
  177.           Audio.bgs_play("Audio/BGS/005-Rain01", 60)
  178.          
  179.         when 2             #是风的情况下
  180.           Audio.bgs_play("Audio/BGS/001-Wind01", 70)
  181.          
  182.         when 3             #是雪的情况下
  183.           Audio.bgs_play("Audio/BGS/003-Wind03", 80)
  184.          
  185.         end# end case
  186.       end # end if
  187.       $weather_dur = 50
  188.     else                                            #如果天气开关为off
  189.       $weather_type, $weather_power, $weather_dur = [0,0,0]#将天气回复为无
  190.     end # end if
  191.    
  192.     $game_screen.weather($weather_type, $weather_power, $weather_dur)   #显示天气
  193.    
  194.     if $game_switches[$time_date_tone] == true      #如果色调开关为on
  195.       $game_screen.start_tone_change(Tone.new($tone_R, $tone_G, $tone_B, $tone_K), 50)
  196.     else                                            #如果为off
  197.                                                     #色调回复正常
  198.       $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 1)
  199.     end # end if
  200.    
  201.     #当人物走到窗口坐标时移动时间窗口
  202.     if $game_player.screen_x >= ($time_date_X - 16) && $game_player.screen_x <= ($time_date_X + $time_date_W + 16)
  203.       if $game_player.screen_y >= ($time_date_Y - 16) && $game_player.screen_y <= ($time_date_Y + $time_date_H + 16)
  204.                                             # +/- 16 像素是调整手感
  205.         self.x = $time_date_XM
  206.         self.y = $time_date_YM
  207.         time_date_screen_moved = true               #避免与自动隐藏功能互相冲突
  208.         
  209.         case $hide_direction                        #将隐藏方向改为相反的方向
  210.         when 2
  211.           $hide_direction = 8
  212.         when 4
  213.           $hide_direction = 6
  214.         when 6
  215.           $hide_direction = 4
  216.         when 8
  217.           $hide_direction = 2
  218.         end # end case
  219.         
  220.       else                                          #窗口回到原位
  221.         self.x = $time_date_X
  222.         self.y = $time_date_Y
  223.         time_date_screen_moved = false              #避免与自动隐藏功能互相冲突
  224.       end # end if
  225.     else                                            #窗口回到原位
  226.       self.x = $time_date_X
  227.       self.y = $time_date_Y
  228.       time_date_screen_moved = false                #避免与自动隐藏功能互相冲突
  229.     end # end if

  230.     mouse_x, mouse_y = [-1, -1]                     #没使用鼠标脚本时防错
  231.     #如果使用鼠标脚本的话就取消注释
  232.     #如果不使用鼠标脚本的话就注释掉,否则会报错
  233.     #mouse_x, mouse_y = Mouse.get_mouse_pos         #获得鼠标位置
  234.    
  235.     #当按住A键时
  236.       #显示现实时间
  237.     if Input.press?(Input::A)
  238.       show_real_time      
  239.     end # end if
  240.    
  241.     #当鼠标移动到窗口时位置 或是按下Z键时
  242.       #显示已自动隐藏的时间窗口
  243.     if $game_switches[$hide_window] == true
  244.       case $hide_direction                          #调整隐藏方向
  245.       when 2
  246.         self.y = $time_date_Y + $time_date_H - $hide_window_width
  247.       when 4
  248.         self.x = -($time_date_W) + $hide_window_width
  249.       when 6
  250.         self.x = $time_date_X + $time_date_W - $hide_window_width
  251.       when 8
  252.         self.y = -($time_date_H) + $hide_window_width
  253.       end # end case
  254.       if Input.press?(Input::Z) or (mouse_x >= $time_date_X && mouse_x <= ($time_date_X + $time_date_W)) && (mouse_y >= $time_date_Y and mouse_y <= ($time_date_Y + $time_date_H))
  255.         if time_date_screen_moved == false          #避免与自动移动功能互相冲突
  256.           self.x = $time_date_X
  257.           self.y = $time_date_Y
  258.         else
  259.           self.x = $time_date_XM
  260.           self.y = $time_date_YM
  261.         end
  262.       end # end if
  263.     else
  264.       if time_date_screen_moved == false            #避免与自动移动功能互相冲突
  265.         self.x = $time_date_X
  266.         self.y = $time_date_Y
  267.       end
  268.     end # end if
  269.    
  270.     #更新窗口坐标等
  271.     if $game_variables[$time_window_pattern] != @pattern_now
  272.       time_date_window_update
  273.       self.x = $time_date_X
  274.       self.y = $time_date_Y
  275.       self.z = $time_window_z
  276.       self.width = $time_date_W
  277.       self.height = $time_date_H
  278.       self.contents = Bitmap.new($time_date_W - 32, $time_date_H - 32)
  279.       @pattern_now = $game_variables[$time_window_pattern]
  280.     end

  281.   end # end def refresh

  282.   #----------------------#
  283.   #*刷新画面             #
  284.   #----------------------#
  285.   def update
  286.     super
  287.     refresh
  288.   end # end def update
  289. end# end class Window_time

  290. #================================================================================#
  291. #****Scene_Map                                                                   #
  292. #--------------------------------------------------------------------------------#
  293. #    处理地图画面的类别。                                                        #
  294. #================================================================================#
  295. class Scene_Map
  296.   #--------------------------------------------------------------------------
  297.   # ● 主处理
  298.   #--------------------------------------------------------------------------
  299.   alias timedate_main main
  300.   def main
  301.     # 产生活动区块
  302.     @spriteset = Spriteset_Map.new
  303.     # 产生讯息窗口
  304.     @message_window = Window_Message.new
  305.     # 产生时间窗口
  306.     @time_window = Window_Time.new
  307.     if $game_switches[$time_date_running] == false
  308.       @time_window.visible = false
  309.     end # end if
  310.     # 执行过渡
  311.     Graphics.transition
  312.     # 主循环
  313.     loop do
  314.       # 更新游戏画面
  315.       Graphics.update
  316.       # 更新输入讯息
  317.       Input.update
  318.       # 更新画面
  319.       update
  320.       # 如果画面切换的话就中断循环
  321.       if $scene != self
  322.         break
  323.       end # end if
  324.     end # end loop
  325.     # 准备过渡
  326.     Graphics.freeze
  327.     # 释放活动区块
  328.     @spriteset.dispose
  329.     # 释放讯息窗口
  330.     @message_window.dispose
  331.     # 释放时间窗口
  332.     @time_window.dispose
  333.     # 标题画面切换中的情况下
  334.     if $scene.is_a?(Scene_Title)
  335.       # 淡入淡出画面
  336.       Graphics.transition
  337.       Graphics.freeze
  338.     end # end if
  339.   end # end def main
  340.   
  341.   alias timedate_update update
  342.   def update
  343.    
  344.     #如果时间日期功能开关为OFF则不显示时间窗口
  345.     if $game_switches[$time_date_running] == false
  346.       @time_window.visible = false
  347.     else
  348.       @time_window.visible = true
  349.     end # end if

  350.     @time_window.refresh
  351.     timedate_update
  352.   end # end def update
  353. end #end class Scene_Map

  354. #================================================================================#
  355. #****Window_Time                                                                 #
  356. #--------------------------------------------------------------------------------#
  357. #    显示时间的窗口类                                                            #
  358. #================================================================================#
  359. class Window_Time < Window_Base
  360.   
  361.   def show_real_time
  362.     @time = Time.now
  363.     @time_hour = @time.hour  # 用来计算十二小时制的 注意 . 和 _ 的差别
  364.    
  365.     #text = sprintf("%02d年%02d月%02d日 [   ] %02d:%002d ", @time.year, @time.month, @time.day, @time_hour, @time.min)
  366.     self.contents.clear
  367.     self.contents.font.color = real_date
  368.     self.contents.font.size = 22
  369.    
  370.     if $game_switches[$real_time_format] == true
  371.       if @time_hour >= 12
  372.         @time_hour -= 12
  373.         text = "PM"
  374.       else
  375.         text = "AM"
  376.       end # end if
  377.     else
  378.       text = ""
  379.     end # end if
  380.    
  381.     self.contents.draw_text($APM_x, $APM_y, 128, 32, text)
  382.     self.contents.draw_text($year_x, $year_y, 128, $year_font_size + 14, @time.year.to_s + "年")
  383.     self.contents.draw_text($month_x, $month_y, 128, $month_font_size + 14, @time.month.to_s + "月")
  384.     self.contents.draw_text($day_x, $day_y, 128, $day_font_size + 14, @time.day.to_s + "日")
  385.     self.contents.draw_text($hour_x , $hour_y, 128, $hour_font_size + 14, @time_hour.to_s)
  386.     self.contents.draw_text($hour_x + 26, $hour_y - 3, 128, $hour_font_size + 14, ":")
  387.     @time_min = sprintf("%02d", @time.min.to_s)
  388.     self.contents.draw_text($min_x - 3, $min_y, 128, $min_font_size + 14, @time_min)
  389.       
  390.     #!!!!注意!!!!
  391.     #这里是真实时间的星期名称,
  392.     #若是要改变游戏时间的星期名称,请到第二部分282行
  393.     case @time.wday
  394.     when 0
  395.       weektxt = "周日"
  396.     when 1
  397.       weektxt = "周一"
  398.     when 2
  399.       weektxt = "周二"
  400.     when 3
  401.       weektxt = "周三"
  402.     when 4
  403.       weektxt = "周四"
  404.     when 5
  405.       weektxt = "周五"
  406.     when 6
  407.       weektxt = "周六"
  408.     end # end case
  409.     self.contents.draw_text($week_x, $week_y, 128, $week_font_size + 14, weektxt)
  410.   end# end def show_real_time
  411.   
  412.   def get_season_weather
  413.     # 用季节区分天气类型出现机率

  414.     # 春天
  415.     case $game_variables[$season]
  416.     when 1
  417.       $weather_1_rate = $spring_none
  418.       $weather_2_rate = $spring_rain
  419.       $weather_3_rate = $spring_wind
  420.       $weather_4_rate = $spring_snow
  421.       
  422.     # 夏天
  423.     when 2
  424.       $weather_1_rate = $summer_none
  425.       $weather_2_rate = $summer_rain
  426.       $weather_3_rate = $summer_wind
  427.       $weather_4_rate = $summer_snow

  428.     # 秋天
  429.     when 3
  430.       $weather_1_rate = $autumn_none
  431.       $weather_2_rate = $autumn_rain
  432.       $weather_3_rate = $autumn_wind
  433.       $weather_4_rate = $autumn_snow

  434.     # 冬天
  435.     when 4
  436.       $weather_1_rate = $winter_none
  437.       $weather_2_rate = $winter_rain
  438.       $weather_3_rate = $winter_wind
  439.       $weather_4_rate = $winter_snow
  440.       
  441.     end # end case
  442.   end #end definition
  443.   
  444. end
复制代码




              [本贴由 K’ 于 2007-7-31 8:28:00 进行了编辑]
VA脚本开工中...
偷窃脚本1.0 - 已完成

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

3
 楼主| 发表于 2007-7-10 20:31:25 | 只看该作者
脚本2
  1. =begin
  2. 之所以分两段脚本是因为......
  3. 这个脚本时在太长了
  4. 要修改的时后恐怕找不到正确的地方
  5. 所以...要修改的文字, 要自定义的地方都在这里了

  6. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
  7.   #除了在这格解释的行, 其他的尽量别动,除非你会改
  8.   #1. 显示节日在806行设定月份和日期及节日名即可.
  9.   #   节日可以设置天气, 此天气会覆盖随机数出现的天气.
  10.   #2. 改年, 月, 日, 时, 刻等行的紫色字的时候,如果字数超过默认的数目,
  11.   #   请在同一分歧内添加如: $month_space = ?? 范例请看"十一月"的注释.
  12.   #3. 请注意在修改星期名称的时候, 本脚本内有三处, 一是默认用28星宿代替星期名
  13.   #   二是真实时间的星期名称, 三才是显示非默认星期名称的地方 在274行
  14. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
  15. =end
  16. #================================================================================#
  17. #****Variable Self Define                                                        #
  18. #--------------------------------------------------------------------------------#
  19. #    自定义的变量                                                                #
  20. #================================================================================#
  21.   #窗口自定义
  22.   $time_date_running = 4                   #自定义的时间功能开关
  23.   $time_date_weather = 5                   #自定义的天气功能开关
  24.   $time_date_tone = 6                      #自定义的色调功能开关
  25.   $hide_window = 7                         #自定义的隐藏窗口功能开关
  26.   $real_time_format = 8                    #真实时间的模式开关编号
  27.   
  28.   $time_window_pattern = 9                 #时间窗口的样式变量ID
  29.   $time_map_region = 10                    #自定义的地图局部变量ID
  30.   $time_range = 11                         #自定义的时段变量ID

  31.   $time_window_opacity = 255               #时间窗口不透明度
  32.   $time_window_z = 3000                    #时间窗口高度
  33.   $time_window_font_size = 18              #时间窗口字号,建议不要动,否则版面要重排
  34.   $default_pattern = 0                     #默认的窗口样式
  35.   $weather_hour_max = 5                    #天气持续最长时间
  36.   $hide_window_width = 8                   #隐藏窗口残留宽度
  37.   
  38.   #自定义的时间换算率
  39.   $min_rate = 2400                         #换算为一刻的祯数
  40.   $hour_rate = 5                           #换算为一时的刻数
  41.   $day_rate = 12                           #换算为一日的时数
  42.   $month_rate = 28                         #换算为一月的日数
  43.   $year_rate = 12                          #换算为一年的月数
  44.   
  45.   #自定义的时间变量, 默认2, 3, 4, 5, 6, 7, 8为刻,时,日,月,年,星期,季节
  46.   #用变量是为了能在游戏中任意改变时间
  47.   $min = 2                                 #定义[刻]
  48.   $hour = 3                                #定义[时]
  49.   $day = 4                                 #定义[日]
  50.   $month = 5                               #定义[月]
  51.   $year = 6                                #定义[年]
  52.   $week = 7                                #定义[星]
  53.   $season = 8                              #定义[季节]
  54.   
  55.   #自定义的天气比例百分比,总和最好是100
  56.   $spring_none = 50                         #春天天气为[无]的比例
  57.   $spring_rain = 22                         #春天天气为[雨]的比例
  58.   $spring_wind = 25                         #春天天气为[风]的比例
  59.   $spring_snow = 3                          #春天天气为[雪]的比例
  60.   
  61.   $summer_none = 35                         #夏天天气为[无]的比例
  62.   $summer_rain = 35                         #夏天天气为[雨]的比例
  63.   $summer_wind = 30                         #夏天天气为[风]的比例
  64.   $summer_snow = 0                          #夏天天气为[雪]的比例
  65.                                             #这项其实设为0就好了,之所以还弄个变量
  66.                                             #是为了让版面看起来整齐....还有也许有
  67.                                             #人会像要让异世界的夏天下雪 =_="
  68.   
  69.   $autumn_none = 50                         #秋天天气为[无]的比例
  70.   $autumn_rain = 12                         #秋天天气为[雨]的比例
  71.   $autumn_wind = 35                         #秋天天气为[风]的比例
  72.   $autumn_snow = 3                          #秋天天气为[雪]的比例
  73.   
  74.   $winter_none = 35                         #冬天天气为[无]的比例
  75.   $winter_rain = 15                         #冬天天气为[雨]的比例
  76.   $winter_wind = 15                         #冬天天气为[风]的比例
  77.   $winter_snow = 35                         #冬天天气为[雪]的比例
  78.   
  79.   #自定义字型颜色,这是让想要时间窗口色彩丰富一点的人设计的
  80.   def game_date                             #游戏内的时间颜色
  81.     return Color.new(0, 0, 0, 255)
  82.   end
  83.   def real_date                             #现实的时间颜色
  84.     return Color.new(127, 127, 0, 255)
  85.   end
  86.   def year_color                            #描写[年]的颜色
  87.     return Color.new(0, 0, 0, 255)
  88.   end
  89.   def month_color                           #描写[月]的颜色
  90.     return Color.new(0, 0, 0, 255)
  91.   end
  92.   def day_color                             #描写[日]的颜色
  93.     return Color.new(0, 0, 0, 255)
  94.   end
  95.   def week_color                            #描写[星期]的颜色
  96.     return Color.new(0, 0, 0, 255)
  97.   end
  98.   def hour_color                            #描写[时]的颜色
  99.     return Color.new(0, 0, 0, 255)
  100.   end
  101.   def min_color                             #描写[刻]的颜色
  102.     return Color.new(0, 0, 0, 255)
  103.   end
  104.   def fes_color                             #描写[节日]的颜色
  105.     return Color.new(0, 0, 0, 255)
  106.   end
  107.   def weather_color                         #描写[天气]的颜色
  108.     return Color.new(0, 0, 0, 255)
  109.   end
  110.   def region_color                          #描写[区域]的颜色
  111.     return Color.new(0, 0, 0, 255)
  112.   end


  113.   #预设的时间排版间隔, 排版用, 建议别动, 除非要自己重新排版
  114.   $year_space =74                          #[年]的间隔
  115.   $month_space = 38                        #[月]的间隔
  116.   $day_space = 38                          #[日]的间隔
  117.   $hour_space = 38                         #[时]的间隔
  118.   $min_space = 38                          #[刻]的间隔


  119. #================================================================================#
  120. # ■ Window_Time                                                                  #
  121. #--------------------------------------------------------------------------------#
  122. #  显示时间的窗口类                                                             #
  123. #================================================================================#
  124. class Window_Time < Window_Base
  125.   
  126.   def print_date
  127.     #定义显示[年]
  128.     self.contents.font.color = year_color
  129.     self.contents.font.size = $year_font_size
  130.     case $game_variables[$year]
  131.     when 1
  132.       yeartxt = "江湖一年"
  133.     when 2
  134.       yeartxt = "江湖二年"
  135.     when 3
  136.       yeartxt = "江湖三年"
  137.     when 4
  138.       yeartxt = "江湖四年"
  139.     end
  140.     self.contents.draw_text($year_x, $year_y, 128, $year_font_size + 14, yeartxt)
  141.     #其实根本不需要那么多,一年就要跑很久了   

  142.     #定义显示[月]
  143.     self.contents.font.color = month_color
  144.     self.contents.font.size = $month_font_size
  145.     #$month_x = $year_x + $year_space
  146.     case $game_variables[$month]
  147.     when 1
  148.       monthtxt = "正月" #一月
  149.       $game_variables[$season] = 4
  150.     when 2
  151.       monthtxt = "杏月" #二月
  152.       $game_variables[$season] = 1
  153.     when 3
  154.       monthtxt = "桃月" #三月
  155.       $game_variables[$season] = 1
  156.     when 4
  157.       monthtxt = "槐月" #四月
  158.       $game_variables[$season] = 1
  159.     when 5
  160.       monthtxt = "榴月" #五月
  161.       $game_variables[$season] = 2
  162.     when 6
  163.       monthtxt = "荷月" #六月
  164.       $game_variables[$season] = 2
  165.     when 7
  166.       monthtxt = "桐月" #七月
  167.       $game_variables[$season] = 2
  168.     when 8
  169.       monthtxt = "桂月" #八月
  170.       $game_variables[$season] = 3
  171.     when 9
  172.       monthtxt = "菊月" #九月
  173.       $game_variables[$season] = 3
  174.     when 10
  175.       monthtxt = "梅月" #十月
  176.       $game_variables[$season] = 3
  177.     when 11
  178.       monthtxt = "葭月" #十一月
  179.       $game_variables[$season] = 4
  180.       $month_space = 54 # 如果打[十一月]的话, 间隔须为 54
  181.     when 12
  182.       monthtxt = "腊月" #十二月
  183.       $game_variables[$season] = 4
  184.     end
  185.     self.contents.draw_text($month_x, $month_y, 128, $month_font_size + 14, monthtxt)
  186.    
  187.     #定义显示[季节]
  188.     self.contents.font.size = $season_font_size
  189.     case $game_variables[$season]
  190.     when 1
  191.       self.contents.font.color = Color.new (0, 160, 75, 255)
  192.       seasontxt = "春"
  193.     when 2
  194.       self.contents.font.color = Color.new (255, 50, 50, 255)
  195.       seasontxt = "夏"
  196.     when 3
  197.       self.contents.font.color = Color.new (250, 240, 130, 255)
  198.       seasontxt = "秋"
  199.     when 4
  200.       self.contents.font.color = Color.new (40, 140, 200, 255)
  201.       seasontxt = "冬"
  202.     end
  203.     self.contents.draw_text($season_x, $season_y, 120, $season_font_size + 14, seasontxt)
  204.    
  205.     #定义显示[日]
  206.     self.contents.font.color = day_color
  207.     self.contents.font.size = $day_font_size
  208.     #$day_x = $month_x + $month_space
  209.     case $game_variables[$day]
  210.     when 1
  211.       daytxt = "初一"
  212.     when 2
  213.       daytxt = "初二"
  214.     when 3
  215.       daytxt = "初三"
  216.     when 4
  217.       daytxt = "初四"
  218.     when 5
  219.       daytxt = "初五"
  220.     when 6
  221.       daytxt = "初六"
  222.     when 7
  223.       daytxt = "初七"
  224.     when 8
  225.       daytxt = "初八"
  226.     when 9
  227.       daytxt = "初九"
  228.     when 10
  229.       daytxt = "初十"
  230.     when 11
  231.       daytxt = "十一"
  232.     when 12
  233.       daytxt = "十二"
  234.     when 13
  235.       daytxt = "十三"
  236.     when 14
  237.       daytxt = "十四"
  238.     when 15
  239.       daytxt = "十五"
  240.     when 16
  241.       daytxt = "十六"
  242.     when 17
  243.       daytxt = "十七"
  244.     when 18
  245.       daytxt = "十八"
  246.     when 19
  247.       daytxt = "十九"
  248.     when 20
  249.       daytxt = "二十"
  250.     when 21
  251.       daytxt = "二一"
  252.     when 22
  253.       daytxt = "二二"
  254.     when 23
  255.       daytxt = "二三"
  256.     when 24
  257.       daytxt = "二四"
  258.     when 25
  259.       daytxt = "二五"
  260.     when 26
  261.       daytxt = "二六"
  262.     when 27
  263.       daytxt = "二七"
  264.     when 28
  265.       daytxt = "二八"
  266.     end
  267.     self.contents.draw_text($day_x, $day_y, 120, $day_font_size + 14, daytxt)
  268.     #定义显示[星期]
  269.     self.contents.font.color = week_color
  270.     self.contents.font.size = $week_font_size
  271.     if $game_variables[$time_window_pattern] != $default_pattern
  272.       case $game_variables[$week]
  273.       when 1
  274.         weektxt = "星期一"
  275.       when 2
  276.         weektxt = "星期二"
  277.       when 3
  278.         weektxt = "星期三"
  279.       when 4
  280.         weektxt = "星期四"
  281.       when 5
  282.         weektxt = "星期五"
  283.       when 6
  284.         weektxt = "星期六"
  285.       when 7
  286.         weektxt = "星期日"
  287.       end
  288.       self.contents.draw_text($week_x, $week_y, 128, $week_font_size + 14, weektxt)
  289.     end

  290.     #定义显示[时]
  291.     self.contents.font.color = hour_color
  292.     self.contents.font.size = $hour_font_size
  293.     #$hour_x = $day_x + $day_space
  294.     case $game_variables[$hour]
  295.     when 1
  296.       hourtxt = "子时"#11pm ~ 1am
  297.     when 2
  298.       hourtxt = "丑时"#1am ~ 3am
  299.     when 3
  300.       hourtxt = "寅时"#3am ~ 5am
  301.     when 4
  302.       hourtxt = "卯时"#5am ~ 7am
  303.     when 5
  304.       hourtxt = "辰时"#7am ~ 9am
  305.     when 6
  306.       hourtxt = "巳时"#9am ~ 11am
  307.     when 7
  308.       hourtxt = "午时"#11am ~ 1pm
  309.     when 8
  310.       hourtxt = "未时"#1pm ~ 3pm
  311.     when 9
  312.       hourtxt = "申时"#3pm ~ 5pm
  313.     when 10
  314.       hourtxt = "酉时"#5pm ~ 7pm
  315.     when 11
  316.       hourtxt = "戌时"#7pm ~ 9pm
  317.     when 12
  318.       hourtxt = "亥时"#9pm ~ 11pm
  319.     end
  320.     self.contents.draw_text($hour_x, $hour_y, 128, $hour_font_size + 14, hourtxt)
  321.    
  322.     #定义显示[刻]
  323.     self.contents.font.color = min_color
  324.     self.contents.font.size = $min_font_size
  325.     #$min_x = $hour_x + $hour_space
  326.     case $game_variables[$min]
  327.     when 1
  328.       mintxt = "初刻"
  329.     when 2
  330.       mintxt = "二刻"
  331.     when 3
  332.       mintxt = "三刻"
  333.     when 4
  334.       mintxt = "四刻"
  335.     when 5
  336.       mintxt = "五刻"
  337.     end
  338.     self.contents.draw_text($min_x, $min_y, 128, $min_font_size + 14, mintxt)
  339.    
  340.     #定义显示[天气]
  341.     self.contents.font.color = weather_color
  342.     self.contents.font.size = $weather_font_size
  343.     case $weather_type
  344.     when 0
  345.       weathertxt = "晴"
  346.       self.contents.font.color = Color.new(130, 202, 156)
  347.     when 1
  348.       weathertxt = "雨"
  349.       self.contents.font.color = Color.new(109, 205, 187)
  350.     when 2
  351.       weathertxt = "风"
  352.       self.contents.font.color = Color.new(120, 200, 240)
  353.     when 3
  354.       weathertxt = "雪"
  355.       self.contents.font.color = Color.new(255, 255, 255)
  356.     else
  357.       weathertxt = ""
  358.     end
  359.     self.contents.draw_text($weather_x, $weather_y, 128, $weather_font_size + 14, weathertxt)
  360.    
  361.     #定义显示[星]
  362.     #!!!!注意!!!!
  363.     #这里是默认的二十八星宿代替星期名称.
  364.     #如果要修改游戏内星期名称, 请到???行.
  365.     #呵呵,因为太长了所以丢到后面来写了^^
  366.     case ($game_variables[$day] % 7) #色彩按七耀显示
  367.     when 1
  368.       self.contents.font.color = Color.new (0, 160, 75, 255) # 木
  369.     when 2
  370.       self.contents.font.color = Color.new (250, 240, 130, 255) # 金
  371.     when 3
  372.       self.contents.font.color = Color.new (225, 178, 0, 255) # 土
  373.     when 4
  374.       self.contents.font.color = Color.new (255, 255, 40, 255) # 日
  375.     when 5
  376.       self.contents.font.color = Color.new (255, 255, 150, 255) # 月
  377.     when 6
  378.       self.contents.font.color = Color.new  (255, 50, 50, 255) # 火
  379.     when 0
  380.       self.contents.font.color = Color.new (40, 140, 200, 255) # 水
  381.     end
  382.     if $game_variables[$time_window_pattern] == $default_pattern
  383.       case $game_variables[$day]
  384.       when 1
  385.         weektxt = "角木蛟"
  386.       when 2
  387.         weektxt = "亢金龙"
  388.       when 3
  389.         weektxt = "氐土貉"
  390.       when 4
  391.         weektxt = "房日兔"
  392.       when 5
  393.         weektxt = "心月狐"
  394.       when 6
  395.         weektxt = "尾火虎"
  396.       when 7
  397.         weektxt = "箕水豹"
  398.       when 8
  399.         weektxt = "斗木獬"
  400.       when 9
  401.         weektxt = "牛金牛"
  402.       when 10
  403.         weektxt = "女土蝠"
  404.       when 11
  405.         weektxt = "虚日鼠"
  406.       when 12
  407.         weektxt = "危月燕"
  408.       when 13
  409.         weektxt = "室火猪"
  410.       when 14
  411.         weektxt = "壁水貐"
  412.       when 15
  413.         weektxt = "奎木狼"
  414.       when 16
  415.         weektxt = "娄金狗"
  416.       when 17
  417.         weektxt = "胃土雉"
  418.       when 18
  419.         weektxt = "昴日鸡"
  420.       when 19
  421.         weektxt = "毕月乌"
  422.       when 20
  423.         weektxt = "觜火猴"
  424.       when 21
  425.         weektxt = "参水猿"
  426.       when 22
  427.         weektxt = "井木犴"
  428.       when 23
  429.         weektxt = "鬼金羊"
  430.       when 24
  431.         weektxt = "柳土獐"
  432.       when 25
  433.         weektxt = "星日马"
  434.       when 26
  435.         weektxt = "张月鹿"
  436.       when 27
  437.         weektxt = "翼火蛇"
  438.       when 28
  439.         weektxt = "轸水蚓"
  440.       end
  441.       self.contents.draw_text($week_x, $week_y, 128, $week_font_size + 14, weektxt)
  442.     end
  443.   end
  444.   
  445.   def get_time_range
  446.     case $game_variables[$season]
  447.     #春天的时段
  448.     when 1
  449.       case $game_variables[$hour]
  450.       when 1
  451.         $game_variables[$time_range] = 1
  452.       when 3
  453.         $game_variables[$time_range] = 2
  454.       when 4
  455.         $game_variables[$time_range] = 3
  456.       when 5
  457.         $game_variables[$time_range] = 4
  458.       when 6
  459.         if $game_variables[$min] >= 3
  460.           $game_variables[$time_range] = 5
  461.         end
  462.       when 7
  463.         $game_variables[$time_range] = 6
  464.       when 9
  465.         if $game_variables[$min] >= 3
  466.           $game_variables[$time_range] = 7
  467.         end
  468.       when 10
  469.         $game_variables[$time_range] = 8
  470.       when 11
  471.         if $game_variables[$min] < 3
  472.           $game_variables[$time_range] = 9
  473.         elsif $game_variables[$min] >= 3
  474.           $game_variables[$time_range] = 10
  475.         end
  476.       end #end case
  477.       
  478.     #夏天的时段
  479.     when 2
  480.       case $game_variables[$hour]
  481.       when 1
  482.         $game_variables[$time_range] = 1
  483.       when 3
  484.         if $game_variables[$min] < 3
  485.           $game_variables[$time_range] = 2
  486.         elsif $game_variables[$min] >= 3
  487.           $game_variables[$time_range] = 3
  488.         end
  489.       when 4
  490.         if $game_variables[$min] >= 3
  491.           $game_variables[$time_range] = 4
  492.         end
  493.       when 6
  494.         if $game_variables[$min] >= 3
  495.           $game_variables[$time_range] = 5
  496.         end
  497.       when 7
  498.         $game_variables[$time_range] = 6
  499.       when 10
  500.         if $game_variables[$min] == 4
  501.           $game_variables[$time_range] = 7
  502.         elsif $game_variables[$min] < 3
  503.           $game_variables[$time_range] = 8
  504.         end
  505.       when 11
  506.         if $game_variables[$min] < 3
  507.           $game_variables[$time_range] = 9
  508.         elsif $game_variables[$min] >= 3
  509.           $game_variables[$time_range] = 10
  510.         end
  511.       end #end case
  512.       
  513.     #秋天的时段
  514.     when 3
  515.       case $game_variables[$hour]
  516.       when 1
  517.         $game_variables[$time_range] = 1
  518.       when 2
  519.         $game_variables[$time_range] = 2
  520.       when 4
  521.         $game_variables[$time_range] = 3
  522.       when 5
  523.         $game_variables[$time_range] = 4
  524.       when 6
  525.         if $game_variables[$min] >= 3
  526.           $game_variables[$time_range] = 5
  527.         end
  528.       when 7
  529.         $game_variables[$time_range] = 6
  530.       when 9
  531.         if $game_variables[$min] >= 3
  532.           $game_variables[$time_range] = 7
  533.         end
  534.       when 10
  535.         $game_variables[$time_range] = 8
  536.       when 11
  537.         if $game_variables[$min] < 3
  538.           $game_variables[$time_range] = 9
  539.         elsif $game_variables[$min] >= 3
  540.           $game_variables[$time_range] = 10
  541.         end
  542.       end #end case
  543.     when 4
  544.       
  545.     #冬天的时间色调
  546.       case $game_variables[$hour]
  547.       when 1
  548.         $game_variables[$time_range] = 1
  549.       when 2
  550.         $game_variables[$time_range] = 2
  551.       when 4
  552.         if $game_variables[$min] >= 3
  553.           $game_variables[$time_range] = 3
  554.         end
  555.       when 5
  556.         $game_variables[$time_range] = 4
  557.       when 6
  558.         if $game_variables[$min] >= 3
  559.           $game_variables[$time_range] = 5
  560.         end
  561.       when 7
  562.         $game_variables[$time_range] = 6
  563.       when 9
  564.         if $game_variables[$min] >= 3
  565.           $game_variables[$time_range] = 7
  566.         end
  567.       when 10
  568.         $game_variables[$time_range] = 8
  569.       when 11
  570.         if $game_variables[$min] < 3
  571.           $game_variables[$time_range] = 9
  572.         elsif $game_variables[$min] >= 3
  573.           $game_variables[$time_range] = 10
  574.         end
  575.       end #end case
  576.     end # end case
  577.   end

  578.   def get_region_weather
  579.     self.contents.font.color = region_color
  580.     # 用地图区域区分天气类型出现机率
  581.     case $game_variables[$time_map_region]
  582.     # 1 为雪地   2 为沙漠  3 为山区  4 为海边  5 为湿地
  583.     # 第一个变数为晴天 第二个为雨 第三个为风 第四个为雪
  584.    
  585.     when 0
  586.       regiontxt = ""
  587.     when 1
  588.       $weather_1_rate = 20
  589.       $weather_2_rate = 5
  590.       $weather_3_rate = 5
  591.       $weather_4_rate = 70
  592.       regiontxt = "雪地"
  593.       self.contents.font.color = Color.new(255, 255, 255)
  594.       
  595.     when 2
  596.       $weather_1_rate = 30
  597.       $weather_2_rate = 2
  598.       $weather_3_rate = 68
  599.       $weather_4_rate = 0
  600.       regiontxt = "沙漠"
  601.       self.contents.font.color = Color.new(255, 247, 153)

  602.     when 3
  603.       $weather_1_rate = 30
  604.       $weather_2_rate = 30
  605.       $weather_3_rate = 30
  606.       $weather_4_rate = 10
  607.       regiontxt = "山区"
  608.       self.contents.font.color = Color.new(0, 195, 95)
  609.       
  610.     when 4
  611.       $weather_1_rate = 40
  612.       $weather_2_rate = 25
  613.       $weather_3_rate = 45
  614.       $weather_4_rate = 30
  615.       regiontxt = "海边"
  616.       self.contents.font.color = Color.new(90, 155, 225)
  617.       
  618.     when 5
  619.       $weather_1_rate = 40
  620.       $weather_2_rate = 55
  621.       $weather_3_rate = 25
  622.       $weather_4_rate = 20
  623.       regiontxt = "湿地"
  624.       self.contents.font.color = Color.new(100, 155, 55)
  625.       
  626.     when 98              #这是多加一种天气消失的方法
  627.       $weather_1_rate = 100
  628.       $weather_2_rate = 0
  629.       $weather_3_rate = 0
  630.       $weather_4_rate = 0
  631.       regiontxt = "室内" #显示颜色为设定好的region色
  632.       
  633.     when 99
  634.       $weather_1_rate = 100
  635.       $weather_2_rate = 0
  636.       $weather_3_rate = 0
  637.       $weather_4_rate = 0
  638.       regiontxt = "平原" #显示颜色为设定好的region色
  639.       
  640.     end # end case
  641.    
  642.     self.contents.draw_text($region_x, $region_y, 128, $region_font_size + 14, regiontxt)
  643.   end # end definition
  644.   
  645.   def time_date_window_update
  646.    
  647.     #防错误
  648.     if $game_variables[$time_window_pattern] < 0
  649.       $game_variables[$time_window_pattern] = 0
  650.     end # end if
  651.    
  652.     #自定义日期窗口排版样式
  653.     case $game_variables[$time_window_pattern]
  654.     when 0
  655.       # x 坐标
  656.       $year_x = 4                           #年的 x 坐标
  657.       $month_x = $year_x + $year_space      #月的 x 坐标
  658.       $day_x = $month_x + $month_space      #日的 x 坐标
  659.       $hour_x = $day_x + $day_space         #时的 x 坐标
  660.       $min_x = $hour_x + $hour_space        #刻的 x 坐标
  661.       $fes_x = $min_x + $min_space          #节日的 x 坐标
  662.       $season_x = 450                       #季节的 x 坐标
  663.       $week_x = 480                         #星期的 x 坐标
  664.       $weather_x = 538                      #天气的 x 坐标
  665.       $region_x = 320                       #地形的X坐标
  666.       $APM_x = $min_x + 32                  #真实时间AM/PM X座标
  667.       # y 坐标
  668.       $year_y = -5                          #年的 y 坐标
  669.       $month_y = -5                         #月的 y 坐标
  670.       $day_y = -5                           #日的 y 坐标
  671.       $hour_y = -5                          #时的 y 坐标
  672.       $min_y = -5                           #刻的 y 坐标
  673.       $fes_y = -5                           #节日的 y 坐标
  674.       $season_y = -5                        #季节的 y 坐标
  675.       $week_y = -5                          #星期的 y 坐标
  676.       $weather_y = -5                       #天气的 y 坐标
  677.       $region_y  = -5                       #地形的 y 坐标
  678.       $APM_y = $min_y                       #真实时间AM/PM y座标
  679.       #字号
  680.       $year_font_size = $time_window_font_size      #年的文字大小
  681.       $month_font_size = $time_window_font_size     #月的文字大小
  682.       $day_font_size = $time_window_font_size       #日的文字大小
  683.       $hour_font_size = $time_window_font_size      #时的文字大小
  684.       $min_font_size = $time_window_font_size       #刻的文字大小
  685.       $fes_font_size = $time_window_font_size       #节日的文字大小
  686.       $season_font_size = $time_window_font_size    #季节的文字大小
  687.       $week_font_size = $time_window_font_size      #星期的文字大小
  688.       $weather_font_size = $time_window_font_size   #天气的文字大小
  689.       $region_font_size = $time_window_font_size    #天气的文字大小
  690.       $time_date_X = 0                      #时间窗口X坐标
  691.       $time_date_Y = 425                    #时间窗口Y坐标
  692.       $time_date_W = 640                    #时间窗口宽度
  693.       $time_date_H = 55                     #时间窗口高度
  694.       $time_date_XM = 0                     #时间窗口移动后X坐标
  695.       $time_date_YM = 0                     #时间窗口移动后Y坐标
  696.       $hide_direction = 2                   #时间窗口隐藏方向 -- 下
  697.       

  698.     when 1
  699.       # x 坐标
  700.       $year_x = 56                          #年的 x 坐标
  701.       $month_x = $year_x + $year_space      #月的 x 坐标
  702.       $day_x = $month_x + $month_space      #日的 x 坐标
  703.       $hour_x = 56                          #时的 x 坐标
  704.       $min_x = $hour_x + $hour_space        #刻的 x 坐标
  705.       $fes_x = $min_x + $min_space + 3      #节日的 x 坐标
  706.       $season_x = 4                         #季节的 x 坐标
  707.       $week_x = -2                          #星期的 x 坐标
  708.       $weather_x = $week_x + 65             #天气的 x 坐标
  709.       $region_x = $weather_x +65            #地形的X坐标
  710.       $APM_x = $min_x + 32                  #真实时间AM/PM X座标
  711.       # y 坐标
  712.       $year_y = -5                          #年的 y 坐标
  713.       $month_y = $year_y                    #月的 y 坐标
  714.       $day_y = $year_y                      #日的 y 坐标
  715.       $hour_y = 17                          #时的 y 坐标
  716.       $min_y = $hour_y                      #刻的 y 坐标
  717.       $fes_y = $hour_y                      #节日的 y 坐标
  718.       $season_y = $year_y                   #季节的 y 坐标
  719.       $week_y = 39                          #星期的 y 坐标
  720.       $weather_y = $week_y                  #天气的 y 坐标
  721.       $region_y  = $week_y                  #地形的 y 坐标
  722.       $APM_y = $min_y                       #真实时间AM/PM y座标
  723.       #字号
  724.       $year_font_size = 18                  #年的文字大小
  725.       $month_font_size = 18                 #月的文字大小
  726.       $day_font_size = 18                   #日的文字大小
  727.       $hour_font_size = 18                  #时的文字大小
  728.       $min_font_size = 18                   #刻的文字大小
  729.       $fes_font_size = 18                   #节日的文字大小
  730.       $season_font_size = 40                #季节的文字大小
  731.       $week_font_size = 18                  #星期的文字大小
  732.       $weather_font_size = 18               #天气的文字大小
  733.       $region_font_size = 18                #天气的文字大小
  734.       #窗口样式
  735.       $time_date_X = 0                      #时间窗口X坐标
  736.       $time_date_Y = 0                      #时间窗口Y坐标
  737.       $time_date_W = 250                    #时间窗口宽度
  738.       $time_date_H = 95                     #时间窗口高度
  739.       $time_date_XM = 320                   #时间窗口移动后X坐标
  740.       $time_date_YM = 0                     #时间窗口移动后Y坐标
  741.       $time_window_opacity = 255            #时间窗口不透明度
  742.       $hide_direction = 8                   #时间窗口隐藏方向 -- 上
  743.       
  744.     when 2
  745.       # x 坐标
  746.       $year_x = 4                           #年的 x 坐标
  747.       $month_x = 4                          #月的 x 坐标
  748.       $day_x = 20                           #日的 x 坐标
  749.       $hour_x = 4                           #时的 x 坐标
  750.       $min_x = $hour_x + $hour_space        #刻的 x 坐标
  751.       $fes_x = 4                            #节日的 x 坐标
  752.       $season_x = 60                        #季节的 x 坐标
  753.       $week_x = 14                          #星期的 x 坐标
  754.       $weather_x = 30                       #天气的 x 坐标
  755.       $region_x = 14                        #地形的X坐标
  756.       $APM_x = $min_x + 18                       #真实时间AM/PM X座标
  757.       # y 坐标
  758.       $year_y = -5                          #年的 y 坐标
  759.       $month_y = 20                         #月的 y 坐标
  760.       $day_y = 41                           #日的 y 坐标
  761.       $hour_y = 121                         #时的 y 坐标
  762.       $min_y = $hour_y                      #刻的 y 坐标
  763.       $fes_y = 66                           #节日的 y 坐标
  764.       $season_y = $month_y                  #季节的 y 坐标
  765.       $week_y = 93                          #星期的 y 坐标
  766.       $weather_y = 181                      #天气的 y 坐标
  767.       $region_y  = 148                      #地形的 y 坐标
  768.       $APM_y = $min_y                      #真实时间AM/PM y座标
  769.       #字号
  770.       $year_font_size = 18                  #年的文字大小
  771.       $month_font_size = 18                 #月的文字大小
  772.       $day_font_size = 18                   #日的文字大小
  773.       $hour_font_size = 18                  #时的文字大小
  774.       $min_font_size = 18                   #刻的文字大小
  775.       $fes_font_size = 18                   #节日的文字大小
  776.       $season_font_size = 22                #季节的文字大小
  777.       $week_font_size = 18                  #星期的文字大小
  778.       $weather_font_size = 18               #天气的文字大小
  779.       $region_font_size = 18                #天气的文字大小
  780.       #窗口样式
  781.       $time_date_X = 520                    #时间窗口X坐标
  782.       $time_date_Y = 0                      #时间窗口Y坐标
  783.       $time_date_W = 120                    #时间窗口宽度
  784.       $time_date_H = 240                    #时间窗口高度
  785.       $time_date_XM = 0                     #时间窗口移动后X坐标
  786.       $time_date_YM = 0                     #时间窗口移动后Y坐标
  787.       $time_window_opacity = 255            #时间窗口不透明度
  788.       $game_switches[$hide_window] = true   #隐藏功能关闭
  789.       #注意!! 加了以上那行脚本, 就无法关闭隐藏功能
  790.       #如果还想让隐藏功能在游戏中自由开关的话, 请用事件初始化
  791.       $hide_direction = 6                   #时间窗口隐藏方向 -- 右
  792.     #可以一直加 when下去
  793.     end # end case
  794.   end # end def time_date_window_update
  795.   
  796.   def show_festival
  797.     #$game_screen.start_tone_change(Tone.new(R,G,B,A),祯数)               色调
  798.     #$game_screen.weather(type, power, duration)                          天气
  799.     #--------------------------------------------------------------------------
  800.     # ● 设定天气
  801.     #     type     : 类型 0 无  1 下雨  2 刮风  3 下雪
  802.     #     power    : 强度 1~9
  803.     #     duration : 时间 10~200 祯数
  804.     #--------------------------------------------------------------------------

  805.     #定义[节日/节气]
  806.     #$fes_x = $min_x + $min_space
  807.     #  月份
  808.     #    日期
  809.     self.contents.font.color = fes_color
  810.     case $game_variables[$month]
  811.     when 1
  812.       case $game_variables[$day]
  813.       when 6
  814.         festxt = "[小寒]"
  815.       when 21
  816.         festxt = "[大寒]"
  817.       else
  818.         festxt = "[无节日]"
  819.       end # end case day

  820.     #  月份
  821.     #    日期
  822.     when 2
  823.       case $game_variables[$day]
  824.       when 5
  825.         festxt = "[立春]"
  826.       when 19
  827.         festxt = "[雨水]"
  828.       else
  829.         festxt = "[无节日]"
  830.       end # end case day

  831.     #  月份
  832.     #    日期
  833.     when 3
  834.       case $game_variables[$day]
  835.       when 5
  836.         festxt = "[惊蛰]"
  837.       when 20
  838.         festxt = "[春分]"
  839.       else
  840.         festxt = "[无节日]"
  841.       end # end case day

  842.     #  月份
  843.     #    日期
  844.     when 4
  845.       case $game_variables[$day]
  846.       when 5
  847.         festxt = "[清明]"
  848.       when 20
  849.         festxt = "[谷雨]"
  850.       else
  851.         festxt = "[无节日]"
  852.       end # end case day

  853.     #  月份
  854.     #    日期
  855.     when 5
  856.       case $game_variables[$day]
  857.       when 5
  858.         festxt = "[立夏]"
  859.         #festxt = "[端午]"
  860.       when 21
  861.         festxt = "[小满]"
  862.       else
  863.         festxt = "[无节日]"
  864.         festxt != ""
  865.       end # end case day

  866.     #  月份
  867.     #    日期
  868.     when 6
  869.       case $game_variables[$day]
  870.       when 6
  871.         festxt = "[芒种]"
  872.       when 21
  873.         festxt = "[夏至]"
  874.       else
  875.         festxt = "[无节日]"
  876.       end # end case day

  877.     #  月份
  878.     #    日期
  879.     when 7
  880.       case $game_variables[$day]
  881.       when 7
  882.         festxt = "[小暑]"
  883.       when 23
  884.         festxt = "[大暑]"
  885.       else
  886.         festxt = "[无节日]"
  887.       end # end case day

  888.     #  月份
  889.     #    日期
  890.     when 8
  891.       case $game_variables[$day]
  892.       when 7
  893.         festxt = "[立秋]"
  894.       when 15
  895.         festxt = "[中秋]"
  896.          $weather_type, $weather_power, $weather_dur = [0,0,0]
  897.       when 23
  898.         festxt = "[处暑]"
  899.       else
  900.         festxt = "[无节日]"
  901.       end # end case day

  902.     #  月份
  903.     #    日期
  904.     when 9
  905.       case $game_variables[$day]
  906.       when 8
  907.         festxt = "[白露]"
  908.       when 23
  909.         festxt = "[秋分]"
  910.       else
  911.         festxt = "[无节日]"
  912.       end # end case day

  913.     #  月份
  914.     #    日期
  915.     when 10
  916.       case $game_variables[$day]
  917.       when 8
  918.         festxt = "[寒露]"
  919.         $weather_type, $weather_power, $weather_dur = [3,1,20]#雪
  920.       when 23
  921.         festxt = "[霜降]"
  922.         $weather_type, $weather_power, $weather_dur = [3,2,20]#雪
  923.       else
  924.         festxt = "[无节日]"
  925.       end # end case day

  926.     #  月份
  927.     #    日期
  928.     when 11
  929.       case $game_variables[$day]
  930.       when 7
  931.         festxt = "[立冬]"
  932.         $weather_type, $weather_power, $weather_dur = [3,6,20]#雪
  933.       when 22
  934.         festxt = "[小雪]"
  935.         $weather_type, $weather_power, $weather_dur = [3,7,20]#雪
  936.       else
  937.         festxt = "[无节日]"
  938.       end # end case day

  939.     #  月份
  940.     #    日期
  941.     when 12
  942.       case $game_variables[$day]
  943.       when 7
  944.         festxt = "[大雪]"
  945.         $weather_type, $weather_power, $weather_dur = [3,9,20]#雪
  946.       when 21
  947.         festxt = "[冬至]"
  948.         $weather_type, $weather_power, $weather_dur = [3,8,20]#雪
  949.       else
  950.         festxt = "[无节日]"
  951.       end # end case day
  952.     end# end case month
  953.       
  954. #--------------------------复制贴上在此线之上即可-------------------------------
  955.     self.contents.draw_text($fes_x, $fes_y, 128, $fes_font_size + 14, festxt)
  956.   end # end def show_festival
  957.   
  958. end #end class
复制代码


两个脚本可以贴在一起,或分开贴也可以
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1697
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

4
发表于 2007-7-10 20:45:59 | 只看该作者
赞一个{/qiang}
未来的魔神战记中将要应用这些内容。
另外。你的RM版本不兼容,是英文版的,和我们汉化版的不兼容。
请下载工程后把那个game.ini修改成以下再打开工程
[Game]
Library=RGSS102J.dll
Scripts=Data\Scripts.rxdata
Title=增强型时间/日期窗口
RTP1=Standard
RTP2=
RTP3=

另外在把MAIN里面的
Font.default_name = (["標楷體"])
改成为
Font.default_name = (["黑体"])
另外里面的东西都是英文的,可以参考一下rmxp里面的默认rtp的英文写法。(p.s.连脚本注释和开始菜单都被英文化了,寒啊。)
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

5
 楼主| 发表于 2007-7-10 20:57:24 | 只看该作者
抱歉
没注意到这些
因为我的机器是繁体的,所以测试时改成了标楷体
发帖时往了改回来

谢谢精灵的提醒

更新的连结:
http://rpg.blue/UP_PIC/200707/timedatewindow_chs2.rar

              [本贴由 K’ 于 2007-8-5 8:51:31 最后编辑]
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

6
 楼主| 发表于 2007-7-14 14:58:41 | 只看该作者
自顶

版主可以帮忙发布一下吗?
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3289
在线时间
3618 小时
注册时间
2006-9-6
帖子
37400

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

7
发表于 2007-7-14 20:09:32 | 只看该作者
那个……

能帮我调整一下吗……?
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

8
 楼主| 发表于 2007-7-16 05:16:14 | 只看该作者
LS的…
是想调整什麽?
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
4 小时
注册时间
2006-5-12
帖子
447
9
发表于 2007-7-18 12:55:58 | 只看该作者
我想调整时间窗口像七夕小雨的那样,还有怎样更改时间进制,不用真实时间,用游戏中的时间,比如5帧就是1分钟。谢谢!!{/wx}
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

10
 楼主| 发表于 2007-7-18 16:30:30 | 只看该作者
我这个说明已经很详尽了
LS应该看的懂吧

不要真实时间的话只要把脚本1的
$game_switches[$time_date_weather] = true #天气功能开启
改成false

脚本2 653 行 定义窗口模式所有坐标长度等等等...
修改成你要的地方就行了

BTW
LS的发个截图,看看难的话我帮你调
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-26 15:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表