RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
(RMVXA) Scene_Menu show Playtime

0 Members and 1 Guest are viewing this topic.

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Hello.
So far with my editing of scripts, I've followed a simple plan-
1. Make changes/Add stuff
2. Get error message
3. Figure out why I got said error message
4. Fix it (A lot of the time, I go back to 2 at this point. Eventually I move on to 5)
5. Refine script

This time however... I'm getting no such error message... so I don't know what I'm doing wrong.

I added this to Scene_Menu.

Code: [Select]
  def create_playtime_window
    @playtime_window = Window_Playtime.new
    @playtime_window.x = 384
    @playtime_window.y = 272
  end

Then I added this little copy pasted and edited script -

Code: [Select]
#==============================================================================
# ** Window_Playtime
#------------------------------------------------------------------------------
#  This window displays the party's playtime.
#==============================================================================

class Window_Playtime < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(1))
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear

  end
  #--------------------------------------------------------------------------
  # * Draw Play Time
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
    header = DataManager.load_header(@file_index)
    return unless header
  end
  #--------------------------------------------------------------------------
  # * Get Party Playtime
  #--------------------------------------------------------------------------
  def value
    $game_timer
  end
  #--------------------------------------------------------------------------
  # Get Currency Unit
  #--------------------------------------------------------------------------
  def currency_unit
    Vocab::playtime_unit
  end
  #--------------------------------------------------------------------------
  # * Open Window
  #--------------------------------------------------------------------------
  def open
    refresh
    super
  end
end

When I run the game and open the menus... it's just an empty window. Idk wut i did rong

Spoiler for:

maybe u no wut is rong w/it
&&&&&&&&&&&&&&&&

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
it's your refresh method.
You're telling it to clear the window, but not to draw anything afterwards which leaves it empty. :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Times like this make me wonder, what the hell am I even doing here?
I don't know what I'm doing. I'm not a scientician.

Anyway, this is what I have... and it's still not doing anything. ;___;

I think this is the point where I put the keyboard down and walk away.

Code: [Select]
#==============================================================================
# ** Window_Playtime
#------------------------------------------------------------------------------
#  This window displays the party's playtime.
#==============================================================================

class Window_Playtime < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(1))
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
    def refresh
    contents.clear
    change_color(normal_color)
    draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Play Time
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    header = DataManager.load_header(@file_index)
    return unless header
    draw_text(x, y, width, line_height, header[:playtime_s], 2)
  end
  #--------------------------------------------------------------------------
  # * Get Party Playtime
  #--------------------------------------------------------------------------
  def value
    $game_timer
  end
  #--------------------------------------------------------------------------
  # Get Currency Unit
  #--------------------------------------------------------------------------
  def play_time
    Vocab::playtime_unit
  end
  #--------------------------------------------------------------------------
  # * Open Window
  #--------------------------------------------------------------------------
  def open
    refresh
    super
  end
end
&&&&&&&&&&&&&&&&

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Well, just a guess but I believe the issue is caused with your draw_playtime method.
You tell it not to draw anything when there is no header.
You should have it draw something if that's not the case regardless.

Code: [Select]
  #--------------------------------------------------------------------------
  # * Draw Play Time
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    header = DataManager.load_header(@file_index)
    if header
      draw_text(x, y, width, line_height, header[:playtime_s], 2)
    else
      draw_text(x, y, width, line_height, "Fucked if I know?!", 2)
    end
  end
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3