Display the timer in Milliseconds

Is there a way to change the way the timer is displayed that way M S and ms are displayed?  Instead of 15:00 (15 minutes), it would display 15:00:00 with of course the milliseconds rapidly going down.  Giving the urge to the player that need to HURRY and get out of there (such as the island is sinking you need to get out of there!)

I've seen a couple scripts and I've tried them out as well as modify them to no avail.  Either the timer ticks normally, or the play test crashes.

Any help is greatly appericated!  Thanks!
One frame is equal to 1 / FPS seconds (eg: one frame = 1/60 seconds for 60 FPS), so you won't be able to get an exact millisecond value. I'm assuming that is not an issue?
No it shouldn't be, I would do extenstive testing to see how it turned out.
Here was the script I found but it doesn't work. EIther the game play crashes or the timer (tinkering with the script a tad) doesn't work if this gives anyone an idea:

  1. #==============================================================================
  2. # ** Sprite_Timer
  3. #------------------------------------------------------------------------------
  4. #  This sprite is used to display the timer.It observes the $game_system
  5. #  class and automatically changes sprite conditions.
  6. #==============================================================================
  7.  
  8. class Sprite_Timer < Sprite
  9.   #--------------------------------------------------------------------------
  10.   # * Object Initialization
  11.   #--------------------------------------------------------------------------
  12.   def initialize
  13.     super
  14.     Graphics.frame_rate = 0.01
  15.     self.bitmap = Bitmap.new(132, 48)
  16.     self.bitmap.font.name = "Arial"
  17.     self.bitmap.font.size = 32
  18.     self.x = 640 - self.bitmap.width
  19.     self.y = 0
  20.     self.z = 500
  21.     update
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # * Dispose
  25.   #--------------------------------------------------------------------------
  26.   def dispose
  27.     if self.bitmap != nil
  28.       self.bitmap.dispose
  29.     end
  30.     super
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # * Frame Update
  34.   #--------------------------------------------------------------------------
  35.   def update
  36.     super
  37.     self.visible = $game_system.timer_working
  38.     if $game_system.timer.to_f / 40.0 != @total_sec
  39.       self.bitmap.clear
  40.       @total_sec = $game_system.timer.to_f / 40.0
  41.       min = @total_sec / 60
  42.       sec = @total_sec % 60
  43.       mil = (@total_sec.to_f * 60) % 60
  44.       text = sprintf("%02d:%02d:%02d", min, sec, mil)
  45.       self.bitmap.font.color.set(255, 255, 255)
  46.       self.bitmap.draw_text(self.bitmap.rect, text, 1)
  47.     end
  48.   end
  49. end
I think that script is from VX. And still I doubt of it working there, but anyway. I did this. Problem is, these numbers change too fast, I don't think it will be... uh... worth it. For that matter I also made something to adjust the speed, but I'm not hoping for that to work properly.

Anyway, here the script:

Code:
class Game_Timer  MIL_SPEED = 4 #Higher == slower.  def mil    gfc = Graphics.frame_count / MIL_SPEED    c = @count / MIL_SPEED    (c % gfc) * 100 / gfc  endend class Sprite_Timer < Sprite  def update_bitmap    if $game_timer.mil != @total_mil      @total_mil = $game_timer.mil      @total_sec = $game_timer.sec      redraw    end  end  def timer_text    sprintf("%02d:%02d:%02d", @total_sec / 60, @total_sec % 60, @total_mil)  endend
I'll try this out thanks, but yeah your right if your trying to do an escape theme and the "game over" starts at like 00:01:82 then yea because thats off almost a second.  It would just be totally awesome to have it kinda like in metroid to give that players heart racing.  I'll get back to you and let you know how it works. 

Yeah I think the script was VX based but the website I found it off didn't indicate what version they were using.
I tried your script it works but the timer slows down over time as well as the timer stops at 00:01:00 (whether the player leaves the map or stays on the same map).  The best "soultion" I've found is using a Timer Script by Glav

http://galvs-scripts.com/galvs-variable-timer/  http://galvs-scripts.com/2012/10/03/variable-timer-functions/ here and calling a script and a variable and increase the speed dramatically enough to give that rushing feel. 

Example:  Timer speed is set at -10 so at about 79M59S it's equal to about eh roughly 8 minutes.  When the timer hits 0, game over, or whatever is called as long as you have the conditonal branch on the map.

I'd still rather have milliseconds but if not this is the best soutlion I've come up with after researching.
Ultimacj, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


You have two topics for this - one with scripts, and one to make the timer go over 99 seconds. Please stick with ONE topic until the issue is resolved, and if you give up on it, report it and ask for it to be closed, so people aren't still trying to assist you, when you've decided to go a different way.
Ah ok man not sure how I double posted I didn't repeat the same thing twice (which is what double posting is but every forum is a different format so I wasn't aware--not to mention they're two different topics ones based on limit and one is based on changing a format).  But I'll try to keep that in mind thanks, I didn't think it was the same thing sorry about that 😉

I guess this CAN be closed since no one's solved it; I tried multiple edits off the assist script but it didn't work out at all, it's totally not accurate (not to mention the timer stops at 00:00:01 regardless) and I was going back on some of my posts.  I decided to go with Galv's timer script but modified to were a the timer starts @ 50 minutes but the seconds are boosted up dramatically to give that millisecond effect, so the timer is roughly about 10 minutes.  Would be nice to do milliseconds but no biggie, I'm hoping this new effect will give that same "impression"

Thanks again mura I appreciate the help!

Original thread: https://forums.rpgmakerweb.com/threads/display-the-timer-in-milliseconds.19311/