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
> Display PlayTime and Steps in Menu, RPG Maker VX
modern-day-pirat...
post Sep 8 2008, 02:06 PM
Post #1


Level 4
Group Icon

Group: Member
Posts: 56
Type: Event Designer
RM Skill: Beginner




Steps and Time in Menu

Version: 1.0
Author: Modern-Day-Pirate
Release Date: September 8th 2008


Exclusive Script at RPG RPG Revolution


Introduction

My first script! yayz! This is a little something I threw together to show player step count and playtime on the menu. biggrin.gif

Script
CODE
#------------------------------------------------------------------------------
# Author : Modern-Day-Pirate
# How to use:
# Just place above main
#------------------------------------------------------------------------------

#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 80)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(-18, -10, self.width-40, 32, "Play Time",1)
@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(4, 20, 120, 36, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
# This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 80)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, -10, self.width-40, 32, "Step Count")
self.contents.font.color = normal_color
self.contents.draw_text(4, 20, 120, 32, $game_party.steps.to_s, 2)
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias pirate_playtime_start start
alias pirate_playtime_terminate terminate
alias pirate_playtime_update update
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
# The usual
pirate_playtime_start
# Create @play_window
@play_window = Window_PlayTime.new(@gold_window.x, @gold_window.y - 80)
# Create @steps_window
@steps_window = Window_Steps.new(@gold_window.x, @gold_window.y - 160)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
# The usual
pirate_playtime_terminate
# Dispose @play_window
@play_window.dispose
# Dispose @steps_window
@steps_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# The usual
pirate_playtime_update
# Update @play_window
@play_window.update
# Update @steps_window
@steps_window.update
end
end


Customization

line18 super(x, y, 160, 80)
line57 super(x, y, 160, 80)
change '160' and '80' to set the size of the windows(first # is width second is height).

line91 @play_window = Window_PlayTime.new(@gold_window.x, @gold_window.y - 80)
line93 @steps_window = Window_Steps.new(@gold_window.x, @gold_window.y - 160)

change red text to (x,y) coordinates for where to display window

Compatibility

RPG Maker VX

Screenshot



DEMO

Not needed.

Installation

Just place above main.

Terms and Conditions

Give credit where credit is due.

Credits

ME! Modern-Day-Pirate

Bug Report?
Please give me this information:
QUOTE
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?


__________________________
Go to the top of the page
 
+Quote Post
   
Xaiko
post Sep 17 2008, 03:54 PM
Post #2


Level 1
Group Icon

Group: Member
Posts: 6
Type: None
RM Skill: Undisclosed




I tested it and it's working. A fine little script wink.gif
Thought about implementing step count in a project.
Go to the top of the page
 
+Quote Post
   
Openvivi
post Sep 26 2008, 11:44 AM
Post #3



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




It's awesome![size="4"][/size]
Go to the top of the page
 
+Quote Post
   
modern-day-pirat...
post Sep 26 2008, 12:37 PM
Post #4


Level 4
Group Icon

Group: Member
Posts: 56
Type: Event Designer
RM Skill: Beginner




@Xaiko
Glad to hear it's working great!

@Openvivi
Thanks for the positive feed back!


__________________________
Go to the top of the page
 
+Quote Post
   
Messia
post Oct 20 2008, 11:58 AM
Post #5


Level 2
Group Icon

Group: Member
Posts: 22
Type: None
RM Skill: Beginner




Works a treat smile.gif Thank you. Just one minor problem in that it overlaps my menu slightly because I have two added menu items.
Go to the top of the page
 
+Quote Post
   
SuperMega
post Oct 20 2008, 04:08 PM
Post #6


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Simple but useful, thanks.


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
modern-day-pirat...
post Oct 21 2008, 01:31 PM
Post #7


Level 4
Group Icon

Group: Member
Posts: 56
Type: Event Designer
RM Skill: Beginner




QUOTE (Messia @ Oct 20 2008, 12:58 PM) *
Works a treat smile.gif Thank you. Just one minor problem in that it overlaps my menu slightly because I have two added menu items.


with just a few adjustments in the size of the windows you could get it all fitting neat and snug.


__________________________
Go to the top of the page
 
+Quote Post
   
Messia
post Oct 23 2008, 01:21 PM
Post #8


Level 2
Group Icon

Group: Member
Posts: 22
Type: None
RM Skill: Beginner




Yea, I think I will have a look at that when I can be bothered ^^ not too big a deal right now. I thank you again for the cool script smile.gif
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: 24th May 2013 - 11:05 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker