Version/Build Number v1.1
By V.M.
Introduction
Lets you have a unfancy little window on your title screen that displays the version and current build!
(Build is an arbitrary number that basically is how many times the game has been run)
Screenshots
Oh, something I can screenshot!
How to Use
Plug and play and customize, notes in script as usual.
Script
By V.M.
Introduction
Lets you have a unfancy little window on your title screen that displays the version and current build!
(Build is an arbitrary number that basically is how many times the game has been run)
Screenshots
Oh, something I can screenshot!
How to Use
Plug and play and customize, notes in script as usual.
Script
- Code:
#Version/Build Number
#----------#
#Features: Allows you to display what version your game is on and for purely
# special purposes what build as well (not fancy, just how many times
# game hs been started in unreleased)
#
#Usage: Plug and play and customize
#
#Customization: Set below, in comments.
#----------#
#-- Script by: V.M of D.T
#--- Free to use in any project with credit given
#FLAVORTEXT: Just any text before version number, not neccesary
FLAVORTEXT = "Game Name "
#VERSION: The Version, however you want to display it
VERSION = "v1.0 "
#VERSION_ONLY: Whether you want to show build number or not
VERSION_ONLY = false
#RELEASE: Set to true to prevent build from rising each time game is started
RELEASE = false
#VFONT_SIZE, VWINDOW_X, VWINDOW_Y, the font size, x, and y position of window
VFONT_SIZE = 14
VWINDOW_X = -12
VWINDOW_Y = 384
#NO TOUCHY!
$build_number = 0
module Version
def self.init
if File.exist?("System/Version.vmdt") then else Version.run_new end
File.open("System/Version.vmdt", "rb") do |file|
$build_number = Marshal.load(file)
end
$build_number += 1 if !RELEASE
File.open("System/Version.vmdt", "wb") do |file|
Marshal.dump($build_number, file)
end
end
def self.run_new
file = File.new("System/Version.vmdt", "wb")
Marshal.dump($build_number, file)
file.close
end
end
class Scene_Title
alias version_initialize start
def start
version_initialize
@version_window = Window_Version.new
end
end
class Window_Version < Window_Base
def initialize
super(VWINDOW_X, VWINDOW_Y, 200, fitting_height(1))
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.font.size = VFONT_SIZE
self.contents.draw_text(0,0,200,line_height,version)
end
def version
return FLAVORTEXT + VERSION if VERSION_ONLY
return FLAVORTEXT + VERSION + "Build: " + $build_number.to_s
end
end
Version::init
FAQ
Q: I swallowed Drain Cleaner! What do I do!?
A: Probably call Poison Control, I don't know. This area is for script questions only.
Credit and Thanks
- By V.M. of D.T.
- Free to use in any project with credit given.
History
Version 1.1 - Fixed bug where game would crash when returning to title from load screen