Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] After 1 minute

I try to do something after 1 minute playtime I already have a playtime window (from MA Full Status CMS) but it won't work what i do :S
So does somebody know a solution? :$
Code:
class Window_PlayTime < Window_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize (x, y)

    super (x, y, 160, WLH + 32)

    refresh

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    x, tw = 0, contents.width

    @total_sec = Graphics.frame_count / Graphics.frame_rate

    hour = @total_sec / 60 / 60

    min = @total_sec / 60 % 60

    sec = @total_sec % 60

    text = sprintf("%02d:%02d:%02d", hour, min, sec)

    self.contents.font.color = normal_color

    self.contents.draw_text(x, 0, tw, WLH, text, 2)

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    super

    if Graphics.frame_count / Graphics.frame_rate != @total_sec

      refresh

    end

  end

end
 
Is there an error?
Juan, I think WLH is a constant initialized in another part of the script(s).

atie, WHAT is it that you want to do after 1 minute?
Unless it's something in the Playtime_Window directly, there is probably a more logical place/way to do it.
 
Ah, then you need an 'autosave' script. You can probably use just the Autosave portion of Plague180's autosave script.

Then you just need to decide when to call it.

If it's purpose is to allow the player to 'continiue' without repeating the intro, then you'd call it at the end of the intro, or 1st thing on the 1st map.

If it's really necessary to save after exactly 1 minute of playtime, you can call it with a parallel event on the 1st map.
 
Use a parallel event on the first map. Event Command: Conditional Branch: Script

(Graphics.frame_count / Graphics.frame_rate) >= 60

In the section where the conditional is true, save the game, then use a self switch to turn off the parallel processing.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top