Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Ultimate Timer v3.0, v3.0 Update
XIV
post Aug 17 2010, 02:31 PM
Post #1


Level 2
Group Icon

Group: Member
Posts: 20
Type: Developer
RM Skill: Skilled




Ultimate Timer v3.0

by XIV


Introduction
I noticed that when the timer reaches zero in a battle it disposes the battle windows and returns you to the map. This just doesn't make sense to me so I've decided to create a "fix" for that which also offers some cool features from other people's scripts as well as some that I want to include.

Latest Changes:
20.08.2010.
- added a variable timer feature for easy additions, reductions and whatnot to the timer on the fly
- color setting is now done with an array, removing the need for 3 separate script calls
- custom position setting is now done with an array, removing the need for 2 separate script calls
16.08.2010.
- added graphical controls and a count-up timer
02.08.2010.
- fixed the code a bit, added 2 new features

Features
- you will no longer be returned to the map when the timer in battle reaches 00:00
- when the timer reaches 00:00 it will automatically dispose itself
- disabling the timer in battle with a switch
- hiding the timer with a switch
- freezing the timer on map with a switch
- timer graphical controls (position, color, size, opacity) with script calls*
- a count-up timer*
- a variable timer for easy additions, reductions and other variable operations to the timer on the fly*

* NOT included in the LITE edition of the script

How to Use
Just place this script above Main under the Materials section. Change the switch and variable IDs as you see fit. Use designated script calls in the "Script..." event command for additional options.

Demo (FULL edition)
Ultimate Timer v3.1

Script (LITE edition)
LITE Edition
CODE
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# ====================== XIV's Ultimate Timer v2.0 =============================
# ============================ LITE Edition ====================================
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Credits:
# - Jet
# - BigEd
# - puppeto4
#
# Features:
# - you will no longer be returned to the map when a timer in battle reaches 00:00
# - when the timer reaches 00:00 it will automatically dispose itself
# - disables the timer in battle with a switch
# - hides the timer with a switch
# - freezes the timer on map with a switch
#
# How to use:
# 1. Paste this script above Main in your project
# 2. Set up the switch IDs below
# 3. Use and enjoy!

module XIV_Timer
  # This switch enables(OFF) or disables(ON) the timer in battle
  BATTLE_TIMER = 1
  
  # This switch hides(ON) or shows(OFF) the timer display
  HIDE_TIMER = 3
  
  # This switch freezes(ON) or unfreezes(OFF) the timer on the map
  FREEZE_TIMER = 4
  
end
#-------------------------------------------------------------------------------
# END CUSTOMIZATION
#-------------------------------------------------------------------------------

class Game_System
  include XIV_Timer

def update
    unless $game_switches[FREEZE_TIMER]
      unless @timer_working and $game_switches[BATTLE_TIMER] and $game_temp.in_battle
      if @timer_working and @timer > 0
        @timer -= 1
      end
      if @timer_working and @timer == 0
        @timer_working = false
      end
      end
    end
end # Update

end # Game_System

class Sprite_Timer < Sprite

  alias xiv_ultitimer update unless $@
  def update
    xiv_ultitimer
    if $game_switches[XIV_Timer::HIDE_TIMER]
      self.visible = false
    end
  end # Update
end # Sprite_Timer


FAQ
None as of yet.

Credit and Thanks
Credits:
- BigEd
- puppeto4
- Mac

Thanks:
- Jet
- Speed@
- Terra-chan
- all the wonderful scripters of rpgmakervx.net for making me want to learn RGSS2 and Ruby

Author's Notes
Credit not necessary but it would sure be nice!
Any bugs should be reported in this thread or via PM.
Compatibility
This script overwrites the following methods:
- update of the Game_System class
- command_124 of the Game_Interpreter class
- update of the Sprite_Timer class

This script aliases the following methods:
- initialize of the Game_System class


This post has been edited by XIV: Aug 22 2010, 09:49 AM
Go to the top of the page
 
+Quote Post
   
XIV
post Aug 20 2010, 09:29 AM
Post #2


Level 2
Group Icon

Group: Member
Posts: 20
Type: Developer
RM Skill: Skilled




A v3.0 update!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 04:51 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker