Help - Search - Members - Calendar
Full Version: Advance Text System v 3.0
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Pages: 1, 2, 3
modern algebra
Advanced Text System
Version: 3.0c
Author: modern algebra
Date: September 7, 2010

Version History


  • Version 3.0c - 09.07.2010 - Fixed an issue with the :fit_window_to_text property, where it wouldn't resize when a message was shorter than a previous message. Also fixed an issue where paragraph format was thrown off when a new page was made, as well as another issue with choices, where the cancel condition would sometimes be changed when repeating a choice branch. Finally, I added the \x[n] code.
  • Version 3.0b - 07.23.2010 - Fixed the F12-related bugs. The script should now be F12-safe
  • Version 3.0a - 06.19.2010 - Added a feature that will automatically show the whole face unless you specify that it should only show a portion of it. Makes it simpler to use large faces.
  • Version 3.0 - 06.13.2010 - complete rewrite, adding in tons of new features, in addition to making the script more intuitive and easier to learn. See the features section for a list of some of the updates. Also, the Paragraph Formatter is no longer needed, as I wrote up a special formatter class for the ATS and included it in the script.
  • Version 2.0c - 11.6.2008 - bug with system if paragraph format is turned off but scrolling and Autopause are not
  • Version 2.0b - 09.21.2008 - a major bug with levelling fixed.
  • Version 2.0 - 09.17.2008 - a number of new features and script rewritten into a more friendly version.
  • Version 1.5 - 07.18.2008 - quite a few new features. See the updated features list for details.
  • Version 1.2b - 05.02.2008 - Minor bug fixes
  • Version 1.2 - 04.14.2008 - Minor positioning glitch fixed with message back sprites. Added an option to have more than one column with the choice boxes. Face can now be drawn mirrored. Now there are 52 runtime options.
  • Version 1.11 - 04.04.2008 - Minor bug fix with \px - added option to choose how many choices to show in a choicebox before it starts scrolling. - added option to change the back_sprite when you use dim background. So now 50 runtime messages
  • Version 1.1 - 03.31.2008 - It is now possible to set the position and size of the message window. Also, there are now 48 runtime message options and 29 special character codes in addition to the default ones. Note that it will not resize of the message back if you use dim messages
  • Version 1.0 - 03.18.2008 - Original Release. In addition to the default options, there are now 42 runtime message options and 23 special character codes


Description


This script allows for various complex message commands. Among the features are some that will be familiar from previous message scripts, such as Seasons in the Abyss' SMS and AMS. Others, such as the formatted text, expanded choice options, and speech tags, are completely new (as far as I know). See below for the features and command codes. The focus of this script is on customizability, which means that the script can seem daunting with all the properties and special message codes that you can use. However, whether to use these features is up to you, and it is very easy to plug in and just use the basic features that make sense for your game. Maybe all you want is appended choice branches and nameboxes ~ the basics are very easy and this script can be plug & play. But if you want to give your game that little extra something, the choice branches with subheadings, or the custom crafting scene, then that power is within this script, if you're willing to learn how.

Features


  • High in-game customizability, with control over practically everything, if you decide to use it
  • Great face handling, including the ability to use larger faces, set the faces lower than the message window, and scroll or fade them in
  • Animated Facesets
  • The ability to put faces in a window, and to set the border size of that window.
  • Appended Text Commands
  • Paragraph Formatting, allowing you to ignore the grey arrows when inputting text
  • Variable Letter-by-Letter Speed
  • Can play a sound effect as text is drawn
  • Scrolling, with a number of new features such as smooth scroll, the ability to scroll by page, and the ability for the player to review a scrolled message when it is paused by pressing up and down.
  • All relevant special message codes can be used anywhere they are useful
  • Name Window, with the ability to set the border size of the window and multiline support
  • Can set all of the windows to different sizes and positions
  • SpeechTag graphics can be used when setting a message window above or below a character (with the :character & :char_ref properties, or the \oc, \uc, or \e codes)
  • \+{} command allows you to expand the text of a choice well beyond the limitations of the program, and the ability to have multiline choices in either the default way or the choicebox makes this feature particularly useful ~ Choices can be sentences if you want them to be!
  • Conditional Choice Options, as well as the ability to skip or disable choices
  • Appended Choice Branches,
  • The new choicehelp window allows you to attach a description to any choice that will show to the player when hovering over that choice
  • The new word window allows you to create a line of instant text to be shown anywhere else on the screen
  • The ability to use dim graphics for all windows
  • Short hand codes for the names, descriptions, and prices for pretty much everything relevant. See the Special Message Codes section for details
  • Lots of text effects, including hex colouring, bold, italic, shadow, underline, and highlight.
  • A large number of vocab, actor, enemy, item, weapon, armor, skill, & state codes, allowing you to retrieve any publicly accessible value from them provided you know the method name.
  • Alignment and tab codes
  • Lots of other new message codes. See below for list
  • A property that you can set to avoid obscuring specified characters when using default positioning
  • Graphic Novel Support
  • A property that allows the player to move while the message window is visible
  • A property that will prevent the message window from refreshing, allowing you to do small things like Show Pictures and controlling switches without the text having to go to a new page.


Screenshots


From Left to Right: Large Faces; Multiline Choices and Name Window; Simple Crafting system made entirely from Advanced Choice Branches of the ATS; Message Window Character positioning with Speech Tag; Tabbing and icon and underline features; Paragraph Format with Justified Text in the midst of a smooth scroll

There are lots of other features too, but screenshots for all of them would be rather tedious

Instructions



Basically: paste the script in its own slot above Main and Below Materials in the Script Editor. If you are upgrading from ATS2, then you will also need this conversion patch. Paste it underneath the ATS3 in the Script Editor, but still above Main.

Complete instructions on what each property or code does can be found in the header of the script, from lines 149-754. But, in brief:

Special Message Codes


Special Message codes are codes placed in messages to be replaced by something specified or to achieve a special effect. An example of the former is \v[n], which, when used, is replaced by the value of Variable n. An example of the latter is \c[n], which, when used, makes all text following the colour with index n on the windowskin palette. The following, contained in the spoiler, are all the new and old special message codes that can be used in ATS3.

Special Message Codes

  • General Codes for all Windows
    • \lb - Line break. Go to next line
    • \v[n] - Draw the value of the variable with ID n
    • \n[n] - Draw the name of the actor with ID n
    • \c[n] - Set the colour of the text being drawn to the nth colour of the Windowskin palette
    • \c[#RRGGBB] - Set the colour of the text being drawn to any colour, using hexadecimal
    • \p[n] OR \pid[n] - Draw the ID of the actor in the nth position in the party
    • \ni[n] - Draw the name of the item with ID n
    • \nw[n] - Draw the name of the weapon with ID n
    • \na[n] - Draw the name of the armor with ID n
    • \ns[n] - Draw the name of the skill with ID n
    • \nt[n] - Draw the name of the state with ID n
    • \nc[n] - Draw the name of the class with ID n
    • \ne[n] - Draw the name of the event with ID n on the current map
    • \nm[n] - Draw the name of the enemy with ID n
    • \nl[n] - Draw the name of the element with ID n
    • \nv[n] - Draw the name of the variable with ID n
    • \nsw[n] - Draw the name of the switch with ID n
    • \np[n] - Draw the name of the actor in the nth position in the party
    • \map - Draw the name of the map the player is currently on
    • \map[n] - Draw the name of the map with ID n
    • \di[n] - Draw the description of the item with ID n
    • \dw[n] - Draw the description of the weapon with ID n
    • \da[n] - Draw the description of the armor with ID n
    • \ds[n] - Draw the description of the skill with ID n
    • \pi[n] - Draw the price of the item with ID n
    • \pw[n] - Draw the price of the weapon with ID n
    • \pa[n] - Draw the price of the armor with ID n
    • \i#[n] - Draw the number of the item with ID n that the party posesses
    • \w#[n] - Draw the number of the weapon with ID n that the party posesses
    • \a#[n] - Draw the number of the armor with ID n that the party posesses
    • \ac[n] - Draw the class of the actor with ID n
    • \i[n] - Draw the icon with index n
    • \ii[n] - Draw the icon of the item with ID n
    • \wi[n] - Draw the icon of the weapon with ID n
    • \ai[n] - Draw the icon of the armor with ID n
    • \si[n] - Draw the icon of the skill with ID n
    • \ti[n] - Draw the icon of the state with ID n
    • \fn[fontname] - Change the font to fontname
    • \fs[n] - Change the fontsize to n
    • \fa[n] - Change the alpha value (opacity) of the font to n
    • \b - Turn bold on
    • /b - Turn bold off
    • \i - Turn italic on
    • /i - Turn italic off
    • \s - Turn shadow on
    • /s - Turn shadow off
    • \u - Turn underline on
    • /u - Turn underline off
    • \hl[n] - Turn highlight with colour n on
    • /hl OR \hl[-1] - Turn highlight off
    • \l - align the text to the left
    • \r - align the text to the right
    • \c - align the text to the centre
    • \t - Tab. Draws the next character at the nearest pixel that is a multiple of 32
    • \f[key] - Draw the value corresponding to that key in the FILTERS array
    • \s[n,text] - Will only draw text if the switch with ID n is ON
    • \s![n,text] - Will only draw text if the switch with ID n is OFF
    • \vocab[method] - Will draw whatever Vocab.method returns, if it is a valid method call. A list of suitable methods are included in the full Instructions
    • \actor_method[n] - This will draw whatever actor.method returns for whoever actor n is. A list of suitable methods are included in the full Instructions
    • \i_method[n] - This will draw whatever item.method returns for the item with ID n. A list of suitable methods are included in the full Instructions
    • \w_method[n] - This will draw whatever weapon.method returns for the weapon with ID n. A list of suitable methods are included in the full Instructions
    • \a_method[n] - This will draw whatever armor.method returns for the armor with ID n. A list of suitable methods are included in the full Instructions
    • \s_method[n] - This will draw whatever skill.method returns for the skill with ID n. A list of suitable methods are included in the full Instructions
    • \t_method[n] - This will draw whatever state.method returns for the state with ID n. A list of suitable methods are included in the full Instructions
    • \enemy_method[n] - This will draw whatever enemy.method returns for whoever the enemy with ID n is. A list of suitable methods are included in the full Instructions in the Header
    • \#{code}# - This will evaluate code. So, if you know scipting, you can place any code there and it will draw whatever is returned by it
    • \resub - this feature will rerun the substitution method. It is useful if you want to use some message codes as arguments for other message codes

  • Message Window Specific Codes
    • \g - Shows a window with the party's gold. Closes if already open
    • \nb[name] - Shows a name box with name displayed in the box
    • /nb - Closes the namebox
    • \wb[word] - shows the word in its own window, similar to the gold window.
    • /wb - Closes a wordbox
    • \. - Wait 15 frames (1/4 second) before drawing the next letter
    • \| - Wait 60 frames (1 second) before drawing the next letter
    • \w[n] - Wait n frames before drawing the next letter
    • \! - Pause. Make the message wait for player input before continuing
    • \^ - Skip the next pause without waiting for player input
    • \> - Speed up the text drawing by reducing wait time between letters by one frame
    • \< - Slow down the text drawing by increasing wait time between letters byone frame
    • \S[n] - Change the speed the text draws by adding n to the current time between drawing letters
    • \S[=n] - Directly set the speed the text draws to n
    • \@ - Turn on Show line fast
    • /@ - Turn off Show line fast
    • \@@ - Turn on Show message fast. This will show the entire message instantly
    • /@@ - Turn off Show message fast
    • \% - Toggle Disable Text Skip through user input
    • \se[sound effect name] - Plays a sound effect
    • \me[music effect name] - Plays a musical effect
    • \ani[target_id,animation_id] - Shows animation_id on target_id
    • \bln[target_id,balloon_id] - Same as ani, but shows a balloon
    • \af[n] - Show the face of the actor with ID n
    • \pb - Page Break. Clear the contents and start drawing from the first line
    • \oc[n] - positions the message box over a character n
    • \uc[n] - same as \oc, but places box under character n
    • \lc[n] - same as \oc, but places box to left of character n
    • \rc[n] - same as \oc, but places box to right of character n
    • \e[n] - same as \oc, but if the box is too tall to comfortably fit, is moved below the character instead
    • \mxy[x, y] - Set the position of the message window to x, y
    • \fxy[x, y] - Set the position of the face window to x, y
    • \nxy[x, y] - Set the position of the name window to x, y
    • \#!{code}# - This will evaluate code at the time the window reaches this code when drawing

  • Choice Branch Specific Codes
    • \skip - Placing this in a choice text means that the player will not be able to hover over or select this option, but will skip to the next one
    • \soff[n] - A choice with this in it will only appear in the branch if the switch with ID n is OFF
    • \son[n] - Same as soff[n], but it will only appear if switch n is ON
    • \d[n] - A choice with this in it will be disabled (unselectable) if the switch with ID n is OFF. It will still show up, and the player can hover over it, but he or she will be prevented from selecting it
    • \d![n] - Same as \d[n], except it will be disabled if switch n is ON
    • \wb[text] - This code will create a help window. When the player hovers over that choice, it will show text in the help window. This allows you to explain the choice or make any content in the help window dependent on which choice the player is on
    • \+{text} - This is actually a code you can put in a comment that is directly below the when branch of a choice, and it will add text to the choice. This effectively ignores the normal limitations on the size of a message in a choice, allowing you to make longer choices



Properties


There are too many to list what each specifically does, so please refer to the Instructions in the Header for that information. What I will do here is give the names and expected value types for each. Properties are set by placing the following codes in a message box:
ats_next (:property, value)
ats_all (:property, value)
where :property is the property you want to change and value is the new value for that property. You should use ats_next when you want to change the text for the next message only, and ats_all if you want to change it for all following messages. Anyway, I will put down the names of each property and the type of value they expect in the form :property, expected value. Expected value may be: number (..., -2, -1, 0, 1, 2, ...); boolean (true/false); array ([a, b, c, ...]); range (a..cool.gif, string ("string")

Properties

  • General Properties
    • :max_lines, number
    • :message_speed, number
    • :skip_disabled, boolean
    • :append_text, boolean
    • :append_choice, boolean
    • :scrolling, boolean
    • :scroll_speed, number
    • :scroll_show_arrows, boolean
    • :scroll_autopause, boolean
    • :scroll_review, boolean
    • :scroll_by_page, boolean
    • :paragraph_format, boolean
    • :justified_text, boolean
    • :letter_sound, boolean
    • :letter_se, ["string", number, number]
    • :letters_per_se, number
    • :random_pitch, range
    • :speech_tag_index, number
    • :speech_tag_graphics
    • :start_sound, boolean
    • :start_se, ["string", number, number]
    • :finish_sound, boolean
    • :finish_se, ["string", number, number]
    • :pause_sound, boolean
    • :pause_se, ["string", number, number]
    • :terminate_sound, boolean
    • :terminate_se, ["string", number, number]
    • :move_when_visible, boolean
    • :graphic_novel, boolean
    • :hide_button, Input::Button
    • :gn_press_or_toggle, boolean
  • Message Window Properties
    • :message_x, number
    • :message_y, number
    • :wlh, number
    • :battle_wlh, number
    • :do_not_obscure, boolean
    • :obscure_characters, [number, number, ...]
    • :obscure_buffer, number
    • :fit_window_to_text, boolean
    • :message_width, number
    • :message_height, number
    • :message_opacity, number
    • :message_backopacity, number
    • :message_windowskin, number
    • :message_fontcolour, number
    • :message_fontname, "string"
    • :message_fontsize, number
    • :message_fontalpha, number
    • :message_dim, "string"
  • Face Window Properties
    • :face_x, number
    • :face_y, number
    • :face_z, number
    • :face_side, boolean
    • :face_offset_x, number
    • :face_offset_y, number
    • :face_width, number
    • :face_height, number
    • :face_mirror, boolean
    • :face_opacity, number
    • :face_blend_type, number
    • :face_fadein, boolean
    • :face_fade_speed, number
    • :face_scroll_x, boolean
    • :face_scroll_y, boolean
    • :face_scroll_speed, number
    • :animate_faces, boolean
    • :letters_per_face, number
    • :face_window, boolean
    • :face_window_opacity, number
    • :face_windowskin, "string"
    • :face_border_size, number
    • :face_dim, "string"
    • :face_use_dim, number
  • Choice Window Properties
    • :choice_text, "string"
    • :disabled_choice_text, "string"
    • :choicebox_text, "string"
    • :choice_window, boolean
    • :choice_x, number
    • :choice_y, number
    • :choice_offset_x, number
    • :choice_offset_y, number
    • :choice_width, number
    • :choice_height, number
    • :column_max, number
    • :row_max, number
    • :choice_spacing, number
    • :choice_opacity, number
    • :choice_backopacity, number
    • :choice_windowskin, "string"
    • :choice_fontcolour, number
    • :choice_fontname, "string"
    • :choice_fontsize, number
    • :choice_wlh, number
    • :choice_dim, "string"
    • :choice_use_dim, number
    • :choice_on_line, boolean
    • :choice_opposite_face, boolean
  • Choice Help Window Properties
    • :choicehelp_x, number
    • :choicehelp_y, number
    • :choicehelp_width, number
    • :choicehelp_height, number
    • :choicehelp_center, boolean
    • :choicehelp_opacity, number
    • :choicehelp_backopacity, number
    • :choicehelp_windowskin, "string"
    • :choicehelp_fontcolour, number
    • :choicehelp_fontname, "string"
    • :choicehelp_fontsize, number
    • :choicehelp_wlh, number
    • :choicehelp_dim, "string"
    • :choicehelp_use_dim, number
  • Name Window Properties
    • :name_x, number
    • :name_y, number
    • :name_offset_x, number
    • :name_offset_y, number
    • :name_opacity, number
    • :name_backopacity, number
    • :name_windowskin, "string"
    • :name_border_size, number
    • :name_wlh, number
    • :name_fontcolour, number
    • :name_fontname, "string"
    • :name_fontsize, number
    • :name_dim, "string"
    • :name_use_dim, number
  • Word Window Properties
    • :word_x, number
    • :word_y, number
    • :word_width, number
    • :word_height, number
    • :word_opacity, number
    • :word_backopacity, number
    • :word_windowskin
    • :word_wlh, number
    • :word_fontcolour, number
    • :word_fontname, "String"
    • :word_fontsize, number
    • :word_dim, "string"
    • :word_use_dim, number
  • ats_next-only Properties
    • :do_not_refresh, boolean
    • :character, number
    • :char_ref, number



The last three are only permitted to be changed by ats_next, not ats_all.


Script


You can retrieve the script either from the demo or the text document. If you are upgrading from ATS2, you also need the Conversion Patch. Paste it underneath the ATS3 in the Script Editor, but still above Main.

Credit



  • modern algebra


Thanks


  • Zeriab! for his tutorial on Regular Expression made this script possible, but mostly for being my mentor and friend. Without him, this script and all my others would never have existed


Support



Post in this topic at RMRK if you have any problems, as I check that forum more frequently. Remember, this script is mostly untested. There are a lot of different combinations of features that may or may not work, I'm not sure. Also, if you have any great ideas for additions to this script, then feel free to suggest them. There's no better time than now.

Known Compatibility Issues


All other Message scripts will not work with this one.

Demo



Download Demo

You can also retrieve the script from the text document.

If you are upgrading from ATS2, you also need the conversion patch. Paste it underneath the ATS3 in the Script Editor, but still above Main.

Graphics


Included in the demo are sample speechtag graphics. The graphics included are: Speech Tag 1, Speech Tag 2, and Thought Tag 1 ~ As you will notice, you need to put these in the SPEECHTAG_GRAPHICS array in the script if you want to be able to use them, and these files must be saved into the System folder of Graphics.

If you wish to create your own, you may use this template:

Basically, 1, 2, 3, & 4 are for the graphic that will appear when a message box is placed OVER a character. 5, 6, 7, & 8 are for the graphic that will show up when the message window is placed UNDER a character. 1 & 2, and 7 & 8 must be 16 pixels tall and this is the point of overlap. This part of the graphic is the part that overlaps with border of the message window. 3 & 4, and 5 & 6, are the parts that do not, and they can be as tall as you want them to be, but 3& 4 must be the same height as 5 & 6. Lastly, there are two columns: 1, 3, 5, & 7, and 2, 4, 6, & 8. The first column is for the background of the speech tag, and it will be shown at the same opacity as :message_backopacity. The second column will be the same opacity as :message_opacity. They can be whatever width you want them to be, provided that each column is the same width.

Author's Notes


Well, I figured it was about time to rewrite this script. I started off with very good intentions, but about halfway through I started coding pretty sloppily. So this script really isn't the best I could do, and I am sure there are a few bugs to be hammered out. But please, try this script out, mention any bugs or incompatibilities you find and I will do my best to fix them up. Also, if you have any suggestions, there is no better time than during this debugging period, as once this script is bugfree I have no intention of looking at it ever again.
Apkx24
i get this error

<See attachment>
advanced dialogue script line 538??? No method error???? undefined method 'default_x' for nil:NilClass
right when i hit test play with this script, and i didnt even touch the scripting ( i didnt edit it)
help?
modern algebra
That's very strange. Are you getting this error from the demo?

That error would occur if $game_dlgoptions is not created, so I am guessing that you have a custom script that overwrites the create_game_objects of Scene_Title. Try placing the ADS script below your other custom scripts in the Editor. If that doesn't work, link me to your other scripts or upload a duplicate of your game file (or recreate the error in a different project and upload that, if you don't feel comfortable sharing your real project).

Of course, if you are getting the error from the demo, then the point is moot.
PhantomH
I was wondering if you can customize the choice boxes to make them align next to each other instead of on top, or both ways. Ex. of what I mean:

Layout 1:

Ch1 [XXXXX] Ch2 [XXXXX]

Layout 2:
Ch1 [XXXXX] Ch2 [XXXXX]
Ch3 [XXXXX] Ch4 [XXXXX]

I haven't looked at the demo yet, but I'll check it out when I get back on later so sorry if it's explained in there.
SojaBird
I think I prefer Neo Messages better
modern algebra
QUOTE (PhantomH @ Apr 5 2008, 01:54 AM) *
I was wondering if you can customize the choice boxes to make them align next to each other instead of on top, or both ways. Ex. of what I mean:

Layout 1:

Ch1 [XXXXX] Ch2 [XXXXX]

Layout 2:
Ch1 [XXXXX] Ch2 [XXXXX]
Ch3 [XXXXX] Ch4 [XXXXX]

I haven't looked at the demo yet, but I'll check it out when I get back on later so sorry if it's explained in there.


That's actually not an option, but I can add it if you like.

@pim321 - well NMS is a good script too. I think our two scripts have a different focus, though with some overlap, and obviously whichever focus suits your game is better for you to use.
Apkx24
it doesnt allow me to upload it i tried doing the .exe installer, it wont let me and i tried doing the whole project, wont let me and i even tried just the script

and then it wont even let me upload an image it keeps saying i did not select a file, which i did....
and i tried 5 times and it says the same thing...
wtf? how do i get it to where you can d/l it? link to another website or is it because of my status as amember or something
modern algebra
Upload it to sendspace.com perhaps.
cyrus_the_virus
i am a noob but can someone tell me how to exactly put the code in the game and how to operate with it
loved the demo
PhantomH
QUOTE (modern algebra @ Apr 5 2008, 09:06 AM) *
That's actually not an option, but I can add it if you like.

@pim321 - well NMS is a good script too. I think our two scripts have a different focus, though with some overlap, and obviously whichever focus suits your game is better for you to use.


It'd be great if you can add it smile.gif . That's one of my most wanted things in a message script right now. Btw, when I tried talking to the character right beside the starting point, it says something about unable to find "MessageBackSmalls.".
modern algebra
Oh, oops tongue.gif

I was testing the message back feature with her. I will upload a new version soon, but for now you can just delete that line from the event if you want to see the resized window features.

Also, @cyrus - just open the script editor in the demo (F11) and near the bottom of the list will be two entries titled Paragraph Formatter v 1.1 and ADS respectively. Just copy them and paste them in your project's editor.
cyrus_the_virus
okay i succesfully added the script but i don't exactly know what script line does what?
modern algebra
I'll add more useful descriptions in the comments in the features, but for now just look at the constants section - since most off the command lines share the same name it should give you a good impression of what does what. The constants section starts at line 178 in the ADS script.
Apkx24
http://www.sendspace.com/file/3d11vj

that is a blank project that has all my scripts, can someone look at it and plz help me?
im using the animated title, could that be it? how could i make both compatible with eachother? thx
modern algebra
Yeah, it's the Skip Title script. I'll have to give woratana a talking to tongue.gif

TO fix it, go to the Skip_Title entry in the editor and at line 82:

CODE
$game_temp = Game_Temp.new


insert a line right above that, so that it looks like this:

CODE
  $game_dlgoptions = Game_DialogueOptions.new
  $game_temp = Game_Temp.new


Also, I notice that you have Paragraph Format on in your script entry, but do not have the Paragraph Formatter script. You will have to get that script here in order for paragraph formatting to work.
Automaton
QUOTE (modern algebra @ Apr 2 2008, 10:55 PM) *
Advanced Dialogue System
Version: 1.11
Author: modern algebra
Date: March 18, 2008

Version History


  • Version 1.11 - Minor bug fix with \px - added option to choose how many choices to show in a choicebox before it starts scrolling. - added option to change the back_sprite when you use dim background. So now 50 runtime messages. Also, Animated Facesets was changed to allow for many more frames.
  • Version 1.1 - It is now possible to set the position and size of the message window
  • Version 1.0 - Original Release.


Description


This script allows for various complex message commands. Among the features are some that will be familiar from previous message scripts, such as
Seasons in the Abyss' SMS and AMS. Others, such as the formatted text and the animated facesets, are completely new (as far as I know). See below for the features and command codes

Features


  • Separate Choice Box and Appended Choice Branches
  • Name Window
  • Paragraph Formatting
  • Animated Facesets
  • Appended Text Commands and Scrolling Message Window
  • Variable Letter-by-Letter Speed
  • Can play a sound effect as text is drawn
  • Lots of new message codes. See below for list
  • High in-game customizability
  • NEW in Version 1.1 - Can set the message window to different sizes and position


Screenshots





NEW in V. 1.1


There are lots of other features that screenchots cannot capture.

Some of the graphics I used, like those two facesets (three actually - the blonde guy is animated), are taken from one of the sample games

Commands

CODE
Special Codes:
   Retained Codes:
     \v[x] - Shows the value located in the variable x
     \n[x] - Shows the name of the Actor with ID x
     \c[x] - Changes the colour of the text to x. x can be 0 - 31
     \g    - Shows the gold window
     \.    - A short pause of 15 frames (1/4 second) before continuing drawing
     \|    - A longer pause of 60 frames (1 second) before continuing drawing
     \!    - Pause. Waits for user input before continuing
     \^    - Pause Skip. Forgoes user input at next pause. Can autoclose message
   Modified Codes:
     \>    - Speeds up the letter by letter process
     \<    - Slows down the drawing of the text
     \@    - Show Line Fast (the current line gets displayed quickly). This
             replaces the old functionality of \>, \<
     \@@   - Show message fast (to next scroll)
   New Codes:
     \nc[x]- Shows the name of class with ID x
     \ac[x]- Shows class of actor with ID x
     \np[x]- Shows the name of the Party Member with index x
     \ne[x]- Shows the name of Event with ID x on the map
     \nm[x]- Shows the name of Monster with ID x
     \ni[x]- Shows the name of Item with ID x
     \nw[x]- Shows the name of Weapon with ID x
     \na[x]- Shows the name of Armour with ID x
     \pi[x]- Shows the price of Item with ID x
     \pw[x]- Shows the price of Weapon with ID x
     \pa[x]- Shows the price of Armour with ID x
     \iicon[x] - Shows the Icon of Item with ID x
     \wicon[x] - Shows the Icon of Weapon with ID x
     \aicon[x] - Shows the Icon of Armour with ID x
     \icon[x] - Shows the Icon with ID x
     \fn[font name] - Changes the font to font name chosen
     \fs[x] - Changes the font size to x
     \name[name] - Shows a name box with name displayed in the box
     \ani[target_id,animation_id] - Shows animation_id on target_id. 0 => player,
                           other numbers indicate the ID of the event
     \bln[target_id,balloon_id] - Same as ani, but shows a balloon
     \lb - Line Break. Applies only when Paragraph Formatting and it goes
           to next line
     \% - Disable Text Skip through user input
     \se[sound effect name] - Plays a sound effect
     \me[music effect name] - Plays a musical effect
     \oc[character_id] - positions the message box over character. 0 => player;
                           other positive integers indicate events on map
     \uc[character_id] - same as oc, but places box under character
     \lc[character_id] - same as oc, but places box to left of character
     \rc[character_id] - same as oc, but places box to right of character
     \px[x] - Sets the box's x position at x
     \py[y] - Sets the box's y position to y

Special Settings:
   In addition to the new codes, there are new settings that can be set for messages through call script. To change a setting for an individual message, use the $game_message variant of the following codes. To change the setting for all messages, use the $game_dlgoptions variant. For the sake of convenience, only the $game_message codes will be run through, but each code can also be used by $game_dlgoptions:

     $game_message.x = positive integer (0-Resolution width, by def. 544)
     $game_message.y = positive integer (0-Resolution height, by def. 416)
     $game_message.width = positive integer (1-Resolution width, by def. 544)
     $game_message.height = positive integer (1-Resolution height, by def. 416)
     $game_message.faceside = true/false
     $game_message.facesize = positive integer (ex. 96)
     $game_message.opacity = positive integer between 0 and 255 (ex. 200)
     $game_message.fontname = "font name" (ex. "Arial", ["Arial", "Times New Roman"])
     $game_message.fontsize = positive integer (ex. 16)
     $game_message.windowskin = "Skin File" (ex. "Window")
     $game_message.paragraph_format = true/false
     $game_message.justified_text = true/false
     $game_message.wlh = positive integer (ex. 24)
     $game_message.scrolling = true/false
     $game_message.shown_lines = integer (ex. 4)
     $game_message.autopause = true/false
     $game_message.choicebox = true/false
     $game_message.choices_appended = true/false
     $game_message.choicebox_on_line = true/false
     $game_message.choicebox_width = positive integer (ex. 160)
     $game_message.choicebox_opacity = positive integer between 0 & 255 (ex. 200)
     $game_message.choicebox_fontname = "font name" (ex. "Arial")
     $game_message.choicebox_windowskin = "Skin File" (ex. "Window")
     $game_message.choicebox_offset_x = integer
     $game_message.choicebox_offset_y = integer
     $game_message.number_choices = positive integer (I'm an idiot. In the script I wrote positive integer > 1 :P)
     $game_message.lbl_se = true/false
     $game_message.message_se = "Audio File" (, volume, pitch) [volume and pitch optional]
     $game_message.mt_se = true/false
     $game_message.termination_se = "Audio File" (, volume, pitch) [volume and pitch optional]
     $game_message.mp_se = true/false
     $game_message.pause_se = "Audio File" (, volume, pitch) [volume and pitch optional]
     $game_message.ms_se = true/false
     $game_message.start_se = "Audio File" (, volume, pitch) [volume and pitch optional]
     $game_message.mf_se = true/false
     $game_message.finish_se = "Audio File" (, volume, pitch) [volume and pitch optional]
     $game_message.letter_frames = integer (ex. 1)
     $game_message.face_letters = integer (ex. 2)
     $game_message.sound_letters = integer (ex. 3)
     $game_message.namebox_fontname = "font name" (ex. "Arial")
     $game_message.namebox_fontsize = positive integer (ex. 16)
     $game_message.namebox_windowskin = "Skin File" (ex. "Window")
     $game_message.namebox_colour = positive integer between 0 & 31 (ex. 7)
     $game_message.namebox_opacity = positive integer between 0 & 255 (ex. 200)
     $game_message.namebox_offset_x = integer (ex. 8)
     $game_message.namebox_offset_y = integer (ex. 16)
         $game_message.back_sprite = "filename"

   Two Options which do not exist in dlgoptions but do in $game_message are:

     $game_message.character = integer (0 => player, >0 => events on map)
     $game_message.char_ref = integer (0 => above, 1 => below, 2=> left, 3=> right)

   These options allow you to position the window in reference to a character on the screen.

   If you want to reset all the values to default, just use the code:

     $game_dlgoptions.reset
     $game_message.clear

To use the Animated Facesets, all you need to do is name the facesets that are animated the same, but with the suffixes _1, _2, etc... Also, note that this script will interpret a face graphic with a $ in front of the name as being single, and will draw the entire file rather than 1/8 of it. This single does not extend to other places - only the message window, so do not use single facefiles for an actor and expect it to be drawn as such in the menu, etc...


Script



NB: If you use Paragraph Formatting, then this script requires the Paragraph Formatter that can be found here: http://rmrk.net/index.php/topic,25129.0.html

Script is too long.
Text document containing the script is attached. I'd recommend the demo so you can see how some of the features work.

Credit



  • modern algebra


Thanks


  • Zeriab! Not only did his instruction make the Paragraph Formatter possible, but his tutorial on Regular Expression made this script possible
  • Seasons In the Abyss - some of his ideas for his RMXP Message Systems were very good, like the name box and various commands of the sort
  • Arrow-1 - several of his ideas, including the animated facesets and the \se code (that was scripted by Zeriab). He also caught a significant bug with mid-message pauses and scrolling. His request gave em the motivation to write the script
  • Irock - His ideas for Text Advancement and Termination sound effects


Support


Post in this topic with any bugs or issues. Also any suggestions. Remember, this script is mostly untested. There are a lot of different combinations of features that may or may not work, I'm not sure. Hopefully, everything works properly though. Since I'm not particularly active at this forum, for the quickest support please post your concerns here. However, I will try to check back here so if you're patient, feel free to post it here.

Known Compatibility Issues


All other Message scripts will not work with this one, aside from aliased replacement codes. In other words, the only message scripts that will work with this one are ones that replace special codes with words. For instance, from default, the \n[y] code replaces itself with the name of Actor y. Message Scripts that alias the convert_special_codes method with codes like that will still work as long as they do not use the same code as one of mine.

Demo


http://www.sendspace.com/file/fb85o9

where do you post this!
woratana
Automaton, Do you mean where to put script?

Just put it above main smile.gif
kami no kitsune
I'm getting a problem with the demo. The pink haired girl throws an error "unable to find Graphics/system/messagebacksmalls"
modern algebra
Yeah, I was testing something out with her for the next version. I forgot to remove it when I released the demo. I also use an outdated code on one of the events in the cabin. Anyway, I'm uploading a new version now with a few minor changes. Namely:

  • Fixed a minor error in the positioning of back sprites.
  • Removed the Graphic not found error that would crash the game if a back sprite did not exist. It now defaults to the previously used back sprite
  • Choice boxes can have multiple columns.
  • Added option to draw the face mirrored.


Anyway, unless people find bugs, I think that is all I am planning to add to this script in terms of features. I guess if anyone has any really cool ideas, suggest them and I will consider adding them, but I think I'm pretty much done with this script smile.gif

I also changed the name of the script to Advanced Text Script as my previous name was rather poorly chosen. Dialogue in programming refers to something else entirely. Since I assume some people are using this already though, I did keep the game object name as $game_dlgoptions because I don't want to force people to go all through their events and change everything. Oh well sad.gif
Nessiah
Is it also possible to be compatible with Neo Message System? Where you can use big facesets?
modern algebra
I'd imagine the two are not compatible, sorry.

That being said, you can use large facesets with this, but they have to fit inside the window, so I'm guessing that it wouldn't be enough for you. The other possibility is to use big facesets as pictures if you still wanted to use this message system, but if that's too much hassle then go with NMS
kami no kitsune
There's the possibility to use this script with the neo face system that can be found somewhere in the forum as a separate script without the neo Message system.
modern algebra
I would suspect that it is also incompatible with that, unfortunately.
Nessiah
I'm sorry *facepalm*
What I mean to say was can the script be modified to use a large faceset not inside the window? or just beside it like the nms does.
wookied00d
lolz... hey modern... nutha errors 4 mez... hahaha...

ok... 'ADS' nomethod yadda yadda.. line 1355 '+' undefined nil class....
happens during battles... test battles, ingame battles... all battles... TT_TT right after battle transition...
it immediatly crashes.... TT__TT its the format text stuff....

CODE
    else
      @text = ""
      $game_message.texts.each { |line|
        @text += line.clone + "\x00"
        if $game_message.scrolling && $game_message.autopause
          # If it will scroll next line and is not the last line
          if (i + 1) % $game_message.shown_lines == 0 && (i + 1) != formatted_text.lines.size
            # Insert command codes for pause and Play SE
            @text += "\x05"  
          end
        end
      }
      convert_special_characters
      @text.gsub! (/\\LB/i) { "" }
    end
modern algebra
Hmmn, that looks like a anasty mistake on my part.

Replace the portion of code you've posted with:

CODE
    else
      @text = ""
      $game_message.texts.each_index { |i|
        line = $game_message.texts[i]
        @text += line.clone + "\x00"
        if $game_message.scrolling && $game_message.autopause
          # If it will scroll next line and is not the last line
          if (i + 1) % $game_message.shown_lines == 0 && (i + 1) != formatted_text.lines.size
            # Insert command codes for pause
            @text += "\x05"  
          end
        end
      }
      convert_special_characters
      @text.gsub! (/\\LB/i) { "" }
    end
PhantomH
I was wondering how you can change the choice box position. It's always at the center of the screen. I tried something like:

$game_message.choicebox_offset_y = 222

But the choice box is still at the center. Is there something I have to do?
modern algebra
Well, yeah, an isolated choice box will always show up at the center. You can do a trick though. Just make a transparent text window above it with nothing in it but a skip pause command \^.

Then you should be able to use offset to position it. Just so you know where offset starts from (so, offset = (0, 0)) - if the text box is high enough, then it is below the window and to the far right (if faceside is true. if faceside is false, then it is to the far left). Also, if the text box is low enough to fit the choicebox on top of it, then it will be on top. That's pretty complicated sounding, but basically, just set up your event like this:

@>Script: <All your settings for this choicebox, including choicebox offset>
@>Text: -,-, Transparent, Bottom
: : \^
@>Show Choices
semajames
Hello everyone.

In my W.I.P, I want to display a text message every time a spell is cast (which can already be done) but I want it to have the portrait of the caster.
Can this script be used to achieve this effect, and if not, can it be implemented into the next version?
modern algebra
No, it cannot. But, I also don't plan on releasing a new version anytime soon.

I'd suggest just using common events for now. It'd require that each caster has an instance of the skill unique to him, and it might look a little awkward, but it's also very easy to do and you don't need to wait for a script.
semajames
QUOTE (modern algebra @ Apr 21 2008, 02:08 AM) *
No, it cannot. But, I also don't plan on releasing a new version anytime soon.

I'd suggest just using common events for now. It'd require that each caster has an instance of the skill unique to him, and it might look a little awkward, but it's also very easy to do and you don't need to wait for a script.


Yeah, I already said I would in my post on "verbal element to spells", if I got desperate. I was just checking if there was an easier way. Thanks anyway.
wookied00d
hmmm you or I may have missed an 'end' command, but I added it (I might have deleted the extra one by mistake) cuz I kept getting error for the last line...
dun't worry, I fix... I not so nubbish anymore....

fck...
Line 1636: nomethod for '[]' for nilclass again...

CODE
      else                              # Normal text character
        contents.draw_text(@contents_x, @contents_y, 40, $game_message.wlh, c)
        c_width = contents.text_size(c).width
        @contents_x += c_width
        @contents_x += @line_spacing[@line_count] if $game_message.justified_text    <<<<< here
        # Unless it is a blank or is being sped through
        unless c == " " || @show_fast || @line_show_fast
          unless @face_sprites.empty?
            @face_count = (@face_count + 1) % $game_message.face_letters
            if @face_count == 0
              @face_sprites[@current_face].visible = false
              @current_face = (@current_face + 1) % @face_sprites.size
              @face_sprites[@current_face].visible = true
            end
          end
          @sound_count = (@sound_count + 1) % $game_message.sound_letters
          if @sound_count == 0
            begin
              $game_message.message_se.play if $game_message.lbl_se
            rescue
            end
          end
          @wait_count += $game_message.letter_frames
        end
      end


all these seem to be centered around the battle system, thats the only time they popup....
modern algebra
AH, I see, try replacing that line with this:

CODE
        @contents_x += @line_spacing[@line_count] unless @line_spacing == nil && $game_message.justified_text


Thanks for catching that error.
SouthWall
I realise that I'm bumping a really old topic, but... I need to.

Is there a way I can make the script ignore the stuff that isolates choices? I'll give an example...



Here, the three choices will appear in the same box because of your script. Now...



You see that each of the three choices follow a conditional branch. However, because they are isolated, the choices aren't in the same box anymore.

How do I put them in the same box? (and, if possible, with the original message as well)
BigEd781
I also have a bug. When you use two or more text commands in a row, the first window does not seem to be disposed. The text from both commands are shown in the same window. I can work around this by putting a wait in between every text command, but even then the window position moves a bit if the window is middle centered.
modern algebra
That's not a bug, it's a feature tongue.gif

Go into the script and find:

SCROLLING = true

and put:

SCROLLING = false

I don't know why the window moves though sad.gif
Also, if you did want SCROLLING on but wanted to get around the appended text boxes, then I would use a comment, not a wait command.
Adrien.
How do you take out the annoying clicking sound or clocking sound it makes when words appear on screen?
modern algebra
Find this:

# When this is true, it will play a sound effect as it is drawing text
LETTER_BY_LETTER_SOUND = true
# The SE played when LETTER_BY_LETTER_SOUND is true
MESSAGE_SE = "Cursor"

Change it to false, or change the SE if you want a different SE to play. There are pretty well no features that I added that cannot be turned off in the Configuration section.
Adrien.
Thank you so much, I mean i love your text feature...hate the noise...LMAO

Also what do you do to slow down the speed at wicih text is displayed?
modern algebra
# How many frames between drawing each letter, in general
LETTER_FRAMES = 1

The higher the number, the slower it will be.

You can also speed or slow down the text in a message with the codes:


# \> - Speeds up the letter by letter process
# \< - Slows down the drawing of the text
postmortem88
OMG I love that Script! Untill now it works without any problems.
Hey modern algebra, is there any possibillitiy to let the letter-by-letter-sound variate between 2-4 different sounds?
I mean randomly, like in some other original RPGs. I think it would be cool and more authentic :-)
modern algebra
Nothing built in to it, but it wouldn't be hard to do it by playing around with the script calls in an event.

Just make a Common Event like this:

CODE
@>Control Variable: [XXX] = Random No. (0...3)
@>Conditional Branch: Variable [XXX] == 0
    @>Script: $game_message.lbl_se = "SE1 Name"
  :Else
    @>Conditional Branch: Variable [XXX] == 1
      @>Script: $game_message.lbl_se = "SE2 Name"
    :Else
      @>Conditional Branch: Variable [XXX] == 2
        @>Script: $game_message.lbl_se = "SE3 Name"
      :Else
        @>Script: $game_message.lbl_se = "SE4 Name"
      :Branch End
    :Branch End
  :Branch End



Then call that common event before every message.
ddescallar
where can i find the "balloon" icons that is used the the command "\bln[target_ID,balloon_ID]" ?

so i will now which ID sets which balloons, or possibly edit those balloons.

nevermind, i found them in the "System" folder tongue.gif

can anyone tell me how the balloons?
Adrien.
I am having an issue that I have never had before using this sytem.

It keeps playing even when i am supose to hit enter.
For example. a line of text will go bye and your suppose to hit enter to continue on with the next line of text instead it plays out this long paragraph of every line, even when i enter the text line by line.

For example:

HI
(enter)
There
(enter)
Whats your name?
(enter)

Each one of those is a line, so it should play "hi" then you have to hit enter to read "there" and so on, instead i get "hi there whats your name?"
which is not what i wanted. i have tried turning off the scrolling, turning every thing tofalse. but nothing works i have never had this issue before. your help is appreciated.

I found the only way it will do the "hi" enter "there" thing is if i add a face, if i add two diffrent faces it will do the "press enter before going to the next line." other words it plays it as one long paragraph..... which is annoying in this case,
modern algebra
You're right - that was an oversight on my part not to include an option not to append text boxes.

Anyway, for now, you can put empty comments between your text commands and they'll work better than changing the faces. I am working on Version 2.0 of this script, and I have already fixed this problem in the new version.
Adrien.
I recently added Cmpsr's script for class change. I am not sure if you are familiar with it or not, but it allows you to change your classes much like FF5,tatics and all that. any ways. when i added them I got this error from ATS V 1.2:

???'ATS V 1.2? 558? Nomethoderror?
undefined method 'defult_X for nil:Nillclass

How do i fix this?
Adrien.
Fixed

modern algebra
Well, that makes it easy tongue.gif

What was the problem, for future reference so I can avoid that in v 2.
Krushnieva
I have an interesting problem.

First of all, I love this script. It works great for the most part.

The problem I'm having is with larger than 4 choices. They scroll just fine, but when you select the first choice of the next selection bracket (i.e. the fifth choice, etc.) it doesn't act as if it was selected, it just ends. Not sure why or what to do about it.
modern algebra
Hmm, that might be a problem with Version 1.2

Try 1.5 for now and see if the problem still occurs: http://rmrk.net/index.php/topic,25348.0.html

Also, I am currently in the process of rewriting this script. So... if the problem's not fixed in 1.5 it will be by v. 2.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.