[Script] [ACE] [Hỏi] Timer

HakuryuuHakuryuu Posts: 5Registered
Mình muốn tạo một Minigame thế này.
1. Cho thời gian đếm ngược 20 giây
2. Cho hiện bảng name input để nhập kí tự
3. Sau 20 giây không nhập thì thua
4. Nếu nhập đúng thì tiếp tục, không thì thua

Nhưng mình đang gặp một vấn đề là khi cho hiện bảng name input thì time đứng, không chạy tiếp, nên ai pro cho mình xin ý kiến với :'(

Comments

  • YuuYuu Posts: 1,160Registered
    Chuyển cái bộ đếm ngược thời gian sang Parallax Event là được thôi!
  • HakuryuuHakuryuu Posts: 5Registered
    Tớ đã thử mọi cách nhưng đều không thành...
  • DeathDeath Posts: 732Registered, Moderators
    À cái này Sang hỏi mình để làm trong Seven Mysteries đây mà :boiboi:
    Cái này phải sửa script cơ, không làm bằng event được đâu.
  • HakuryuuHakuryuu Posts: 5Registered
    Death wrote:
    À cái này Sang hỏi mình để làm trong Seven Mysteries đây mà :boiboi:
    Cái này phải sửa script cơ, không làm bằng event được đâu.

    help me // A \\
  • DeathDeath Posts: 732Registered, Moderators
    Cái này có lần mình hướng dẫn rồi thì phải, nhưng chắc xóa mất tiêu rồi :benhnang:
  • HakuryuuHakuryuu Posts: 5Registered
    please, làm ơn đừng bỏ em // A \\ :v
  • KensolokoKensoloko Posts: 35Registered
    Bạn ơi vào đây down cái script này của Soulpour777
    http://infinitytears.wordpress.com/2014/06/14/rgss3-global-timer-ex/
  • DeathDeath Posts: 732Registered, Moderators
    Còn đây là script của mình:
    class Scene_MenuBase < Scene_Base
      def update
        super
        @map.update
      end
      alias start_timer start
    	def start
    	start_timer
        @map = Sprite_Timer.new(Viewport.new)
    	end
    end
    class Scene_Name < Scene_MenuBase
      def update
        super
        $game_timer.update
        if $game_timer.sec == 0
          $game_switches[1] = true #Fail
          SceneManager.call(Scene_Map)
        end
      end
    end
    class Scene_Map < Scene_Base
      alias map_timer update
      def update
        map_timer
        if $game_switches[2] == true #Timer
          if $game_timer.sec == 0
            $game_message.clear
            $game_switches[2] = false
            SceneManager.call(Scene_Map)
          end
        end
      end
    end
    
    Trong script có mấy biến $game_switches bạn tự tìm hiểu và thay thế.
    Demo: https://www.dropbox.com/s/zkeritv5ozmm6jf/Crack.rar
  • HakuryuuHakuryuu Posts: 5Registered
    Kensoloko wrote:
    Bạn ơi vào đây down cái script này của Soulpour777
    http://infinitytears.wordpress.com/2014/06/14/rgss3-global-timer-ex/

    Cảm ơn bạn nhé, đúng cái mình cần \ :v /
    Death wrote:
    Còn đây là script của mình:
    class Scene_MenuBase < Scene_Base
      def update
        super
        @map.update
      end
      alias start_timer start
    	def start
    	start_timer
        @map = Sprite_Timer.new(Viewport.new)
    	end
    end
    class Scene_Name < Scene_MenuBase
      def update
        super
        $game_timer.update
        if $game_timer.sec == 0
          $game_switches[1] = true #Fail
          SceneManager.call(Scene_Map)
        end
      end
    end
    class Scene_Map < Scene_Base
      alias map_timer update
      def update
        map_timer
        if $game_switches[2] == true #Timer
          if $game_timer.sec == 0
            $game_message.clear
            $game_switches[2] = false
            SceneManager.call(Scene_Map)
          end
        end
      end
    end
    
    Trong script có mấy biến $game_switches bạn tự tìm hiểu và thay thế.
    Demo: https://www.dropbox.com/s/zkeritv5ozmm6jf/Crack.rar

    tks bạn luôn nhé, mới cạy seven mysteries của bác Sang nên cũng biết chút ít :v
Sign In or Register to comment.