Jump to content


Photo

Keep "counting down" even when in menus?


  • This topic is locked This topic is locked
5 replies to this topic

#1 oldbone

oldbone

    Advanced Member

  • Members
  • 33 posts
  • Primarily UsesN/A

Posted 21 May 2012 - 02:10 PM

I'm using my own timer based upon variables, switches & parallel common events.

And it works great!

However, the parallel process seems to "pause" when the player is accessing game menus. It does resume just fine when the player is out of the menus... but I'd like to keep the parallel process going while in menus, talking to npc's, etc.

is this an imposibility?

#2 regendo

regendo

    Advanced Member

  • Early Adopter
  • 48 posts
  • LocationGermany
  • Primarily UsesRMVX Ace
  • First LanguageGerman

Posted 21 May 2012 - 04:15 PM

You could simply add your timer's update function to Graphics#update, that way, the timer will be updated on every frame, regardless of what scene you are in.
This post was brought to you by bStefan innovative thoughts. Thanks for reading through the whole of it.

#3 oldbone

oldbone

    Advanced Member

  • Members
  • 33 posts
  • Primarily UsesN/A

Posted 21 May 2012 - 07:53 PM

sorry.. still new. Where is "Graphics#update"? is there a "master" one somewhere?

Thanks!

#4 BigEd781

BigEd781

    undefined method 'stupid_title' found for nil:NilClass

  • Admin
  • 778 posts
  • LocationSan Diego, CA
  • Primarily UsesOther
  • First LanguageDothraki

Posted 21 May 2012 - 08:00 PM

module Graphics
  class << self
    alias :timer_gupdate :update
    def update(*args)
      timer_gupdate(*args)
      (@my_timer ||= 0) += 1  # frame.  To convert to time you will need to use the frame rate    
    end
  end
end

Remember; Graphics.update is called once per frame. To convert this to time (seconds) you will need to divide by the frame rate.

However, even though you posted this in the RGSS section, you seem to be using only events at this point. Should I move this to general support? On a side note, there is nothing an even can do which will allow you to continue processing from another scene (the map and the menu are two completely different scenes, which is why map events do not update when you are in the menu, just as events from map A would not execute if the player were on map B).
- Getting offended is a great way to avoid answering questions that make you sound dumb.

While sloppy writing does not invariably mean sloppy thinking, we've generally found the correlation to be strong -- and we have no use for sloppy thinkers. If you can't yet write competently, learn to.



profile for Ed S. on Stack Exchange, a network of free, community-driven Q&A sites

#5 oldbone

oldbone

    Advanced Member

  • Members
  • 33 posts
  • Primarily UsesN/A

Posted 21 May 2012 - 08:53 PM

Thanks BigEd - will take a look.

My event that keeps "counting down" is a common event, so it survives thru a scene change, game save/load, etc. :)

I'm pretty sure the answer (in the end) will be scripting, so if it's all the same to you - let's leave this here for now.

#6 Rixis

Rixis

    Advanced Member

  • Members
  • 102 posts
  • Primarily UsesN/A

Posted 23 May 2012 - 08:46 PM

solved and closed :]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users