查看: 5647|回复: 13

[已经解决] 每日脚本

[复制链接]
梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
发表于 2013-9-18 22:42:07 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 540486098 于 2013-10-4 16:05 编辑

请求一个每日礼包脚本,就像网游中的每天领一次,至于时间可以自己设定。

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-9-20 08:26:51 | 显示全部楼层
那你先要設定遊戲時間 然後調整電腦時間也不會让他加速
然後你的字很討厭 那三个表情也超不喜歡的
所以我跟本不想幫你...........

回复

使用道具 举报

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-9-21 11:29:29 | 显示全部楼层
76213585 发表于 2013-9-20 08:26
那你先要設定遊戲時間 然後調整電腦時間也不會让他加速
然後你的字很討厭 那三个表情也超不喜歡的
所以我跟 ...

可以帮帮忙吗???

点评

你試試看阿 说的很簡單的樣子.......  发表于 2013-9-21 11:55
回复

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-9-21 11:31:20 | 显示全部楼层
540486098 发表于 2013-9-20 20:29
可以帮帮忙吗???

很難實現的東西你叫我幫你我也辦不到

点评

只需要同步电脑时间就可以了,能用到事件中,比如:当时间达到15分钟,角色等级+1  发表于 2013-9-21 11:37

回复

使用道具 举报

火烧大神

梦石
0
星屑
1916
在线时间
954 小时
注册时间
2012-1-1
回帖
1767
发表于 2013-9-21 20:07:52 | 显示全部楼层
不可能的,除非你的游戏可以联网,

使用主系统的时间来判断,

如果用电脑的时间来判断,那么就有问题了,

玩家只要把电脑的时间+1天、再+1天……无限领礼包

火兔游戏官网上线啦!!
戳 >>> www.huotuyouxi.com <<<戳
回复

使用道具 举报

梦石
0
星屑
1572
在线时间
903 小时
注册时间
2011-3-4
回帖
801
发表于 2013-9-21 20:19:51 | 显示全部楼层
如果只是单纯的同步本地时间的话那玩家可以不停的调时间来获取礼包,(以前用NDS模拟器玩口袋怪兽的时候为了抓气球怪也调过本地时间
最好的方法是把时间和网络上的时间同步上
但是这又涉及到网络数值同步问题
问题越来越麻烦
全民制作人们,大家好,我是练习时长两年半的黄油制作人绿坝,喜欢唱、跳、rap、篮球,music!欢迎加群:107335249
回复

使用道具 举报

梦石
0
星屑
85
在线时间
40 小时
注册时间
2012-7-3
回帖
82
发表于 2013-9-21 22:57:09 | 显示全部楼层
植物大战僵尸貌似也没有解决这个问题吧,在我大天朝,什么办法都能想到。
不过你可以根据游戏时间来制作。
回复

使用道具 举报

梦石
0
星屑
562
在线时间
465 小时
注册时间
2009-10-11
回帖
322
发表于 2013-9-24 08:07:11 | 显示全部楼层
你可以參考這個↓
http://forums.rpgmakerweb.com/in ... game-time-nightday/

  1. #Basic Game Time + Night/Day v1.6.2
  2. #----------#
  3. #Features: Provides a series of functions to set and recall current game time
  4. #          as well customizable tints based on current game time to give the
  5. #          appearance of night and day.
  6. #
  7. #Usage:   Script calls:
  8. #           GameTime::minute?   - returns the current minute
  9. #           GameTime::hour?     - returns the current hour
  10. #           GameTime::set(time) - sets the game time to time, in frames (max:1440)
  11. #           GameTime::change(time) - increments the game time! (can be negative)
  12. #           GameTime::pause_time(set) - stops time for events and stuff, true or false
  13. #           GameTime::pause_tint(set) - time runs, but tints do not update
  14. #           GameTime::clock(set) - sets whether clock is visible or not
  15. #        
  16. #Customization: Set below, in comments.
  17. #
  18. #Examples: GameTime::set(360)
  19. #
  20. #----------#
  21. #-- Script by: V.M of D.T
  22. #
  23. #- Questions or comments can be:
  24. #    posted on the thread for the script
  25. #    given by email: [email]sumptuaryspade@live.ca[/email]
  26. #    provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url]
  27. #    posed on site: daimonioustails.wordpress.com
  28. #
  29. #--- Free to use in any project, commercial or non-commercial, with credit given
  30. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)

  31. #---Game Clock---#
  32. #USE_CLOCK to true to display game time clock
  33. #CLOCK_POSITION for position of clock
  34. #  1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
  35. #CLOCK_TOGGLE is any input button available, see the INPUT help file for options
  36. #------#
  37. USE_CLOCK       = true
  38. CLOCK_POSITION  = 4
  39. CLOCK_TOGGLE    = :SHIFT

  40. module GameTime
  41.   #---Game Time Details---#
  42.   #Number of frames in a game minute, 60 frames = 1 second
  43.   TIME_COUNT      = 60
  44.   #Sets whether to tint screen based on game time
  45.   USE_TINT        = true

  46.   #Switch to denote day or night time
  47.   USE_SWITCH = false
  48.   NIGHT_DAY_SWITCH = 1
  49.   DAY_TIME_START = 6
  50.   NIGHT_TIME_START = 18

  51.   #True to pause time while not in map or while during a message
  52.   PAUSE_IN_COMBAT  = false
  53.   PAUSE_NOT_IN_MAP = true
  54.   PAUSE_IN_MESSAGE = true

  55.   #Sets time frames of tints by minute count, one day is 1440 minutes
  56.   # 0 = 12am, 360 = 6am, 720 = 12pm, 1080 = 6pm  etc...
  57.   PRESUNRISE_TIME = 240
  58.   SUNRISE_TIME    = 360
  59.   NOONSTART_TIME  = 660
  60.   NOONEND_TIME    = 900
  61.   PRESUNSET_TIME  = 1080
  62.   SUNSET_TIME     = 1260
  63.   MIDNIGHT_TIME   = 60  #Must be greater than 0

  64.   #Sets custome tints
  65.   PRESUNRISE_TONE = Tone.new(-75,-75,0,50)
  66.   SUNRISE_TONE    = Tone.new(0,0,0,0)
  67.   NOONSTART_TONE  = Tone.new(45,45,0,-25)
  68.   NOONEND_TONE    = Tone.new(0,0,0,0)
  69.   PRESUNSET_TONE  = Tone.new(-50,-50,0,25)
  70.   SUNSET_TONE     = Tone.new(-75,-100,0,75)
  71.   MIDNIGHT_TONE   = Tone.new(-125,-125,0,125)

  72.   #Include the ids of any maps not to be tinted based on time
  73.   # Usually reserved for indoor maps
  74.   NOTINTMAPS = [2]

  75.   #Store current time in a variable?
  76.   USE_VARIABLE = false
  77.   TIME_VARIABLE = 1

  78.   #---END---#

  79.   def self.init
  80.     $game_time = 0
  81.     $game_time_pause_time = false
  82.     $game_time_pause_tint = false
  83.   end
  84.   def self.update
  85.     if $game_time_pause_time then return else end
  86.     case SceneManager::scene_is?(Scene_Map)
  87.     when true
  88.       if $game_message.visible == true && PAUSE_IN_MESSAGE then else
  89.       $game_time += 1 if Graphics.frame_count % TIME_COUNT == 0 end
  90.     when false

  91.       if !PAUSE_NOT_IN_MAP and !SceneManager::scene_is?(Scene_Battle)
  92.         $game_time += 1 if Graphics.frame_count % TIME_COUNT == 0 end
  93.       if SceneManager::scene_is?(Scene_Battle) && PAUSE_IN_COMBAT != true
  94.       $game_time += 1 if Graphics.frame_count % TIME_COUNT == 0 end
  95.     end
  96.     if $game_time == 1440 then $game_time = 0 end
  97.     $game_variables[TIME_VARIABLE] = $game_time if USE_VARIABLE
  98.     update_night_switch if USE_SWITCH
  99.     GameTime::tint if $game_time_pause_tint != true
  100.   end
  101.   def self.update_night_switch
  102.     if hour? > DAY_TIME_START and hour? < NIGHT_TIME_START
  103.       $game_switches[NIGHT_DAY_SWITCH] = true unless $game_switches[NIGHT_DAY_SWITCH] == true
  104.     else
  105.       $game_switches[NIGHT_DAY_SWITCH] = false unless $game_switches[NIGHT_DAY_SWITCH] == false
  106.     end
  107.   end
  108.   def self.hour?
  109.     return $game_time / 60
  110.   end
  111.   def self.minute?
  112.     return $game_time % 60
  113.   end
  114.   def self.time?
  115.     meri = "AM"
  116.     hour = GameTime::hour?
  117.     minute = GameTime::minute?
  118.     if hour > 11 then meri = "PM" end
  119.     if hour == 0 then hour = 12; meri = "AM" end
  120.     if hour > 12 then hour -= 12 end
  121.     if hour < 10 then hour = " " + hour.to_s else hour.to_s end
  122.     if minute < 10 then minute = "0" + minute.to_s else minute.to_s end
  123.     return hour.to_s + ":" + minute.to_s + " " + meri
  124.   end
  125.   def self.set(number)
  126.     $game_time = number if number < 1440
  127.     GameTime::tint(0) if $game_time_pause_tint != true
  128.   end
  129.   def self.change(number)
  130.     $game_time += number
  131.     $game_time -= 1440 if $game_time > 1440
  132.     $game_time += 1440 if $game_time < 0
  133.     GameTime::tint(0) if $game_time_pause_tint != true
  134.   end
  135.   def self.tint(tint = 60)
  136.     if USE_TINT != true then return end
  137.     for i in NOTINTMAPS
  138.       if $game_map.map_id == i
  139.         $game_map.screen.start_tone_change(Tone.new(0,0,0,0),0)
  140.         return
  141.       end
  142.     end
  143.     if SceneManager::scene_is?(Scene_Map) then else return end
  144.     case $game_time
  145.     when PRESUNRISE_TIME .. SUNRISE_TIME
  146.       $game_map.screen.start_tone_change(PRESUNRISE_TONE, tint)
  147.     when SUNRISE_TIME .. NOONSTART_TIME
  148.       $game_map.screen.start_tone_change(SUNRISE_TONE, tint)
  149.     when NOONSTART_TIME .. NOONEND_TIME
  150.       $game_map.screen.start_tone_change(NOONSTART_TONE, tint)
  151.     when NOONEND_TIME .. PRESUNSET_TIME
  152.       $game_map.screen.start_tone_change(NOONEND_TONE, tint)
  153.     when PRESUNSET_TIME .. SUNSET_TIME
  154.       $game_map.screen.start_tone_change(PRESUNSET_TONE, tint)
  155.     when SUNSET_TIME .. 1440
  156.       $game_map.screen.start_tone_change(SUNSET_TONE, tint)
  157.     when 0 .. MIDNIGHT_TIME
  158.       $game_map.screen.start_tone_change(SUNSET_TONE, tint)
  159.     when MIDNIGHT_TIME .. PRESUNRISE_TIME
  160.       $game_map.screen.start_tone_change(MIDNIGHT_TONE, tint)
  161.     end
  162.   end
  163.   def self.pause_time(set)
  164.     $game_time_pause_time = set
  165.   end
  166.   def self.pause_tint(set)
  167.     $game_time_pause_tint = set
  168.   end
  169.   def self.clock(set)
  170.     return unless SceneManager.scene.is_a?(Scene_Map)
  171.     SceneManager.scene.clock_visible?(set)
  172.   end

  173.   class Window_Clock < Window_Base
  174.     def initialize
  175.       case CLOCK_POSITION
  176.       when 1
  177.         super(0,0,115,56)
  178.       when 2
  179.         super(429,0,115,56)
  180.       when 3
  181.         super(0,360,115,56)
  182.       when 4
  183.         super(429,360,115,56)
  184.       end
  185.       self.visible = $game_time_clock_visibility unless $game_time_clock_visibility.nil?
  186.     end
  187.     def update
  188.       self.contents.clear
  189.       self.contents.draw_text(0,0,100,24,GameTime::time?)
  190.       $game_time_clock_visibility = self.visible
  191.     end
  192.   end

  193. end

  194. GameTime::init

  195. module DataManager
  196.   class << self
  197.   alias gametime_msc make_save_contents
  198.   alias gametime_esc extract_save_contents
  199.   end
  200.   def self.make_save_contents
  201.     contents = gametime_msc
  202.     contents[:gametime] = $game_time
  203.     contents
  204.   end
  205.   def self.extract_save_contents(contents)
  206.     gametime_esc(contents)
  207.     $game_time = contents[:gametime]
  208.   end
  209. end


  210. class Scene_Map < Scene_Base
  211.   alias gametime_post_transfer post_transfer
  212.   alias gametime_create_all_windows create_all_windows
  213.   alias gametime_update_map update
  214.   def post_transfer
  215.     GameTime::tint(0) if $game_time_pause_tint != true
  216.     gametime_post_transfer
  217.   end
  218.   def create_all_windows
  219.     gametime_create_all_windows
  220.     @gametimeclock = GameTime::Window_Clock.new if USE_CLOCK
  221.   end
  222.   def update
  223.     gametime_update_map
  224.     @gametimeclock.update if @gametimeclock.nil? == false
  225.     if Input.trigger?(CLOCK_TOGGLE) and @gametimeclock.nil? == false
  226.       @gametimeclock.visible ? @gametimeclock.visible = false : @gametimeclock.visible = true
  227.     end
  228.   end
  229.   def clock_visible?(set)
  230.     @gametimeclock.visible = set
  231.   end
  232. end

  233. class Scene_Base
  234.   alias gametime_update update
  235.   def update
  236.     gametime_update
  237.     GameTime::update
  238.   end
  239. end
复制代码
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复

使用道具 举报

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-9-30 14:37:52 | 显示全部楼层
本帖最后由 540486098 于 2013-9-30 14:39 编辑

难道我讲的不够清楚?我需要这样的效果:

可以同步电脑时间,
当(电脑计时)时间达到15分钟,
则打开某个开关。

不需要考虑通过调整时间达到无限领礼包。

@绿坝
@火烧兔子
@a000b1745  

本人在学校上课,发帖晚了些.......请原谅

点评

楼下正解请看  发表于 2013-10-8 21:59
回复

使用道具 举报

梦石
0
星屑
50
在线时间
32 小时
注册时间
2013-6-28
回帖
39
发表于 2013-9-30 14:47:06 | 显示全部楼层
[ 本帖最后由 巴尔德 于 2013-9-30 14:48 编辑 ]\n\n先记录一个时间,然后在需要判断的时候获取当前的时间,求差,如果大于15分钟,那么则打开某个开关,允许领礼包,领完礼包后,将当前的时间再次记录,同事继续做判断处理。

道理上就是这些,关键字
Time.now
@ time = Time.now
Time.now - @ time > 15分钟   
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部