RPG Maker XP
Custom Message System
Introduction
I wrote this script in August 2011 and posted it. I got some positive reviews, but it was pointed out to me that the script as posted was broken. I finally decided to rework some things and add some new features to make this better. Hopefully the improvements will make it easier to use.
Features
- Bubble graphic container for text
- Dynamic container sizing to match text
- Write speed control
- Message format controls (bold, colors, etc.)
- Face graphic support (inside message box as welll as to the left outside)
- Icon insertion in text
- Gold window display in lower right corner of screen
- Also added Windowskin use (have not yet added number input for Windowskin)
Screenshots
Downloads
License Terms
Attribution 3.0 Unported - You must attribute the work in the manner specified by the author or licensor. Commerical use allowed.
Instructions
With the revisions, you are able to use the script without the bubble or pointer images. It is designed to correct Message Mode values if you are missing these graphics
It should be user friendly if you read the instructions. I created several global methods to make certain functions easier to call in the Event Script box.
If you do not have scripting knowledge you should still be able to utilize the functions of the script by reading the instructions and dissecting the events in the demo.
Compatibility
- Probably not SDK compatible
- Will conflict with other message scripts
- Untested with battle systems
Version History
Fixed a bug with displaying choices when no previous text was displayed (Please note that I designed this script to append choices to their preceding text). You can now use the command \nc in choice text in order to make the script write choices separate from previous text. This is not a toggle; it needs to be done in each instance where you would like choices separate. If enough people would find a toggle useful, I could add it, but I suspect that it is more desirable in most instances to keep them together.
Comments (25)
Leave a Reply
You must be logged in to post a comment.
kellessdee
Although this is a very nice script ( I really like what you did with the message system)
I would advise, (NOTE: THIS IS STRICTLY FOR ACCESSIBILITY, in other words, so more people are likely to use this script; if that's what you want)
1. post the actual script, images and instructions in here, so people do not have to dig through the demo for everything, as well as I am sure some people just don't want to go downloading things…
2. Maybe some screenshots or a vid. Not important, but I think if you had a screenshot or 2 people would be more likely jump on this.
Other than that, I say good job sir for making such a smoothly animated message system. *mad dapz*
Hodgeelmf
Deleted by user
Hodgeelmf
Thanks, Epic! I've added some screenshots and the script.
madanchi
wow that looks really nice! good job
Kiriashi
This is fricken awesome. I absolutely love it. :3
Kailia
I'm having some real problems with this script. I tried pasting it to a brand new project and it crashes. I'm not sure what is going on. But here is the error message:
Script 'Custom_Message' lin 467: NoMethodError occurred.
undefined method `code' for nil:NilClass
The problem persists even in the demo if you try talking to the door or the axe in stump item. Right now, this script appears to be unusable, and I really really liked these message bubbles.
Heretic86
[quote name='Kailia' timestamp='1329511932' post='71448']
I'm having some real problems with this script. I tried pasting it to a brand new project and it crashes. I'm not sure what is going on. But here is the error message:
Script 'Custom_Message' lin 467: NoMethodError occurred.
undefined method `code' for nil:NilClass
The problem persists even in the demo if you try talking to the door or the axe in stump item. Right now, this script appears to be unusable, and I really really liked these message bubbles.
[/quote]
You are correct, I think this code is not ready for public use yet. Not your fault, I got the same results.
From the Demo, the script is Exceptionally Fantastic. But compared to other very similar looking scripts, quite a number of features are lacking, yet, this script features some things other scripts do not. I'd say it is only about 50% complete.
If the original author ever decides to go back to work on this, I have a feeling it has the potential to be one of the best Bubble Chat Scripts out there, but until that time, go with [url=”http://forum.chaos-project.com/index.php?topic=1675.0″]Wachunga's Multiple Msg Windows[/url]. That script also has a few bugs and Im working on fixing what I can in them, ask if you need help with those…
Great Script, if the bugs are fixed…
Kailia
Ah, so it really isn't me. Yeah I am going to be sticking with Ccoa's AMS for now. Though this one, I really loved the bubble graphic. I wish this was updated.
Hodgeelmf
Bump
Daemonium
Hello, I am new here on RMXP Unlimited.
Regarding this script, I want to deactivate the "up-down" movement of the bubble. Which line I need modify for deactivate it?
Thanks!
Olivia
Wonderful script. I really want to use this. There's one slight buggy bug though, when you change the message display mode to default window skin with this command:
[quote]
$game_system.message_text_mode =\
TEXT_MODE_WINDOWSKIN
[/quote]
And then change it back with this command:
[quote]
$game_system.message_text_mode = \
TEXT_MODE_BUBBLE
[/quote]
The bubble does not restore as normal floating up and down, instead it floats perpetually up the screen like this:
[img]http://img109.imageshack.us/img109/245/9e135e8af7024db988ec048.png[/img]
Kailia
[quote name='Olivia' timestamp='1342049988' post='75226']
Wonderful script. I really want to use this. There's one slight buggy bug though, when you change the message display mode to default window skin with this command:
And then change it back with this command:
The bubble does not restore as normal floating up and down, instead it floats perpetually up the screen like this:
[img]http://img109.imageshack.us/img109/245/9e135e8af7024db988ec048.png[/img]
[/quote]
Yeah if we can get a fix for that, I think this message script would be pretty awesome.
Hodgeelmf
Greetings,
I apologize that my response has taken a little while. I have fixed the bug when changin from windowskin mode back to bubble (it was a dumb mistake I made). I have also added a simple way to turn off the bonce function. Just enter the following in the event editor script command:
$game_system.message_bubble_bounce = BUBBLE_BOUNCE_OFF
To turn the bounce back on, enter:
$game_system.message_bubble_bounce = BUBBLE_BOUNCE_ON
I have added this to the documentation and the version log as well.
The updated script is posted below, and I will also replace it at the top.
[SPOILER][CODE]
#==============================================================================
# ** Custom Message Script by Hodgeelmf
#
# Version 1.4
#
# Version History
# 1.0 – Basic functionality
# 1.1 – Fixed issue with bubble size and bolded text
# Modified gold window
# Added /q function
# 1.2 – Added Icon display
# Added Face Graphics
# Fixed Gold command iteration error (This is what formerly broke
# the script)
# Added use of Windowskin Graphic
# Fixed sub window termination to be more natural
# 1.3 – Added thought indicater option
# Added emotion colors
# 1.4 – Fixed glitch when switching from Windowskin to Bubble mode
# Added function to disable bubble bouncing
#
# Necessary updates
#
# -Add other various functions like display hp, quest, etc.
#
#==============================================================================
=begin
Welcome to the Custom Message script!
Installation instructions:
1. Install this script above Main, preferrably directly above
2. Download attached graphics (message_bubble and pointer2)
and place in Graphics/Pictures
3. That's it!
Message commands:
\e[x] Display message over a map event
By default, bubble messages display over the player's sprite. Values
outside of the map events range will display over the player as well.
\c[x] Change message text color (0-8)
\n[x] Insert actor name
\v[x] Insert variable value
\b Toggle bold text
\w[x] Wait control (0-999)
Wait values are determined by frame. 40 FPS is the script rate.
\p Pause control
Forces the player to press enter before continuing.
\q Forced ending
Forces the message winddow to close once the character is encountered.
Typically best to use directly after a wait timer.
\f Force position
Forces a specific position for the message bubble.
0 – Upper right of the sprite
1 – Upper left of the sprite
2 – Lower right of the sprite
3 – Lower left of the sprite
\g Displays gold window
Fades in the gold window to the bottom right corner of the screen. To keep
it displayed after current message, add \g into the next master message.
\i[x] Display icon
Displays an icon from the "Icons" folder. A constant array, Icons, is
compiled at runtime to store imported icon names in addition to RTP.
\z[x] Display face graphic (found in Graphics/Faces – you may have to create this
folder)
Displays a face graphic on the left of the message. Currently this script
only supports images with one face (as opposed to a whole faceset).
\t Thought Bubble
Uses thought indicater (ie two dots instead of mouth opening style)
\m[x] Mood Coloring
Changes bubble color to indicate speakers/thinkers mood (0-4)
\h[x] Display Hp
Not functioning at this point
\s[x] Sub window controls (explained below)
Master – the message which controls sub windows
Sub – any message that displays as a part of a master
1. The master message always has a higher z value than any sub messages
2. Sub message must immediately follow the master message and be in
consecutive order (ex. sub 0 must be the next event command after
the master message, sub 1 must be the next event command after
sub 0, etc.)
3. Sub messagge numbers do not reset after a master message. For
example, if the first master messsage contains two sub messages,
the second master message with sub messages must begin with sub
message number 3, and so on.
4. Use \s[x] where x is the number of the sub message to indicate that
a particular message is a sub message
5. Call sub messages in a master message with \s[x] where x is the
number of the sub message.
6. There is no limit to the number of sub messages, but since text is
drawn one letter at a time, too many messages may cause lag.
***NOTE***
If any of these commands seem bulky, it is because there is a glitch in
the run script command in the event editor which does not allow for
single lines changing global variables to function properly.
Script commands (from the Event Editor):
1. Choose message style (bubble, windowskin or invisible)
***** If you do not have the correct images in Graphics/Pictures
***** the script will automatically change to WINDOWSKIN mode and
***** change the default text color to white
$game_system.message_text_mode = x
TEXT_MODE_BUBBLE
TEXT_MODE_INVISIBLE
TEXT_MODE_WINDOWSKIN
2. Enable or disable bubble bouncing (only applies when in TEXT_MODE_BUBBLE)
$game_system.message_bubble_bounce = x
BUBBLE_BOUNCE_ON
BUBBLE_BOUNCE_OFF
2. Change position of invisible text
$game_system.invisible_position = x
INVISIBLE_POSITION_TOP
INVISIBLE_POSITION_MIDDLE
INVISIBLE_POSITION_BOTTOM
INVISIBLE_POSITION_BOOK(arbitrary value from one of my projects)
3. Change outline text options
$game_system.message_text_outline = x
TEXT_NORMAL
TEXT_OUTLINE
4. Change text speed
$game_system.message_text_speed = x
TEXT_SPEED_SLOW
TEXT_SPEED_MEDIUM
TEXT_SPEED_FAST
5. Change text skip rate (one letter per frame up to all at once)
$game_system.message_text_skip = x
TEXT_SKIP_NORMAL (1)
TEXT_SKIP_DOUBLE (2)
TEXT_SKIP_TRIPLE (3)
TEXT_SKIP_FULL
5. Change text size
$game_system.message_text_size = x
TEXT_SIZE_SMALL
TEXT_SIZE_MEDIUM
TEXT_SIZE_LARGE
TEXT_SIZE_JUMBO
6. Change text font
$game_system.message_text_font = x
TEXT_FONT_DEFAULT
TEXT_FONT_CORSIVA
7. Color Constants
TEXT_COLOR_BLACK
TEXT_COLOR_WHITE
8. Face Graphic Functions
$game_system.face_graphic_type = x
9. Face Graphic Constants
FACE_GRAPHIC_FULL – typically a bust which looks better offset to the left
and extending abovve the bubble
FACE_GRAPHIC_BOX – traditional boxed in face graphics which need to be
encased by the bubble to look correct
10. Global Methods (for ease of access)
message(string) – place in script box in event processing
***** Only place this command once per Event Script Box *****
You may wish to have dialogue or entries that are longer than three
lines. This global method allows you to supply a string to
$game_temp.message_text manually. The best way to do so is to store
a message in a variable and pass it to the method. In this example
script there is a Game_Messages class which has public methods that
assign a message to a variable. For full games, it would be better
to create a text file to load from. The best formatter to use is
%q (ex @message = %q(lots of text…can be multiple lines). The
%q formatter mimicks the event dialogue box text editing format
so you can use single "\" characters instead of using "\\" or not
being able to use special characters at all.
default_color(x) – set message default color
Input either a number 0 through 8 or a Color object.
face(string) – set default face graphic
Use this method to supply a default face graphic for messages. This graphic
has secondary priority to one explicitly declared in a message, so is useful
for largely unbroken monologues.
clear_face – clears the default face graphic
small_text
medium_text – Shortcut methods to change $game_system.message_text_size
large_text
jumbo_text
slow_text
fast_text – Shortcut methods to change $game_system.messge_text_speed
Enjoy! And remember to credit!
=end
#========================================================================
# Game_Messages
# You can easily create messages to display of any length using this
# Class or a similar one of your creation.
#========================================================================
class Game_Messages
# This message is obviously far too long for a bubble message, but it looks
# quite good with a darkened screen tone
# When loaded into a global variable, these class methods can be called to
# the event editor with two lines of code. For your own projects, you will
# probably want a more sophisticated heirarchy.
def message_1
@message = %q(\c[0]\bMessage commands:\b
\c[6]\b\\e[x]\c[0] Display message over a map event\b
By default, bubble messages display over the player's sprite. Values
outside of the map events range will display over the player as well.
\c[6]\b\\c[x]\c[0] Change message text color (0-8)\b
\c[6]\b\\n[x]\c[0] Insert actor name\b
\c[6]\b\\v[x]\c[0] Insert variable value\b
\c[6]\b\\\\b\c[0] Toggle bold text\b
\c[6]\b\\w[x]\c[0] Wait control (0-999)\b
Wait values are determined by frame. 40 FPS is the script rate.
\c[6]\b\\\\p\c[0] Pause control\b
Forces the player to press enter before continuing.
\c[6]\b\\\\q\c[0] Forced ending\b
Forces the message winddow to close once the character is encountered.
Typically best to use directly after a wait timer.
\c[6]\b\\\\f[x]\c[0] Force position\b
Forces a specific position for the message bubble.
\b0\b – Upper right of the sprite
\b1\b – Upper left of the sprite
\b2\b – Lower right of the sprite
\b3\b – Lower left of the sprite
\c[6]\b\\\\g\c[0] Displays gold window\b
Fades in the gold window to the bottom right corner of the screen. To keep
it displayed after current message, add \\\\g into the next master message.
\c[6]\b\\\\i[x]\c[0] Displays an icon from Graphics/Icons\b
\c[6]\b\\\\z[x]\c[0] Displays a face graphic from Graphics/Faces\b
References an array compiled at runtime from Graphics/Faces. You will have
to create this folder and manually install files.
\c[6]\b\\\\s[x]\c[0] Sub window controls\b (see documentation for full instructions))
end
def message_2
@message = %q( \c[6]\b$game_system Properties\b\c[0]
Change these properties in the Event Editor by using the Script command. Begin with
$game_system, then add a "." followed by the property you wish to alter. In the
Script command you will need to use two lines. For example:
$game_system.message_text_speed =\
TEXT_SPEED_FAST
The properties are listed below with available values to the right. For full
documentation, refer to the script instructions.
\c[6]\bmessage_text_mode\b\c[0] TEXT_MODE_INVISIBLE,TEXT_MODE_BUBBLE,TEXT_MODE_WINDOWSKIN
\c[6]\binvisible_position\b\c[0] INVISIBLE_POSITION_TOP,INVISIBLE_POSITION_MIDDLE,
INVISIBLE_POSITION_BOTTOM
\c[6]\bmessage_text_outline\b\c[0] TEXT_NORMAL,TEXT_OUTLINE
\c[6]\bmessage_text_speed\b\c[0] TEXT_SPEED_SLOW,TEXT_SPEED_MEDIUM,TEXT_SPEED_FAST
\c[6]\bmessage_text_size\b\c[0] TEXT_SIZE_SMALL,TEXT_SIZE_MEDIUM,TEXT_SIZE_LARGE,
TEXT_SIZE_JUMBO
\c[6]\bmessage_text_font\b\c[0] TEXT_FONT_DEFAULT, whatever constant you would
like to create
\c[6]\bmessage_text_skip\b\c[0] TEXT_SKIP_NORMAL,TEXT_SKIP_DOUBLE,TEXT_SKIP_TRIPLE,
TEXT_SKIP_QUAD,
TEXT_SKIP_QUIN,TEXT_SKIP_FULL
\c[6]\bmessage_skip_disabled\b\c[0] true,false
\c[6]\bface_graphic_type\b\c[0] FACE_GRAPHIC_BOX,FACE_GRAPHIC_FULL
\c[6]\bface_graphic_name\b\c[0] file name of graphic – without folders
\c[6]\bdefault_color\b\c[0] any Color object
\c[6]\bmessage_text_outline_color\b\c[0] any Color object)
end
end
#========================================================================
# Constant Declaration
#========================================================================
# Stores the class methods for quick custom message access
$game_messages = Game_Messages.new
BUBBLE_BOUNCE_ON = 1
BUBBLE_BOUNCE_OFF = 0
BUBBLE_UPPER_LEFT = Rect.new(0,0,13,10)
BUBBLE_LOWER_LEFT = Rect.new(0,10,13,9)
BUBBLE_UPPER_RIGHT = Rect.new(13,0,12,10)
BUBBLE_LOWER_RIGHT = Rect.new(13,10,12,9)
SKIN_UPPER_LEFT = Rect.new(128,0,10,10)
SKIN_LOWER_LEFT = Rect.new(128,54,10,10)
SKIN_UPPER_RIGHT = Rect.new(182,0,10,10)
SKIN_LOWER_RIGHT = Rect.new(182,54,10,10)
TEXT_MODE_BUBBLE = 0
TEXT_MODE_INVISIBLE = 1
TEXT_MODE_WINDOWSKIN = 2
INVISIBLE_POSITION_TOP = [320,0]
INVISIBLE_POSITION_MIDDLE = [320,240]
INVISIBLE_POSITION_BOTTOM = [320,480]
INVISIBLE_POSITION_BOOK = [460,35]
TEXT_NORMAL = 0
TEXT_OUTLINE = 1
TEXT_SPEED_SLOW = 2
TEXT_SPEED_MEDIUM = 1
TEXT_SPEED_FAST = 0
TEXT_SKIP_NORMAL = 1
TEXT_SKIP_DOUBLE = 2
TEXT_SKIP_TRIPLE = 3
TEXT_SKIP_QUAD = 4
TEXT_SKIP_QUIN = 5
TEXT_SKIP_FULL = 6
TEXT_SIZE_SMALL = 14
TEXT_SIZE_MEDIUM = 16
TEXT_SIZE_LARGE = 18
TEXT_SIZE_JUMBO = 28
# Remember to set a common default or fallback font since some users won't have
# them all
TEXT_FONT_DEFAULT = "Arial"
TEXT_FONT_CORSIVA = ["Monotype Corsiva", "Arial"]
TEXT_FONT_BOLI = ["MV Boli", "Arial"]
TEXT_FONT_COMICSANS = ["Comic Sans MS", "Arial"]
TEXT_COLOR_BLACK = Color.new(0,0,0)
TEXT_COLOR_WHITE = Color.new(250,250,250)
FACE_GRAPHIC_FULL = 0
FACE_GRAPHIC_BOX = 1
# Compile Icon array
# RTP icons are best stored manually
Icons = ['001-Weapon01','002-Weapon02','003-Weapon03','004-Weapon04'\
,'005-Weapon05','006-Weapon06','007-Weapon07','008-Weapon08'\
,'009-Shield01','010-Head01','011-Head02','012-Head03','013-Body01'\
,'014-Body02','015-Body03','016-Accessory01','017-Accessory02'\
,'018-Accessory03','019-Accessory04','020-Accessory05'\
,'021-Potion01','022-Potion02','023-Potion03','024-Potion04'\
,'025-Herb01','026-Herb02','027-Herb03','028-Herb04'\
,'029-Key01','030-Key02','031-Key03','032-Item01'\
,'033-Item02','034-Item03','035-Item04','036-Item05'\
,'037-Item06','038-Item07','039-Item08','040-Item09'\
,'041-Item10','042-Item11','043-Item12','044-Skill01'\
,'045-Skill02','046-Skill03','047-Skill04','048-Skill05'\
,'049-Skill06','050-Skill07']
# All icons in the icon folder are dynamically added at runtime
ICON_FOLDER_PATH = Dir::getwd + "/Graphics/Icons/"
dir = Dir.new(ICON_FOLDER_PATH)
dir.each { |file|
if file != "." && file != ".."
Icons.push file
end
}
# Compile Face array
if File.directory? Dir::getwd + "/Graphics/Faces/"
Faces = []
FACE_FOLDER_PATH = Dir::getwd + "/Graphics/Faces/"
dir = Dir.new(FACE_FOLDER_PATH)
dir.each { |file|
if file != "." && file != ".."
Faces.push file
end
}
end
#========================================================================
# Global Methods
# Use these methods to quickly modify basic settings or set text
# to $game_temp.message_text manually
#========================================================================
def message(text)
$game_system.map_interpreter.message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = text
end
def default_color(color)
# If an integer passed to the method
if color.class == Fixnum
case color
when 0
$game_system.default_color = TEXT_COLOR_BLACK
when 1
$game_system.default_color = Color.new(128, 128, 255, 255)
when 2
$game_system.default_color = Color.new(255, 128, 128, 255)
when 3
$game_system.default_color = Color.new(128, 255, 128, 255)
when 4
$game_system.default_color = Color.new(128, 255, 255, 255)
when 5
$game_system.default_color = Color.new(255, 128, 255, 255)
when 6
$game_system.default_color = Color.new(255, 255, 128, 255)
when 7
$game_system.default_color = Color.new(192, 192, 192, 255)
when 8
$game_system.default_color = TEXT_COLOR_WHITE
else
$game_system.default_color = TEXT_COLOR_BLACK
end
# If a Color class value is passed to the method
elsif color.class == Color
$game_sytem.default_color = color
end
return true
end
def mood_color(color)
case color
when 0
return Color.new(70,130,180,190)
when 1
return Color.new(178,34,34,190)
when 2
return Color.new(238,174,238,190)
when 3
return Color.new(139,136,120,180)
when 4
return Color.new(255,215,0,190)
end
end
def face(name)
$game_system.face_graphic_name = name
end
def clear_face
$game_system.face_graphic_name = nil
end
def small_text
$game_system.message_text_size == TEXT_SIZE_SMALL
end
def medium_text
$game_system.message_text_size == TEXT_SIZE_MEDIUM
end
def large_text
$game_system.message_text_size == TEXT_SIZE_LARGE
end
def jumbo_text
$game_system.message_text_size == TEXT_SIZE_JUMBO
end
def slow_text
$game_system.message_text_speed == TEXT_SPEED_SLOW
end
def fast_text
$game_system.message_text_speed == TEXT_SPEED_FAST
end
#========================================================================
# Game Temp
#
# @current_event – tracks the current game event for ease of access
#========================================================================
class Game_Temp
attr_accessor :current_event
attr_accessor :consecutive_gold_window
alias old_initialize initialize
def initialize
old_initialize
@current_event = nil
@consecutive_gold_window = false
end
end
#========================================================================
# Game System
#
# Stores message text options
# Use $game_system to view and change values
#========================================================================
class Game_System
attr_accessor :message_text_mode
attr_accessor :message_bubble_bounce
attr_accessor :invisible_position
attr_accessor :message_text_outline
attr_accessor :message_text_speed
attr_accessor :message_text_size
attr_accessor :message_text_font
attr_accessor :message_skip_disabled
attr_accessor :face_graphic_type
attr_accessor :face_graphic_name
attr_accessor :message_text_skip
attr_accessor :default_color
attr_accessor :message_text_outline_color
alias old_initialize initialize
def initialize
old_initialize
@message_text_mode = TEXT_MODE_BUBBLE
@message_bubble_bounce = BUBBLE_BOUNCE_ON
@invisible_position = INVISIBLE_POSITION_TOP
@message_text_outline = TEXT_NORMAL
@message_text_speed = TEXT_SPEED_FAST
@message_text_size = TEXT_SIZE_SMALL
@message_text_font = TEXT_FONT_DEFAULT
@message_text_skip = TEXT_SKIP_NORMAL
@message_skip_disabled = false
@face_graphic_type = FACE_GRAPHIC_BOX
@face_graphic_name = nil
@default_color = TEXT_COLOR_BLACK
@message_text_outline_color = TEXT_COLOR_WHITE
end
end
#========================================================================
# Game Player
#
# The only change is in the condition –if Input.trigger?(Input::C)–
# The change allows for $game_temp.message text to be manually
# altered and still function properly
#========================================================================
class Game_Player
#————————————————————————–
# * Frame Update
#————————————————————————–
def update
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
# Remember coordinates in local variables
last_real_x = @real_x
last_real_y = @real_y
super
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y – $game_map.display_y > CENTER_Y
# Scroll map down
$game_map.scroll_down(@real_y – last_real_y)
end
# If character moves left and is positioned more let on-screen than
# center
if @real_x < last_real_x and @real_x – $game_map.display_x < CENTER_X
# Scroll map left
$game_map.scroll_left(last_real_x – @real_x)
end
# If character moves right and is positioned more right on-screen than
# center
if @real_x > last_real_x and @real_x – $game_map.display_x > CENTER_X
# Scroll map right
$game_map.scroll_right(@real_x – last_real_x)
end
# If character moves up and is positioned higher than the center
# of the screen
if @real_y < last_real_y and @real_y – $game_map.display_y < CENTER_Y
# Scroll map up
$game_map.scroll_up(last_real_y – @real_y)
end
# If not moving
unless moving?
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event
result = check_event_trigger_here([1,2])
# If event which started does not exist
if result == false
# Disregard if debug mode is ON and ctrl key was pressed
unless $DEBUG and Input.press?(Input::CTRL)
# Encounter countdown
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
#—————————————————————–
# Allows messages to display without interruption when directly
# assigned to $game_temp.message_text
#—————————————————————–
# If C button was pressed
if Input.trigger?(Input::C) && $game_temp.message_text == nil
# Same position and front event determinant
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
#========================================================================
# Interpreter
#
# Edit forces the interpreter to wait to update until all messages
# currently on screen have finished writing
#========================================================================
class Interpreter
attr_accessor :list
attr_accessor :index
attr_accessor :message_waiting
alias old_update update
def update
#if $scene.message_window != nil && $scene.message_window.finished != nil
if $game_temp.message_text != nil
return
else
old_update
$game_temp.current_event = @event_id
end
end
def command_101
# If other text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Check for consecutive gold window calls
temp_index = @index+1
loop do
case @list[temp_index].code
when 401
temp_index += 1
when 101
break
else
break
end
end
# Search for consecutive message window with /g formatter
text = nil
# Iterate through max possible message size
for i in 0…3
# Check for existence of list element before checking code
if @list[temp_index+i] != nil
# Search for /g
if @list[temp_index+i].code == 101 or @list[temp_index+i].code == 401
text = @list[temp_index+i].parameters[0].slice(/\\[Gg]/)
if text != nil
# Allows for gold window to continue after first message
$game_temp.consecutive_gold_window = true
break
end
end
end
end
# Turns consecutive flag off if need be
if $game_temp.consecutive_gold_window == true && text == nil
$game_temp.consecutive_gold_window = false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Set message text on first line
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
# Loop
loop do
# If next event command text is on the second line or after
if @list[@index+1].code == 401
# Add the second line or after to message_text
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
line_count += 1
# If event command is not on the second line or after
else
# If next event command is show choices
if @list[@index+1].code == 102
# Advance index
@index += 1
# Choices setup
$game_temp.choice_start = line_count
#Insert 5 spaces for indenting choices
for i in 0…@list[@index].parameters[0].size
if @list[@index].parameters[0][i].slice(0,5) != ' '
@list[@index].parameters[0][i].insert(0,' ')
end
end
setup_choices(@list[@index].parameters)
# If next event command is input number
elsif @list[@index+1].code == 103
# If number input window fits on screen
if line_count < 4
# Advance index
@index += 1
# Number input setup
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
# Continue
return true
end
# Advance index
@index += 1
end
end
end
#========================================================================
# Spriteset Map
#
# Edit allows access to the character_sprites variable
# Use $game_map.character_sprites to access
#========================================================================
class Spriteset_Map
attr_accessor :character_sprites
end
class Scene_Map
attr_accessor :spriteset
attr_accessor :message_window
end
#========================================================================
# Window Base
#
# Edit allows for color 8 (black)
#========================================================================
class Window_Base < Window
#————————————————————————–
# * Get Text Color
# n : text color number (0-7)
#————————————————————————–
def text_color(n)
case n
when 0
return Color.new(250, 250, 250, 255)
when 1
return Color.new(45, 45, 255, 255)
when 2
return Color.new(255, 45, 45, 255)
when 3
return Color.new(45, 255, 45, 255)
when 4
return Color.new(45, 215, 215, 255)
when 5
return Color.new(255, 45, 255, 255)
when 6
return Color.new(230, 230, 15, 255)
when 7
return Color.new(125, 125, 125, 255)
when 8
return Color.new(0, 0, 0)
else
normal_color
end
end
end
#==============================================================================
# ** Window_Gold
#——————————————————————————
# The gold window has been modified to use an icon and some outlined text
#==============================================================================
class Window_Gold_New < Window_Base
def initialize
@current_gold = $game_party.gold
@icon = Sprite.new
@icon.opacity = 0
@icon.bitmap = Bitmap.new('Graphics/Icons/032-Item01')
@icon.ox = @icon.bitmap.width/2
@icon.oy = @icon.bitmap.height/2
@icon.x,@icon.y = 624,460
draw_gold
end
def update
refresh
@icon.opacity += 12 if @icon.opacity < 192
@gold.opacity += 12 if @gold.opacity < 192
end
def refresh
if @current_gold != $game_party.gold
@current_gold = $game_party.gold
@gold.bitmap.clear
draw_gold
end
end
def draw_gold
@gold = Sprite.new
@gold.opacity = 0
@gold.bitmap = Bitmap.new(100,32)
@gold.ox,@gold.oy = @gold.bitmap.width/2,@gold.bitmap.height/2
@gold.x = 560
@gold.y = 465
@gold.z = 50
@gold.bitmap.font.size = 18
@gold.bitmap.font.bold = true
@gold.bitmap.font.color = text_color(8)
@gold.bitmap.draw_text(22,0,75,30,$game_party.gold.to_s,2)
@gold.bitmap.draw_text(22,2,75,30,$game_party.gold.to_s,2)
@gold.bitmap.draw_text(21,1,75,30,$game_party.gold.to_s,2)
@gold.bitmap.draw_text(23,1,75,30,$game_party.gold.to_s,2)
@gold.bitmap.font.color = text_color(6)
@gold.bitmap.draw_text(22,1,75,30,@current_gold.to_s,2)
end
def fade_out
@icon.opacity -= 48
@gold.opacity -= 48
end
def dispose
@icon.bitmap.dispose
@icon.dispose
@gold.bitmap.dispose
@gold.dispose
end
end
#==============================================================================
# ** Window_InputNumber
#——————————————————————————
# This window is for inputting numbers, and is used within the
# message window.
#==============================================================================
class Window_InputNumber < Window_Base
attr_accessor 😡
attr_accessor :y
#————————————————————————–
# * Object Initialization
# digits_max : digit count
#————————————————————————–
def initialize(digits_max,x=0,y=0,indent=0)
@digits_max = digits_max
@number = 0
@x = x
@y = y
@indent = indent
@count = 0
@move_right = true
# Calculate character width for drawing and tracking cursor movement
dummy_bitmap = Bitmap.new(32, 32)
dummy_bitmap.font.size = $game_system.message_text_size
dummy_bitmap.font.name = $game_system.message_text_font
@width = (dummy_bitmap.text_size('0').width\
+ dummy_bitmap.text_size(' ').width)
@x = @x – (@width*@digits_max)
dummy_bitmap.dispose
@index = 0
# Create number display bitmap
@number_window = Sprite.new
@number_window.x = @x
@number_window.y = @y
@number_window.z = 15
@number_window.bitmap = Bitmap.new(@width*@digits_max, 40)
@number_window.bitmap.font.color = TEXT_COLOR_BLACK
@number_window.bitmap.font.size = $game_system.message_text_size
@number_window.bitmap.font.name = $game_system.message_text_font
# Create the cursor to track input position
create_cursor
end
#————————————————————————–
# * Get Number
#————————————————————————–
def number
return @number
end
#————————————————————————–
# * Set Number
# number : new number
#————————————————————————–
def number=(number)
@number = [[number, 0].max, 10 ** @digits_max – 1].min
refresh
end
#————————————————————————–
# * Create Cursor
#————————————————————————–
def create_cursor
@cursor = Sprite.new
@cursor.bitmap = Bitmap.new(32,5)
@cursor.x = @number_window.x
@cursor.y = @number_window.y\
+ @number_window.bitmap.text_size('0').height + 3
@cursor.z = 16
@cursor.opacity = 185
width = @number_window.bitmap.text_size('0').width + 2
@cursor.bitmap.fill_rect(0,0,width,2,text_color(1))
end
#————————————————————————–
# * Cursor Update
#————————————————————————–
def update_cursor
@count += 1
if @count % 10 == 0
if @move_right == true
@cursor.x += 1
else
@cursor.x -= 1
end
if @count == 20
if @move_right == true
@move_right = false
else
@move_right = true
end
@count = 0
end
end
end
#————————————————————————–
# * Frame Update
#————————————————————————–
def update
update_position
# If up or down directional button was pressed
if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
# Get current place number and change it to 0
place = 10 ** (@digits_max – 1 – @index)
n = @number / place % 10
@number -= n * place
# If up add 1, if down substract 1
n = (n + 1) % 10 if Input.repeat?(Input::UP)
n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
# Reset current place number
@number += n * place
refresh
end
# Cursor right
if Input.repeat?(Input::RIGHT)
if @digits_max >= 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @digits_max
@cursor.x += @width
if @index == 0
@cursor.x = @number_window.x
end
end
end
# Cursor left
if Input.repeat?(Input::LEFT)
if @digits_max >= 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + @digits_max – 1) % @digits_max
@cursor.x -= @width
if @index == @digits_max – 1
@cursor.x += @width * @digits_max
end
end
end
update_cursor
end
#————————————————————————–
# * Dispose
#————————————————————————–
def dispose
@number_window.bitmap.clear
@number_window = nil
@cursor.bitmap.clear
@cursor = nil
end
#————————————————————————–
# * Update Position for Bubble Movement
#————————————————————————–
def update_position
if @number_window.x != @x
@number_window.x = @x
@cursor.x = @number_window.x + (@index * @width)
end
if @number_window.y != @y
@number_window.y = @y
@cursor.y = @number_window.y\
+ @number_window.bitmap.text_size('0').height + 3
end
end
#————————————————————————–
# * Refresh
#————————————————————————–
def refresh
@number_window.bitmap.clear
s = sprintf("%0*d", @digits_max, @number)
for i in 0…@digits_max
@number_window.bitmap.draw_text(i * @width, 0, 32, 32, s[i,1])
end
end
end
#========================================================================
# Window Message
#
# Controls message displayed from the show text event command
#
# This modified version also allows for a message to be displayed
# from a script. Simply change $game_temp.message_text to
# whatever text you want to display. Remember that outside
# of the message entry box in the event commands, you will have
# to manuall insert the newline character "\n".)
#========================================================================
class Window_Message < Window_Base
attr_accessor :contents_showing
attr_accessor :finished
attr_accessor :fade_in
attr_accessor :fade_out
attr_accessor :message
attr_accessor :enter_pressed
#————————————————————————–
# * Object Initialization
#
# Prepare message variables, then wait for re_initialize
#————————————————————————–
def initialize(sub=false, text=nil)
# Bubble message variables
@enter_pressed = false
@text_height = 0
@fade_in = false
@event = 0
@contents_showing = false
@finished = nil
@position = ''
@active = false
@lines = 0
@up = 0
@count = 0
@cursor_count = 0
@cursor_move_right = nil
@wait = 0
@wait_add = 0
@pause = false
@index = 0
@sub = sub
@face = nil
@face_extension_x = 0
@face_extension_y = 0
@thought = false
@bubble_color = nil
@hp = nil
if @sub == false
@sub_number = nil
@sub_windows = []
end
@text = text
end
#————————————————————————–
# * Re_Initialize
#
# Call when actual text processing occurs
#————————————————————————–
def re_initialize
if $game_temp.message_text != nil
if $game_system.face_graphic_name != nil
@face = $game_system.face_graphic_name
else
@face = nil
end
@face_extension_x = 0
@face_extension_y = 0
temp = Sprite.new
temp = Bitmap.new(32,32)
# Set @text to whatever text will display
# For sub messages this will already be set
if @text == nil
@text = $game_temp.message_text
end
# Change \ escaped characters to character codes for processing
prep_text
# Determine number of lines in the message
@lines = 0
@text.each_line {|line|
@lines += 1
}
temp_text = @text.clone
# Get rid of any non displayed elements to determine the
# appropriate message box size
def get_digits(integer)
if integer < 10
return 1
elsif integer >= 10
return 2
elsif integer >= 100
return 3
end
end
while temp_text.slice(/\001\[([0-9]+)\]/)
temp_text.slice!(/\001\[([0-9]+)\]/)
end
while temp_text.slice(/\002/)
temp_text.slice!(/\002/)
end
while temp_text.slice(/\004\[([0-9]+)\]/)
temp_text.slice!(/\004\[([0-9]+)\]/)
end
while temp_text.slice(/\005\[([0-9]+)\]/) != nil
temp_text.slice!(/\005\[([0-9]+)\]/)
end
while temp_text.slice(/\006/)
temp_text.slice!(/\006/)
end
while temp_text.slice(/\007\[([0-9]+)\]/)
temp_text.slice!(/\007\[([0-9]+)\]/)
end
while temp_text.slice(/\011/) != nil
temp_text.slice!(/\011/)
end
while temp_text.slice(/\015\[([0-9]+)\]/)
temp_text.slice!(/\015\[([0-9]+)\]/)
@face = Faces[$1.to_i]
end
# Make sure @thought is false unless specified true
@thought = false
while temp_text.slice(/\017/)
temp_text.slice!(/\017/)
@thought = true
@text.slice!(/\017/)
end
# Change @bubble_color to keep default color unless specified other color
@bubble_color = nil
while temp_text.slice(/\018\[([0-9]+)\]/)
temp_text.slice!(/\018\[([0-9]+)\]/)
@bubble_color = mood_color($1.to_i)
@text.slice!(/\018\[([0-9]+)\]/)
end
# Determine message bubble size
bitmap = Sprite.new
bitmap.bitmap = Bitmap.new(32,32)
bitmap.bitmap.font.name = $game_system.message_text_font
bitmap.bitmap.font.size = $game_system.message_text_size
@text_rect = Rect.new(0,0,0,0)
@line_width = []
i = 0
temp_text.each_line {|line|
temp = bitmap.bitmap.text_size(line)
@line_width[i] = temp.width
if temp.width > @text_rect.width
@text_rect.width = temp.width
end
@text_height = temp.height
i += 1
}
# Add space for number input if necessary
if $game_temp.num_input_variable_id > 0 && @sub == false
@lines += 1
end
@text_rect.height = @text_height * @lines
total_size = 0
longest_line = 0
current_line_height = @text_height
@line_height_correction = [0,0,0,0]
line = 0
skip = 0
for i in 0…temp_text.size
# Check for bold toggling and icon insertion
if temp_text[i] == 3
bitmap.bitmap.font.bold == false ? bitmap.bitmap.font.bold = true : bitmap.bitmap.font.bold = false
end
# Check for icon insertion and add 24 pixels to this line's width
if temp_text[i] == 12
# Add sufficient width for an icon to be inserted in the text
total_size += 24
# Adjust the height of the text box if necessary
if current_line_height < 24
current_line_height = 24
@text_rect.height += (24 – @text_height)
@line_height_correction[line] = (24 – @text_height)
end
# Set variable to skip over icon text in sizing operations
skip = 4
end
# Check for face graphic
if temp_text[i] == 13
temp_text.slice(/\015\[([0-9]+)\]/)
skip = 4
@face = Faces[$1.to_i]
end
# Check for new line character
if temp_text[i] == 10
total_size = 0
current_line_height = @text_height
line += 1
end
# Do not size characters relating to an icon
if skip == 0
total_size += bitmap.bitmap.text_size(temp_text.slice(i,1)).width
else
skip -= 1
end
# Make sure longest line sets the bubble width value
longest_line = total_size if total_size > longest_line
end
# Insert facce graphic name if none explicit in message and
# one is stored in $game_system
if $game_system.face_graphic_name != nil && temp_text.slice(/\015\[([0-9]+)\]/) == nil
@face = $game_system.face_graphic_name
end
# Account for face graphic in message box graphic
if @face != nil
determine_face_extension
else
@face_extension_x = 0
@face_extension_y = 0
end
if $game_system.face_graphic_type == FACE_GRAPHIC_FULL
@text_rect.width = longest_line
else
@text_rect.width = longest_line + @face_extension_x
end
# Set start values for text drawing
@x=@y=0
# Determine message position and create the message bubble
#(only if $game_system.message_text_mode == TEXT_MODE_BUBBLE
if $game_system.message_text_mode != TEXT_MODE_INVISIBLE
# Check for existence of necessary Bubble files if mode is set to Bubble
if $game_system.message_text_mode == TEXT_MODE_BUBBLE
# Correct text mode if files do not exist
if File.exist?("Graphics/Pictures/Message_Bubble.png") == false || \
File.exist?("Graphics/Pictures/Pointer2.png") == false
$game_system.message_text_mode = TEXT_MODE_WINDOWSKIN
default_color(8)
end
end
determine_position
create_bubble
else
@bubble_correction_y = 0
@message_box = Sprite.new
@message_box.bitmap = Bitmap.new(@text_rect.width+25, @text_rect.height+26)
@message_box.ox = @message_box.bitmap.width/2
@message_box.oy = @message_box.bitmap.height/2
@message_box.x = $game_system.invisible_position[0]
@message_box.y = $game_system.invisible_position[1]
if @message_box.y – @message_box.bitmap.height/2 < 0
@message_box.y += @message_box.bitmap.height/2
elsif @message_box.y + @message_box.bitmap.height/2 > 480
@message_box.y -= @message_box.bitmap.height/2
end
end
# Create message sprite for drawing actual text
@message = Sprite.new
@message.x = @message_box.x
@message.y = @message_box.y
if @sub == false
@message.z += 1
end
@message.ox = @message_box.ox
@message.oy = @message_box.oy
@message.bitmap = \
Bitmap.new(@message_box.bitmap.width,@message_box.bitmap.height)
@message.bitmap.font.size = $game_system.message_text_size
@message.bitmap.font.color = TEXT_COLOR_BLACK
@speed = $game_system.message_text_speed
@text_color = $game_system.default_color
end
end
#————————————————————————–
# * Dispose
#————————————————————————–
def dispose
terminate_message
$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
end
#————————————————————————–
# * Subs Finished?
#
# Checks to see if all sub messages have finished writing
#————————————————————————–
def subs_finished?
abort_flag = true
count = 0
for sub in @sub_windows
count += 1 if (sub.finished == true && sub.enter_pressed == false)
if sub.finished && sub.enter_pressed
sub.enter_pressed = false
end
end
abort_flag = false if count == @sub_windows.size
if abort_flag == true
return false
else
return true
end
end
#————————————————————————–
# * Erase Subs
#
# Erases any existing subb messages
#————————————————————————–
def erase_subs
if @sub_windows != nil
for sub in @sub_windows
sub.fade_out = true
end
end
end
#————————————————————————–
# * Terminate Message
#————————————————————————–
def terminate_message
# Call message callback
if @message != nil
@message_box.bitmap.clear
@message.z -= 1
@message.bitmap.clear
end
if @cursor != nil
@cursor.bitmap.clear
@cursor.dispose
@cursor = nil
end
if $game_temp.message_proc != nil
$game_temp.message_proc.call
end
# Clear variables related to text, choices, and number input
#if @sub == false
$game_temp.message_text = nil
$game_temp.message_proc = nil
$game_temp.choice_start = 99
$game_temp.choice_max = 0
$game_temp.choice_cancel_type = 0
$game_temp.choice_proc = nil
$game_temp.num_input_start = 99
$game_temp.num_input_variable_id = 0
$game_temp.num_input_digits_max = 0
#end
# Dispose of gold window
if @gold_window != nil && $game_temp.consecutive_gold_window == false
@gold_window.dispose
@gold_window = nil
end
@contents_showing = false
@finished = nil
@active = false
$game_temp.message_window_showing = false
@text = nil
if @sub == false
erase_subs
temp = subs_finished?
if temp == true
for i in 0…@sub_windows.size
@sub_windows[i] = nil
end
@sub_windows = []
end
end
@sub_number = nil
end
#————————————————————————–
# * Draw_Message
#————————————————————————–
def draw_message
if @pause == true
return
end
if @text == nil
return
end
# Indent if choice
if $game_temp.choice_start == 0
@x = 16 + @face_extension_x
end
if @wait == 0
# Set correction for icon insertion
y_correction = 0
for i in 0..@y
if @line_height_correction[i] != nil
y_correction += @line_height_correction[i]
end
end
# Set offset value dependant on text mode
if $game_system.message_text_mode == TEXT_MODE_WINDOWSKIN
offset = 10
elsif $game_system.message_text_mode == TEXT_MODE_BUBBLE
offset = 13
else
offset = 0
end
y = @text_y + (@text_height * @y) + @bubble_correction_y + y_correction
# Insert face graphic if included
if @text.slice!(/\015\[([0-9]+)\]/) || @face != nil
draw_face
end
# Check for formatting options character from text
@c = @text[0,1].slice(/./m)
case @c
# If \\
when "\000"
# Return to original text
@c = "\\"
@text.sub!("\000") {"\\"}
return
# If \C[n]
when "\001"
# Change text color
@text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 8
@message.bitmap.font.color = text_color(color)
@text_color = text_color(color)
end
@text.slice!("\001")
# go to next text
return
# If \G
when "\002"
# Make gold window
if @gold_window == nil
@gold_window = Window_Gold_New.new
#@gold_window.x = 560 – @gold_window.width
if $game_temp.in_battle
# @gold_window.y = 192
else
# @gold_window.y = 0
end
#@gold_window.opacity = @message.opacity
#@gold_window.back_opacity = 200
end
@text.slice!("\002")
# go to next text
return
# If \B
when "\003"
if @message.bitmap.font.bold == false
@message.bitmap.font.bold = true
else
@message.bitmap.font.bold = false
end
@text.slice!("\003")
return
# If sub window is being called
when "\004"
@text.slice!("\004")
@text.sub!(/\[([0-9]+)\]/, "")
if @sub == false
@sub_number = $1
event_key = $game_temp.current_event
# Find the cooresponding slave window
# Must immediately follow master window and be
# in consecutive order
num = 0
index = 0
if $game_system.map_interpreter.list[$game_system.map_interpreter.index].code == 101 \
&& num != @sub_number.to_i
for i in $game_system.map_interpreter.index\
…$game_system.map_interpreter.list.size
if $game_system.map_interpreter.list[i].code == 101
num = $game_system.map_interpreter.list[i].parameters[0].slice(/\\[Ss]\[([0-9]+)\]/)
num = num.slice(/([0-9]+)/).to_i if num!= nil
if num != nil
if num != @sub_number.to_i
num += 1
end
index = i
end
if num == @sub_number.to_i
break
end
end
end
else
index = $game_system.map_interpreter.index
end
$game_system.map_interpreter.index = index
# Save original index value for later
original_index = $game_system.map_interpreter.index
lines = 1
if $game_system.map_interpreter.list[index].code == 101
# Loop until the cooresponding \s[x] character is found
loop do
# Break if there is nothing more to sort through
if $game_system.map_interpreter.list[index] == nil
break
end
# Check the \s[x] for a match with the initial match in master message
temp = $game_system.map_interpreter.list[index].parameters.clone
number = temp[0].slice(/\\[Ss]\[([0-9]+)\]/)
if number != nil
number = number.slice(/[0-9]+/)
end
# If the proper match is found, create sub window
if number == @sub_number
# Create message text for sub message
# Make sure sub message begins at first line
while $game_system.map_interpreter.list[index].code != 101
index -= 1
end
text = $game_system.map_interpreter.list[index].parameters[0].clone
if $game_system.map_interpreter.list[index+1].code == 401
text = text + "\n"
lines += 1
end
# Continue to add text if there is something to be added
if $game_system.map_interpreter.list[index+1].code == 401
# Loop until all sub message text is added
loop do
index += 1
text = text + $game_system.map_interpreter.list[index].parameters[0].clone
if $game_system.map_interpreter.list[index+1].code == 401
text = text + "\n"
lines += 1
else
break
end
end
end
# If last sub window, set event index
if @text.slice("\004") == nil
$game_system.map_interpreter.index = index + 1
end
# Create actual sub window object and place it into
# @sub_windows array for update and disposal
sub = Window_Message.new(true,text)
@sub_windows.push sub
break
else
index += 1
end
end # end loop
return
end # end if code == 101
end
# When \w[x]
when "\005"
@text.slice!(/\005\[([0-9]+)\]/)
@wait_add = $1.to_i
@wait += @wait_add
@wait_add = 0
return
# When \p
when "\006"
@text.slice!("\006")
if @enter_pressed == false
@pause = true
end
return
# When \q
when "\011"
terminate_message
return
# When \i[x]
when "\014"
@text.slice!(/\014\[([0-9]+)\]/)
icon = Sprite.new
icon.opacity = 0
icon.bitmap = Bitmap.new("Graphics/Icons/#{Icons[$1.to_i]}")
true_y = @text_y + (@y * @text_height) + y_correction #+ y + @face_extension_y – (@text_rect.height + 25)
@message.bitmap.blt(offset+@x+@face_extension_x,true_y,icon.bitmap,Rect.new(0,0,24,24))
@x += 24
# When \h[x]
when "\016"
Kailia
Looks like the script works perfectly now. There was one point that confused me for a bit, because the chat bubble wasn't appearing on event 2. But I traced that to a caterpillar script of mine that was in the game. So Even though the event was labeled 2, I changed the command to have the chat appear on event 5 and it fixed it.
aldrinbulajr
why the choices doesn’t appear?! :C
Hodgeelmf
If I understand the problem aldrinbulajr had, it involved a glitch occasioned by showing choices without message text immediately preceding. I have fixed that bug and added a command (\nc) to keep choices from displaying with preceding text if one desires (perhaps to give unspoken options like “hit him, run, cry.”
Note – the \nc command has to be placed in the text of one of the choices, NOT in the main message text. I hope the revision is useful. Eventually, there are some other additions that I think would be fun, but I have little time to implement them currently.
Metaclaw
I like the looks/simplicity of this system.
can you post the actual script please? I can't open the demo, cause I'm using a newer version of RMXP.
Bob423
There's a really easy way to fix that. Open both game.ini and game.rxproj using a text editor like notepad+ or crimson editor.
in game.ini, you'll see "Library=RGSS10XE.dll" where X is the version you have. the latest is 1.04, so you'll probably change that to 4
in game.rxproj, just change the 1.0x to the version you have again.
If that doesn't work, then it was made before v1.02, or it's 1.02 and you're using 1.04. It's really weird and makes no sense, but that's Enterbrain for you.
the only change made in 1.04 is how you get the full version. They changed the way their server works, so they made a completely new version…wut
Marked
@Metaclaw: Here's the script: http://pastebin.com/2MsmEjyB But note, you'll need the images from the demo.
Metaclaw
thanks marked! I wish I knew how to fix this, in case this happens again.
bob, how do I change game.rxproj 's version?
Edit: nevermind, I replaced it with the same file from another project and it worked.
Marked
I really need to get an email system up so authors of stuff get emailed when users post, particularly in scripts.
Radis90
error when i using Blizz ABS 🙁
hope it fixed 🙁
Marked
I doubt that will ever be fixed, this isn't being developed. Try another Message script: http://www.gdunlimited.net/scripts/rpg-maker-xp/custom-message-systems
Guest
Can Someone Help me please.. I just need the images from the Demo.. And I can't seem to open the Demon… it's not a folder nor an exe. it's something else… Can someone help me please… I just need the picture.. the bubble one.. Thanks a LOT.
or send it to me on lancedragonlord@yahoo.com it would be very appreciated.. Thanks a bunch.
Guest
@Guest_help-me-out-please Its an .zip file. Usual you need Winzip, but you can also open it with 7zip or Winrar. I would recommend winrar though. Don't worry 7z and ~WinRar are both free! Warning: if you download much, you will be seeing much .rar, .zip and .7z files 😛