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. 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.
Spoiler for List of 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 \x[n] - Sets the x position for drawing directly to n. \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..b), string ("string")
Spoiler for List of 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
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 with any bugs or issues. 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 launch them at me. 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 also, in the demo and attached to this post, 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.
Samples:
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.[/list]