Script to pause/resume timer on RMXP

● ARCHIVED · READ-ONLY
Started by kleber10 6 posts View original ↗
  1. Hello, everyone.

    I have a simple code. When i'm on a battle and the timer reaches 0:00, I'm kicked out of the battle.

    So, I have a script that pause and resumes the timer. It works on RMVX Ace, but on RMXP this message appears:

    " undefined method `update' for class `Game_Timer' "

    What can be done?

    Code:
    class Game_Timer  alias timer_plus_update update  def update    if !@pause      timer_plus_update    end  end  def pause    @pause = true  end  def resume    @pause = false  endend
  2. Thanks for the help. I actually don't understand much about RGSS, I modify some scripts just by logic cause I know some programming languages.

    I found a topic on the link that made me realize that there's not "game_timer" on RMXP. The timer is on "game_system". So I just had to change the class and variable and done! Working as it should.

    Code:
    class Game_System  #--------------------------------------------------------------------------  # * Pause  #--------------------------------------------------------------------------  def pause    @timer_working = false if @timer > 0  end  #--------------------------------------------------------------------------  # * Unpause  #--------------------------------------------------------------------------  def unpause    @timer_working = true if @timer > 0  endend
  3. Glad you managed to solve your problem.

    You must have had prior scripting knowledge!

    Good luck! ^^
  4. Haha, thanks.

    I know that, I just don't have much time to learn now, so I asked for help just today. But in a short future I hope can solve my own problems lol
  5. Don't be afraid to ask for help around here.

    Though the community may not be able to answer all your questions or may sometimes tell you to refer elsewhere, such as tutorials, they are generally a helpful bunch.

    The fact that you have some programming knowledge will help you in the long run when it comes to scripting.

    Again, good luck, and have a great time creating your game! ^^