The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: Season In The Abyss on May 14, 2007, 01:27:40 AM

Title: Scrolling Message System
Post by: Season In The Abyss on May 14, 2007, 01:27:40 AM
Scrolling Message System
Version: 1.2

Last Update

May 13, 2007

Introduction

This script makes message show in two lines of text at a time. If there are more than two lines, the lines will be scrolled in a smoothly way. Letters are drawed one by one.

FeaturesExtra Features#==============================================================
# ** Scrolling Message System / Name Box
#------------------------------------------------------------------------------
# Slipknot (http://www.creationasylum.net/)
# Version 1.1
# March 13, 2007
#==============================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_sms_nb_refresh refresh
  alias slipknot_sms_nb_repcod replace_code
  alias slipknot_sms_nb_termmes terminate_message
  #--------------------------------------------------------------------------
  # * Terminate Message
  #--------------------------------------------------------------------------
  def terminate_message
    slipknot_sms_nb_termmes
    if @name_box
      @name_box.dispose
      @name_box = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    slipknot_sms_nb_refresh
    if @name_text
      @name_box = Window_MessageNameBox.new(x, y - 16, @name_text)
      @name_box.back.opacity = 0 if $game_system.message_frame == 1
      @name_text = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Replace Code
  #--------------------------------------------------------------------------
  def replace_code
    slipknot_sms_nb_repcod
    @text.gsub!(/\\[Nn]ame\[(.*?)\]/) { @name_text = $1; '' }
  end
end

class Window_MessageNameBox < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :back
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, text)
    dumb = Bitmap.new(160, 32)
    dumb.font = Message.font
    color = nil
    text.sub!(/\\[Cc](\d)/) { color = text_color($1.to_i); '' }
    size = dumb.text_size(text).width
    dumb.dispose
    @back = Window_Base.new(x, y, size + 12, 32)
    @back.z = 9998
    super(x - 10, y - 11, size + 32, 54)
    self.z = 9999
    self.opacity = 0
    self.contents = Bitmap.new(size, 22)
    contents.font = Message.font
    contents.font.color = color if color
    contents.draw_text(0, 0, size, 22, text)
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    @back.dispose
    @back = nil
    super
  end
end
[/spoiler]

Title: Re: Scrolling Message Window
Post by: modern algebra on May 14, 2007, 01:38:00 AM
This looks cool. I am testing now.
Title: Re: Scrolling Message Window
Post by: Falcon on May 14, 2007, 02:03:48 AM
Wow, this looks very nice :)
Title: Re: Scrolling Message Window
Post by: :) on May 14, 2007, 02:17:25 AM
Looks sweet!  :)
Title: Re: Scrolling Message Window
Post by: Season In The Abyss on May 14, 2007, 02:20:14 AM
Thanks  ;D
Title: Re: Scrolling Message System
Post by: Zeriab on May 14, 2007, 04:52:40 AM
A very nice and clean script. Great job ^_^
Title: Re: Scrolling Message System
Post by: Irock on May 14, 2007, 04:58:19 AM
Awesome job.

I was playing Earthbound a few days ago, and wondered if there was a script like this. ;)
Title: Re: Scrolling Message System
Post by: firerain on June 26, 2007, 02:18:45 AM
I get an error with the name box script, error reads:

Script'' line 14 NameError occurred
undefined method 'replace_code' for class 'window_message'
Title: Re: Scrolling Message System
Post by: Season In The Abyss on June 30, 2007, 07:46:55 AM
Be sure to paste the main script before the rest ;)
Title: Re: Scrolling Message System
Post by: Kokowam on June 30, 2007, 10:56:03 AM
"I'm Slipknot." XD Anyways, is this a more advanced version of the letter by letter? If so, awesome! If not, awesome! ;D Job good. :)
Title: Re: Scrolling Message System
Post by: firerain on June 30, 2007, 01:25:23 PM
Quote from: Season In The Abyss on June 30, 2007, 07:46:55 AM
Be sure to paste the main script before the rest ;)
I have. :(
Title: Re: Scrolling Message System
Post by: Doctor Professor Nikolai on June 30, 2007, 04:06:32 PM
Nice, I love it. You get a bean. :bb:
Title: Re: Scrolling Message System
Post by: Season In The Abyss on July 01, 2007, 08:03:40 PM
@Lac: The order of the scripts should be like this:
- Scene_Debug
- SDK (if you use it)
- SMS (main code)
- Name Box
- Others scripts
- Main


@rest: thanks  ;D
Title: Re: Scrolling Message System
Post by: modern algebra on July 14, 2007, 01:09:55 AM
Yup, I think I'm definitely using this Message system for my game. Thank you for writing and posting this. You made me very happy  ;D
Title: Re: Scrolling Message System
Post by: MrMoo on July 19, 2007, 05:11:07 AM
With the window above the event, anybody know how to get it above the player?
Title: Re: Scrolling Message System
Post by: modern algebra on July 22, 2007, 07:34:47 AM
\p[-1]
Title: Re: Scrolling Message System
Post by: Sophist on July 22, 2007, 07:47:41 AM
This script is made out of immediant win.

( ???) This is terrifyingly relevant to my intrests today, isn't it?
Title: Re: Scrolling Message System
Post by: SirJackRex on July 24, 2007, 11:43:58 PM
Wow, this is such an amazing script!
Title: Re: Scrolling Message System
Post by: Kamin on August 13, 2007, 03:00:58 AM
The text doesn't show up for me. :/

Any idea on how to fix that?
Title: Re: Scrolling Message System
Post by: drakenkanon on August 17, 2008, 05:31:23 PM
i really like this script, could you make it so you can have endless choices, like this:

show choices: choice 1, choice 2, choice 3, choice 4
(call script)
show choice: choice 5, choiche 6, choice 7, choice 8

and so on
Title: Re: Scrolling Message System
Post by: xplody08 on August 22, 2008, 06:42:23 AM
Neat looking script! Looks very nice!  ;D
Title: Re: Scrolling Message System
Post by: Berans on August 22, 2008, 06:54:17 AM
Quote from: Kamin on August 13, 2007, 03:00:58 AM
The text doesn't show up for me. :/

Any idea on how to fix that?
Is the font you've defined in the script installed on your system? If it's not, it just won't show up
Title: Re: Scrolling Message System
Post by: Dralel on November 11, 2008, 07:32:14 PM
When I test play it won't let me move the cursor on the title screen!! Help!
Title: Scrolling Message System help
Post by: justin900 on April 09, 2009, 02:14:22 PM
Hey..this is justin chael. from jworks production.
it's my first time to use this program and i also bought it.
i just want you to help me with my problem..
everytime i use use script..and put it in to the script editor..on the top of the main..this message always shows up."script "Main"line 14: name error occurred.
undefined method 'replace_code' for class 'window_message' i cant figure out how to solve that problem..i tried to download your Demo but the link is broken..

please help me out with this...
thank you for your time.
Justine.

One more thing..
do you have any idea how can i put a "Quest" menu in the menu?
thanks again..

Good Day And Good luck!
Title: Re: Scrolling Message System
Post by: apoclaydon on May 19, 2010, 06:26:23 AM
Ok sorry for this but i can not get the demo to download. the script sounds nice but i dont know how to use it (how to get text to scroll or how to add the choices
Title: Re: Scrolling Message System
Post by: Sophist on June 06, 2010, 05:29:34 AM
The demo is long out dated.

You are an idiot for posting in a thread from 2007 and expecting downloads to work.
Title: Re: Scrolling Message System
Post by: modern algebra on June 06, 2010, 11:46:27 AM
Just copy it from the Script spoiler. It scrolls automatically when you have more than two lins. The choices are added when you use the Show Choice Branch. If you are trying and nothing is showing up, you might not have the font he is using, so change FontName to something you have.
Title: Re: Scrolling Message System
Post by: PKSkwerl on October 07, 2010, 08:38:57 PM
Hello. Sorry to topic necro on my first post but I was just wondering if anyone knows how to add the text sound to this script? I love this script and can live without the text sounds in the other script but would definitely prefer it. Thanks :)
Title: Re: Scrolling Message System
Post by: Glennx95 on April 19, 2011, 08:31:06 PM
I know this is an old topic, but how do i get the name box above the text? it might be a dumb question, but I'm new to the script parts, so i dint know how to edit them yet. Thanks.
Title: Re: Scrolling Message System
Post by: modern algebra on April 19, 2011, 09:53:54 PM
I thought it was just by using the code \name[text] inside a text box.
Title: Re: Scrolling Message System
Post by: Glennx95 on April 20, 2011, 12:41:34 PM
Thats what i thought too, but it doesn't work
Title: Re: Scrolling Message System
Post by: modern algebra on April 26, 2011, 02:15:44 AM
Well, it was an extra feature, so you needed to add this code into its own slot below the SMS:


#==============================================================
# ** Scrolling Message System / Name Box
#------------------------------------------------------------------------------
# Slipknot (http://www.creationasylum.net/)
# Version 1.1
# March 13, 2007
#==============================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_sms_nb_refresh refresh
  alias slipknot_sms_nb_repcod replace_code
  alias slipknot_sms_nb_termmes terminate_message
  #--------------------------------------------------------------------------
  # * Terminate Message
  #--------------------------------------------------------------------------
  def terminate_message
    slipknot_sms_nb_termmes
    if @name_box
      @name_box.dispose
      @name_box = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    slipknot_sms_nb_refresh
    if @name_text
      @name_box = Window_MessageNameBox.new(x, y - 16, @name_text)
      @name_box.back.opacity = 0 if $game_system.message_frame == 1
      @name_text = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Replace Code
  #--------------------------------------------------------------------------
  def replace_code
    slipknot_sms_nb_repcod
    @text.gsub!(/\\[Nn]ame\[(.*?)\]/) { @name_text = $1; '' }
  end
end

class Window_MessageNameBox < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :back
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, text)
    dumb = Bitmap.new(160, 32)
    dumb.font = Message.font
    color = nil
    text.sub!(/\\[Cc](\d)/) { color = text_color($1.to_i); '' }
    size = dumb.text_size(text).width
    dumb.dispose
    @back = Window_Base.new(x, y, size + 12, 32)
    @back.z = 9998
    super(x - 10, y - 11, size + 32, 54)
    self.z = 9999
    self.opacity = 0
    self.contents = Bitmap.new(size, 22)
    contents.font = Message.font
    contents.font.color = color if color
    contents.draw_text(0, 0, size, 22, text)
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    @back.dispose
    @back = nil
    super
  end
end
Title: Re: Scrolling Message System
Post by: Glennx95 on April 26, 2011, 07:41:34 PM
Okay, thanks. It's working now :D