Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> LAWS: Message on Game Load, Yea, I'm back at it
The Law G14
post Jul 1 2011, 08:03 AM
Post #1


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




LAWS: Message on Game Load
By: TheLawG14

Introduction

This is a pretty simple script, it was just based off a request I did for gRaViJa (at HBgames) and I decided to release it to those that want it as well. What it does is show a message after loading a game file (for example: "Welcome Back!") and you can customize how long this message is shown and what is shown.

Features
  • Shows a message after loading a file
  • Can customize how long the message is shown and what the message says
  • Can exit out message more quickly with action button
  • Can change message text depending on progress of game with variable (thanks to Night_Runner)


Screenshots






Demo


None, it's a pretty simple script


Script

Code
CODE
#==============================================================================
# Title: Message on Game Load | Version 1.2
# Author: TheLawG14 [aka. TheScripter]
# Requester: gRaViJa [@ hbgames.org]
#==============================================================================

#==============================================================================
# ** Module LawMessageOnGameLoad
#------------------------------------------------------------------------------
#  This is where you can customize the script for the game.
#==============================================================================

module LawMessageOnGameLoad
  # The text to show at the load screen
  Text = proc {
    # Change the message depending on the progress in the game
    case $game_variables[10] # Variable #10 measures progress (by default)
    when 0..10  then return "The game is still beginning"
    when 11, 12 then return "Prepare to return to battle"
    when 21     then return "Your party needs you"
    else                    "Welcome back Law!"
    end
  }
  # The amount of time the message is displayed on screen
  Wait_Time = 200
end


#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  alias scripter_scene_load_on_decision on_decision
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(*args)
    # Run the original on_decision
    scripter_scene_load_on_decision(*args)
    # If a map was loaded
    if $scene != self
      # Make the welcome back text
      @message_window = Window_LoadMessage.new
      # Loop
      for loop_count in 0..LawMessageOnGameLoad::Wait_Time
        Graphics.update
        Input.update
        break if Input.repeat?(Input::C)
      end
      Graphics.freeze
      @message_window.dispose
    end
  end
end


#==============================================================================
# ** Window_LoadMessage
#------------------------------------------------------------------------------
#  This window displays the loading message
#==============================================================================

class Window_LoadMessage < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @text = LawMessageOnGameLoad::Text.call()
    @text_width = Bitmap.new(32, 32).text_size(@text).width
    super(320 - (@text_width / 2), 208, @text_width + 32, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.z = 999
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, @text_width, 64, @text, 2)
  end
end

#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================



Instructions

In the top of the script there are two Constant variables that you can edit. Just change them to your liking and the script does the rest.


Compatibility


There shouldn't be an compatibility issues, however if there are, please report them.


Credits and Thanks


Thanks to gRaViJa for the idea and request. Also, a big thanks to Night_Runner for adding in the progress feature where the text changes depending on where you are in the game.


Terms and Conditions

Please just give me credit if you decide to use this, thanks biggrin.gif

This post has been edited by The Law G14: Jul 2 2011, 07:04 AM
Reason for edit: Fixed code tag


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Jul 1 2011, 08:16 AM
Post #2


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




Simple, and smooth; Looking good Law, welcome back to the wonderful world of ruby!


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
The Law G14
post Jul 1 2011, 02:18 PM
Post #3


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Thanks! Yep, and its good to be back at scripting biggrin.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Holder
post Jul 1 2011, 03:19 PM
Post #4


Spoilers.
Group Icon

Group: Revolutionary
Posts: 4,204
Type: Developer
RM Skill: Advanced
Rev Points: 250




Like I said over at HBG this could be used for so many types of RPGs to enhance the theme from the word go happy.gif
Is that script number 17 now?


__________________________

 I'm running the Great North Run in September in aid of NACC. A condition my wife has in it's severe form.
Please sponsor me with whatever you can, thank you.
If you'd like to help spread the word please share the image and link to my fundraising page.

Go to the top of the page
 
+Quote Post
   
The Law G14
post Jul 1 2011, 03:37 PM
Post #5


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Thanks again Holder smile.gif And yea, lol I think this is #17 cool.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Night_Runner
post Jul 2 2011, 06:45 AM
Post #6


Level 50
Group Icon

Group: +Gold Member
Posts: 1,527
Type: Scripter
RM Skill: Undisclosed




Welcome back smile.gif

code
CODE
#==============================================================================
# Title: Message on Game Load | Version 1.1n1
# Author: TheLawG14 [aka. TheScripter]
# Requester: gRaViJa [@ hbgames.org]
#==============================================================================

module LawMessageOnGameLoad
  # The text to show at the load screen
  Text = proc {
    # Change the message depending on the progress in the game
    case $game_variables[10] # Variable #10 measures progress (by default)
    when 0..10  then return "The game is still beginning"
    when 11, 12 then return "Prepare to return to battle"
    when 21     then return "Your party needs you"
    else                    "Welcome back Law!"
    end
  }
  Wait_Time = 200
end


#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  alias scripter_scene_load_on_decision on_decision
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(*args)
    # Run the original on_decision
    scripter_scene_load_on_decision(*args)
    # If a map was loaded
    if $scene != self
      # Make the welcome back text
      @message_window = Window_LoadMessage.new
      # Loop
      for loop_count in 0..LawMessageOnGameLoad::Wait_Time
        Graphics.update
        Input.update
        break if Input.repeat?(Input::C)
      end
      Graphics.freeze
      @message_window.dispose
    end
  end
end


#==============================================================================
# ** Window_LoadMessage
#------------------------------------------------------------------------------
#  This window displays the loading message
#==============================================================================

class Window_LoadMessage < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @text = LawMessageOnGameLoad::Text.call()
    @text_width = Bitmap.new(32, 32).text_size(@text).width
    super(320 - (@text_width / 2), 208, @text_width + 32, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.z = 999
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, @text_width, 64, @text, 2)
  end
end

#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================


It's been strange not seeing you here sad.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
The Law G14
post Jul 2 2011, 06:57 AM
Post #7


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Woah, that's really neat, man! Thanks! I'll add that to the main script and make sure to credit you. And I'm glad to see you here, Night_Runner! And it is nice to be back lol smile.gif

This post has been edited by The Law G14: Jul 2 2011, 07:03 AM


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
carnie_natas
post Aug 24 2011, 02:48 PM
Post #8


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




wow law you did the siz once more! im going to check this out

edit:any way to center the message box more?

This post has been edited by carnie_natas: Aug 24 2011, 03:00 PM


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
The Law G14
post Aug 24 2011, 06:41 PM
Post #9


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Thanks! The new script version should have the text centered better though, unless your text is really long. Does it stretch from one side of the screen to the other?


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
carnie_natas
post Aug 25 2011, 01:26 PM
Post #10


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




no not that, no matter how long the text size the box it's self begins a little too far to the right on the left side whereas the right side of the text box is even and centered.

This post has been edited by carnie_natas: Aug 25 2011, 01:26 PM


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
The Law G14
post Aug 25 2011, 04:07 PM
Post #11


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




I'm still not entirely sure what you mean, can you try to show a screenshot? But until then, this might work if I think I understand what you're problem is. Change line 87 that says :

CODE
self.contents.draw_text(0, 0, @text_width, 64, @text, 2)


to

CODE
self.contents.draw_text(0, 0, @text_width, 64, @text, 1)



__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
carnie_natas
post Aug 25 2011, 05:07 PM
Post #12


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




QUOTE (The Law G14 @ Aug 25 2011, 05:07 PM) *
I'm still not entirely sure what you mean, can you try to show a screenshot? But until then, this might work if I think I understand what you're problem is. Change line 87 that says :

CODE
self.contents.draw_text(0, 0, @text_width, 64, @text, 2)


to

CODE
self.contents.draw_text(0, 0, @text_width, 64, @text, 1)





The text box needs to be shifted to the left to center it.

This post has been edited by carnie_natas: Aug 25 2011, 05:08 PM


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
The Law G14
post Aug 25 2011, 05:51 PM
Post #13


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Ah alright, I see what the problem is, this should work:

script
CODE
#==============================================================================
# Title: Message on Game Load | Version 1.2
# Author: TheLawG14 [aka. TheScripter]
# Requester: gRaViJa [@ hbgames.org]
#==============================================================================

#==============================================================================
# ** Module LawMessageOnGameLoad
#------------------------------------------------------------------------------
#  This is where you can customize the script for the game.
#==============================================================================

module LawMessageOnGameLoad
  # The text to show at the load screen
  Text = proc {
    # Change the message depending on the progress in the game
    case $game_variables[10] # Variable #10 measures progress (by default)
    when 0..10  then return "The game is still beginning"
    when 11, 12 then return "Prepare to return to battle"
    when 21     then return "Your party needs you"
    else                    "Welcome back Law!"
    end
  }
  # The amount of time the message is displayed on screen
  Wait_Time = 200
end


#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  alias scripter_scene_load_on_decision on_decision
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(*args)
    # Run the original on_decision
    scripter_scene_load_on_decision(*args)
    # If a map was loaded
    if $scene != self
      # Make the welcome back text
      @message_window = Window_LoadMessage.new
      # Loop
      for loop_count in 0..LawMessageOnGameLoad::Wait_Time
        Graphics.update
        Input.update
        break if Input.repeat?(Input::C)
      end
      Graphics.freeze
      @message_window.dispose
    end
  end
end


#==============================================================================
# ** Window_LoadMessage
#------------------------------------------------------------------------------
#  This window displays the loading message
#==============================================================================

class Window_LoadMessage < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @text = LawMessageOnGameLoad::Text.call()
    @text_width = Bitmap.new(32, 32).text_size(@text).width
    super(0, 208, @text_width + 32, 96)
    self.x = 320 - (self.width / 2)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.z = 999
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, @text_width, 64, @text, 2)
  end
end

#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
carnie_natas
post Aug 25 2011, 08:18 PM
Post #14


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




Perfect as usual! Another masterpiece my friend.


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   

Closed 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:30 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker