[Request][XP] Version number in Title Screen?

Started by Elyssia, September 02, 2010, 11:15:44 am

Previous topic - Next topic

Elyssia

September 02, 2010, 11:15:44 am Last Edit: September 02, 2010, 11:18:32 am by Elyssia
I wonder if it's possible to add a text to the Right bottom side of the Title Screen(Main Menu) which shows the current version of the application. (Not the version of RPGXPOnline but just as custom add)
If yes, i would appreciate a script of making this possible. :D
A friend of mine asked me on a IRC Network if i knew how to make this possible, so i planned to ask it in here in hope on someone knowing how to make this possible.
Thanks in advance ^^

ShadowPierce

->May I ask why you'd rather have it scripted than editing the title pic itself? :^_^':



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Elyssia

That doesn't look professional ;)
Scripted does look much better than editing the titlescreen :P

Valdred

put this in the bottom of the initialize method of Scene_Title

@sprite.bitmap.draw_text(x, y, width, heigth, text, allignment)

exchange x with x cordinate of text, y with y cordinate, and so on. Allignment is 1 by default.

Elyssia

thanks :D
gotta try it, when i have the time tomorrow!

Elyssia

Hm... me and my friend get's both a different error.
I am trying to add this into the online system and my friend into the official Script database.
The error i get is: Script '(RMX-OS) Script' line 3496: NoMethodError occurred. undefined method `bitmap' for nil:NilClass

And my friend get's: Script'scene_title' Line 87: Name Error occured. uninitialized constant scene_title:: Version.


Any ideas? :s

Blizzard

Your friend didn't add all parts of the script or he didn't add them in the right order.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Valdred

The first error. (The one you got) is because of some script you are using that changes the Scene_Title class. The second one is not caused by my script.

ForeverZer0

The first error is that @sprite is not defined. You may have a script that uses a different name than this. If not, you may being trying to alter the bitmap of the sprite before it is defined. Find the line that looks something like this:
@sprite = Sprite.new

Soon after that the bitmap should be defined. Right after that is where you should add the edit.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Valdred

Yeah, but putting it in the end of initialize would work as I'm pretty sure @sprite is created in that method.

ForeverZer0

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Elyssia

Still no good :/
Might be doing something wrong or import this in the wrong script order/file.
I do use the online system, so i might made a type mistake somewhere...
This is what i have:

@sprite = Sprite.new
@sprite.bitmap.draw_text(100, 100, 100, 100, 'TEST', 1)


But the question, is if this is correct as a test. And where i have import the script to?
I guess this should be added in '(RMX-OS) Script' somewhere...

ForeverZer0

You need to add it after the sprite's bitmap is defined. There will be a line that reads @sprite.bitmap = WHATEVER.
Place it after that line.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Elyssia

I think i'll give this up.
After several attempts it still keeps failing to load the scripts because of an 'Undefined method' error.
( a Small step by Step tutorial would be nice?)

Valdred

You need to put it after

@sprite.bitmap = Bitmap.new(....some stuff...)
put the line here

Calintz

September 05, 2010, 12:04:02 pm #15 Last Edit: September 05, 2010, 12:05:26 pm by Calintz
Just go to www.dafonts.com and find a professional looking font that has free usage permits, or free personal usage permits. Add it to the title screen with a photo editing program. It doesn't need to be written in code to look professional. *sigh*

stripe103

No but with code, any error can be fixed easily without having to remake the background. Errors such as change in placement and color.
Try with this. Just add it in a new script section below Scene_Title.

# Type in the version number.
VERSION = "1.0"

class Window_Version < Window_Base
  def initialize
    super(445, 0, 640, 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end

  def refresh
    self.contens.clear
    self.contents.font.size = 28
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0, 0, 640, 32, VERSION, 2)
  end
end

class Scene_Title
  alias :ori_main :main
  alias :ori_refresh :refresh
  def main
    @window_version = Window_Version.new
    ori_main
    @window_version.dispose
  end
  def refresh
    @window_version.refresh
    ori_refresh
  end
end


I have tried almost the same code in a project, but not this exact one, so if you find any errors with it, please tell me.

Taiine

Quote from: stripe103 on September 05, 2010, 02:12:06 pm
No but with code, any error can be fixed easily without having to remake the background. Errors such as change in placement and color.
Try with this. Just add it in a new script section below Scene_Title.


I have tried almost the same code in a project, but not this exact one, so if you find any errors with it, please tell me.


I tried it cause well.. was curious.. and yeah error.
Line 21
undefined method 'refresh' for class "Scene_Title"

Quoteclass Scene_Title
  alias :ori_main :main
  alias :ori_refresh :refresh
  def main
    @window_version = Window_Version.new
    ori_main
    @window_version.dispose
  end
  def refresh
    @window_version.refresh
    ori_refresh
  end
end

stripe103

I've got that error out of the way but now it says that the method "windowskin_name" is undefined and I can't find anything related to that.
This is the current code. If anyone can find the problem please tell because I can't.
class Window_TitleVersion < Window_Base
  def initialize
    super(445, 0, 640, 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.size = 28
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0, -10, 200, 45, "1.0", 2)
  end
end


class Scene_Title
  alias :ori_main :main
  def main
    @window_version = Window_TitleVersion.new
    ori_main
    @window_version.dispose
  end
end

ForeverZer0

Probably because $game_system has not been initialized yet, and that is where the name of the windowskin is stored. So when you try to create the window, Window_Base, the super class, attempts to read from a class that does not yet exist for the windowskin name. Try adding this line something like $game_system = Game_System.new to the top of your aliased method and see if that helps.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.