RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] ATS: Choice Options 1.0.0

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
ATS: Choice Options
Version: 1.0.0
Author: modern algebra
Date: 27 January 2013

Version History


  • <Version 1.0.0> 2013.01.27 - Original Release

Description


This script improves your control over the choice box by permitting more than four choices in a box, each of which you can disable or remove contingent on the value of any given switch. Additionally, it also allows you to extend the length of the choice beyond the editor's spacial limitations, allowing you to have long choices, and it adds an option for a help window to assist in describing the choices. Aside from that dynamic control over choice branches, you are also permitted to set the number of columns in the choice box, its size, and its position. There are other more minor features as well, which you can learn about in the instructions.

Features

  • More than four choices!
  • Hide or disable choices based on switch value
  • Can set size and position of choice box
  • Can set number of columns
  • Multi-line and long choices
  • Help window to assist player in decision

If you are looking for other features from my VX script of the same name, then see some of the other scripts in the ATS series.

Screenshots



Instructions

Paste the script into its own slot in the Script Editor, above Main but below Materials.

See the header for instructions on configuration and use.

Script


Retrieve it from Pastebin.

Credit


  • modern algebra

Support


Please post in this topic at RMRK.net if you have any questions, suggestions, error reports, or comments about this script. It is perfectly fine to post here even if this topic has not been posted in for a very long time.

Please do not message me privately, as any concerns you have are likely shared by others and they will benefit from our correspondence being public. Additionally, I am occasionally absent, and posting publically will allow other members to assist you when I am unable to do so quickly.

Known Compatibility Issues

I am currently unaware of any compatibility issues.

Demo


See attached.

Terms of Use


I adopt RMRK's default Terms of Use.
« Last Edit: September 05, 2016, 10:37:47 PM by modern algebra »

**
Rep: +0/-0Level 55
RMRK Junior
Append choices looks very useful! Would there be any way to work something like that where it auto adds a 'next' choice to the bottom and spreads things out throughout several choice windows? Or a scrolling amount of choices that can fit any number?
I've been on the hunt for some script like that for ages, its annoying how it seems impossible to do this sort of thing. Basically my situation is that I have an idea for being able to access a 'Talk' menu with important NPCs and then it fills up with topics of conversation as you progress in the game. But this is impossible to do since I can't have around 30 variable-locked choices and make them appear together in a natural way. Without choice appending I'd have to set them out in groups of 7 or so with a 'next' option, which is just gonna look ridiculous if you've unlocked one choice in group one and six in group two, so on. (It's be like "Choice 1, Next" *tiny window* "Choice 7, Choice 8, Choice 9.." *giant window*) And then with appending I have no clue how I'd be able to manage if you have too many choices to all show on the screen at once, since if it mashes them all together I have no idea where to put the Next choice. (If I put it as every eighth choice and you haven't unlocked any of the first 16 then you'll get "Next, Next, Choice 17", if I put it right at the end then noone will see it unless they only have seven unlocked..)
It's way more complicated than it should be! XD

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, there is no feature where it auto-adds a next line, but it certainly will do the scrolling window which can fit any number of choices, and with switch-conditioned choices it will also allow you to enable the entries in whatever order you want. As well, you can set the size, so the window might be only able to fit four choices at a time (if that is the size you choose), but when the player scrolls down the other choices are available. You wouldn't have to have any "Nexts" at all.

**
Rep: +0/-0Level 55
RMRK Junior
That is badass and I now love you forever. FINALLY, A SOLUTION!! *dance* And one better than my hypothetical, lol!
Scrolling choices are a godsend. *prays at the mighty algebra's feet* Once again I'm throwing out piles of jury rigged lesser scripts to make way for your latest ATS.. how DO you keep being so amazing??

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, I'm pleased that you like it!

**
Rep:
Level 57
RMRK Junior
I tried your script and I am really pleased to be able to put long choices in my game!  :tpg:


I would like to know if it's possible to make a separation line/space or something like this ?


That the choices seem more distinct from one another.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Hmm, well that would require quite an adjustment to the script. If I were to take the request, I would essentially do it as a separate script, though one that is, of course compatible with this one. It would be fun to play with tones to change the colour of the windowskins for selection.

However, I can't see myself taking this request in the near future however. I'm sorry.

**
Rep:
Level 57
RMRK Junior
It's okay, you already did a good jo with your scripts.
Thanks to you my dialogues are appearing smothly in my game. 8)

pokeball YinOfflineFemale
**
Rep:
Level 86
Choice options gives me an error whenever I try to display a message with a face:

---------------------------
Demon's Revenge Ace
---------------------------
RGSSError occurred!
File: Internal Scripts/002 - Message Stuff/010 - MA - ATS - Choice Options.rb
Line: 541
Method: initialize
Message: failed to create bitmap

Trace:
File 'Internal Scripts/002 - Message Stuff/010 - MA - ATS - Choice Options.rb' line 541 (Method new)
File 'Internal Scripts/002 - Message Stuff/010 - MA - ATS - Choice Options.rb' line 541 (Method mapf_calc_line_width)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 895 (Block in calc_window_size_by_text)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 893 (Method each)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 893 (Method calc_window_size_by_text)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 880 (Method set_text)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 820 (Method update)
File 'Internal Scripts/002 - Message Stuff/007 - MA - ATS - Message Options.rb' line 972 (Method update_all_windows)
Script 'Window_Message' line 69 (Method update)
Script 'Scene_Base' line 95 (Block in update_all_windows)
Script 'Scene_Base' line 93 (Method each)
Script 'Scene_Base' line 93 (Method update_all_windows)
Script 'Scene_Base' line 49 (Method update_basic)
Script 'Scene_Base' line 41 (Method update)
File 'Internal Scripts/004 - Gameplay Enhancements/039 - SES - Dynamic Time.rb' line 511 (Method update)
Script 'Scene_Map' line 61 (Method update)
File 'Internal Scripts/003 - Added Functionality/015 - Cutscene Skipper.rb' line 151 (Method update)
Script 'Scene_Base' line 14 (Method main)
File 'Internal Scripts/004 - Gameplay Enhancements/040 - MOG - Weather EX.rb' line 652 (Method main)
Script 'SceneManager' line 23 (Method run)
Script 'Main' line 7 (Block in <main>)
Script 'Main' line 7 (In <main>)
File 'Error Parser.rb' line 307 (Method eval)
File 'Error Parser.rb' line 307 (In <main>)
Script 'Inserter' line 756 (Method eval)
Script 'Inserter' line 756 (In <main>)

---------------------------
OK   
---------------------------

Line 547 is:
self.contents = Bitmap.new(contents_width, 24)

Does this happen for anyone else or is it a compatibility issue?

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
What happens if you change

Code: [Select]
self.contents = Bitmap.new(contents_width, 24)

to

Code: [Select]
self.contents = Bitmap.new(24, 24)
&&&&&&&&&&&&&&&&

pokeball YinOfflineFemale
**
Rep:
Level 86
That did the trick :) Thanks!

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
If you wouldn't mind, I would like to see a demo with that error recreated. It doesn't happen when I test, and the only reason it should happen is if a window's width is less than even its padding, which really ought to have caused an error earlier than that point in the script. Put more plainly, I'm confused, and I would like to make sure it isn't a flaw in the script itself.

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Did I do bad?
&&&&&&&&&&&&&&&&

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
No, that fixes the problem and there is no reason for the bitmap to be larger than that. It is probably the most efficent way since it avoids creating a large bitmap and I probably should have done it that way in the first place.

However, I'm still worried about it since Window_Base's create_contents method also uses contents_width to determine the width of a bitmap. If contents_width is returning a number less than 0, then the error may repeat itself at other places in the game.

pokeball YinOfflineFemale
**
Rep:
Level 86
I didn't really try it in a barebones project with just ATS, I just was checking to see if it was a real bug before I did that. I don't know if it happens without the rest of my scripts (I'm using an external text script by SES, Text control script by Victor Sant and the rest of the ATS series, which could be the only things (to my knowledge) messing with the message window to cause this error). I'll try it and see if it happens though.

Edit:
I tested it using only ATS scripts and it works fine. It must have been an incompatibility problem.
« Last Edit: July 14, 2013, 07:42:55 PM by Yin »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Thanks for testing it out for me Yin!

**
Rep: +0/-0Level 55
RMRK Junior
Is it not possible for us to make the choices blend together with the message window like the VX one?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Not yet. I suppose it wouldn't be terribly hard to add though.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Hmm, I have a minor feature request ... might the ability to disable a choice using evaluated code (with a boolean value) be added to the script? I certainly could use a switch, but I hate using a switch when a code snippet is easier (ie- 'DataManager.save_file_exists?', and so on).
« Last Edit: August 03, 2013, 09:25:08 PM by Exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep:
Level 73
RMRK Junior
Hmm, I have a minor feature request ... might the ability to disable a choice using evaluated code (with a boolean value) be added to the script? I certainly could use a switch, but I hate using a switch when a code snippet is easier (ie- 'DataManager.save_file_exists?', and so on).

just want to share

Spoiler for:
Code: [Select]
raise "Need MA's ATS: Choice Option" unless($imported||={})[:ATS_ChoiceOptions]
#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - atsco_interpret_command_402
#==============================================================================
class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Append Choice
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def atsco_interpret_command_402(params, index)
    # Accomodate for incorrect configuration of choice_format
    $game_message.choice_format = "" unless $game_message.choice_format.is_a?(String)
    $game_message.choice_format += '%s' unless $game_message.choice_format[/%s/]
    # Choice Plus
    plus_text, help_text = atsco_process_choice_comment(index + 1)
    choice_name = sprintf($game_message.choice_format, @list[index].parameters[1] + plus_text)
    del = false
    # Switch Conditions
    choice_name.gsub!(/\\S(!?)\[\s*(\d+)\s*\]/i) {
      # Set to delete if any condition not met
      cond = $game_switches[$2.to_i]
      del = true if $1.empty? ? !cond : cond
      "" }
    choice_name.gsub!(/\\S#(!?)\{\s*(.+?)\s*\}/i)  {
      cond = eval($2) rescue false
      del = true if $1.empty? ? !cond : cond
      "" }
    if del # If deleting
      @list[index].parameters[0] = -1
      # If cancel branch after this option
      if params[1] > params[0].size && params[1] < 1000
        params[1] -= 1 # Reduce ID of cancel
        params[1] = 0 if params[1] == params[0].size # If this was cancel, disable
      end
    else
      # Set index
      @list[index].parameters[0] = params[0].size
      # Add to choice array
      params[0].push(choice_name)
      # Add to Help Window
      $game_message.choice_help_texts.push(help_text)
    end
    return params, index
  end
end

#==============================================================================
# ** Window_ChoiceList
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - maatsco_choice_enabled?
#==============================================================================

class Window_ChoiceList
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Choice Enabled?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method :drg_atsco_choice_enabled, :maatsco_choice_enabled?
  def maatsco_choice_enabled?(index)
    name = command_name(index)
    enabled = drg_atsco_choice_enabled(index)
    name.gsub!(/\e[Dd]#(!?)\{\s*(.+?)\s*\}/i) {
      cond = $game_map.interpreter.send(:eval,$2) rescue false
      enabled = false if $1.empty? ? cond : !cond
      "" }
    enabled
  end
end

to use it :

\s#{ get_character(0).x > 3}
\s#!{ $game_party.members.size > 0 }
\d#{ FileTest.file?('Save003.rvdata2') }
\d#!{ $game_self_switches[[@map_id,@event_id,'A']] }

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Oh, hey, thank you very much! :)

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

pokeball CJFOffline
*
Rep: +0/-0Level 40
RMRK Junior
First off, I just wanted to say thanks for making such a wonderful script that really adds a ton of value to VXA.

So far the scripts have worked awesomely, except for one thing. I've tried to change the number of lines for the Help Window. Changing the value within the Editable Region works, but using a script in game has no effect. I've tried;

ats_next(:choice_help_win_lines, 4)
and
ats_all(:choice_help_win_lines, 4)

And it has no effect on the number of lines in the Help Window. Any help would be appreciated. Thanks!
« Last Edit: May 15, 2014, 10:21:13 PM by CJF »

**
Rep: +0/-0Level 35
RMRK Junior
I'm using this script with the default settings (I have changed nothing in the script) and am getting this error when I call a certain common event (it seems to be working fine everywhere else I've used it):

Script 'Appended Choices' line 457: NoMethodError occurred.

undefined method `push' for nil:NilClass

The weird thing is, If I call another event that uses appended choices first, this one works fine afterwards.

This is the offending event (I have stripped out all other code and the error still occurs.)

DrunkDorks.com (us)
Facebook.com/DrunkDorks (us)
Twitter.com/OrihimeWarlock (me)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Hi, it's strange that happens, since that variable should be assigned an array as soon as a new game starts. It may be that you are loading an old save game from before you installed the script.

In any event, you should be able to fix it by pasting the following code into a script call before the choice branch:

Code: [Select]
$game_message.choice_help_texts = []

If it's not from an old save file, then it may be an incompatibility with another script.

*
Rep: +0/-0Level 30
RMRK Junior
I have one question, it is possible with that script to break line of text of choice option?
If not, anyone knows some way to do that?

Att,

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
I'm not sure what you mean. Sorry.

**
Rep: +0/-0Level 72
RMRK Junior
Is there any way to have the Help text aligned in the center? Not sure how the codes would apply there.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Just add the following after the 'Choice Options' script, then set the 'choice_help_align_text' value to 1.

EDIT : See my next post.
« Last Edit: August 09, 2015, 10:20:19 PM by exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 72
RMRK Junior
Thanks for the quick reply. I've tested it and it seems to work partially, as the text does shift based on the value I use in the module.

I've attached an image that shows the result of what happens when I choose the "Right" alignment. The "Center" alignment moves slightly to the left. And the "Left" alignment moves all the way left. Doesn't seem to be using the entire width of the window to determine the alignment.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Hmm, I guess I tried to get too fancy. The following should work :

EDIT: Code updated to include an option for a help window dimmed background.

Code: [Select]
#==============================================================================
# ** Game_ATS
#==============================================================================

class Game_ATS
 
  CONFIG[:ats_choice_options].merge!(  {
    #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    #  EDITABLE REGION
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #  :choice_help_align_text
    #   ├ (value) 0 - Left Align
    #   ├ (value) 1 - Center Align
    #   └ (value) 2 - Right Align
    choice_help_align_text: 0,
    #  :choice_help_dim_bg
    #   ├ (value) true  - Display Dim Background
    #   └ (value) false - Display Windowskin
    choice_help_dim_bg: false,
    #  :choice_help_dim_bg_color1
    #   └ (value) Color Object - Color used in background gradient
    choice_help_dim_bg_color1: Color.new(0, 0, 0, 160),
    #  :choice_help_dim_bg_color2
    #   └ (value) Color Object - Color used in background gradient
    choice_help_dim_bg_color2: Color.new(0, 0, 0, 0),
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #  END EDITABLE REGION
    #////////////////////////////////////////////////////////////////////////
  }   )
 
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  CONFIG[:ats_choice_options].keys.each { |key| attr_accessor key }
 
end # Game_ATS



#==============================================================================
# ** Game_Message
#==============================================================================

class Game_Message

  Game_ATS::CONFIG[:ats_choice_options].keys.each { |key| attr_accessor key }

end # Game_Message



#==============================================================================
# ** Window_ChoiceHelp
#==============================================================================

class Window_ChoiceHelp < Window_Base
 
  #--------------------------------------------------------------------------
  # * NEW - Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 2)
    super(0, 0, Graphics.width, fitting_height(line_number))
   
    create_back_bitmap
    create_back_sprite
  end
 
  #--------------------------------------------------------------------------
  # * SUPER - Free
  #--------------------------------------------------------------------------
  def dispose
    dispose_back_bitmap
    dispose_back_sprite
   
    super
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    update_back_sprite
    update_text_alignment
   
    if text != @text
      @text  = text
      refresh
    end
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
 
  #--------------------------------------------------------------------------
  # * SUPER - Hide Window
  #--------------------------------------------------------------------------
  def hide
    @back_sprite.visible = false
   
    super
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Create Background Bitmap
  #--------------------------------------------------------------------------
  def create_back_bitmap
    @back_bitmap = Bitmap.new(width, height)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    $game_message.choice_help_dim_bg_color1
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    $game_message.choice_help_dim_bg_color2
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Create Background Sprite
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.z = z - 1
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Update Background Sprite
  #--------------------------------------------------------------------------
  def update_back_sprite
    @back_sprite.visible = $game_message.choice_help_dim_bg
    @back_sprite.x = x
    @back_sprite.y = y
    @back_sprite.opacity = openness
    @back_sprite.update
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Update Text Alignment
  #--------------------------------------------------------------------------
  def update_text_alignment
    @align = $game_message.choice_help_align_text
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Free Background Bitmap
  #--------------------------------------------------------------------------
  def dispose_back_bitmap
    @back_bitmap.dispose
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Free Background Sprite
  #--------------------------------------------------------------------------
  def dispose_back_sprite
    @back_sprite.dispose
  end

  #--------------------------------------------------------------------------
  # * SUPER - Draw Text with Control Characters
  #--------------------------------------------------------------------------
  def draw_text_ex(x, y, text, *args, &block)
    if @align != 0
      text = convert_escape_characters(text)
      @max_text_width = text_size(text).width
    end

    super(x, y, text, *args, &block)
  end
 
  #--------------------------------------------------------------------------
  # * SUPER - Normal Character Processing
  #--------------------------------------------------------------------------
  def process_normal_character(c, pos, *args, &block)
    if @align != 0
      text_width = text_size(c).width
   
      case @align
        when 1
          draw_text(((width / 2) - (@max_text_width / 2)) - pos[:x], pos[:y], text_width * 2, pos[:height], c)
        when 2
          draw_text((contents.width - @max_text_width) - pos[:x], pos[:y], text_width * 2, pos[:height], c)
      end
       
      pos[:x] -= text_width

    else
      super(c, pos, *args, &block)
    end
     
  end
 
end # Window_ChoiceHelp



#==============================================================================
# ** Window_ChoiceList
#==============================================================================

class Window_ChoiceList
 
  #--------------------------------------------------------------------------
  # * ALIAS - Object Initialization
  #--------------------------------------------------------------------------
  unless method_defined?(:choice_XYJpWTIZ_wcl_initialize)
    alias_method(:choice_XYJpWTIZ_wcl_initialize, :initialize)
  end
 
  def initialize(*args, &block)
    choice_XYJpWTIZ_wcl_initialize(*args, &block)

    create_help_window
  end
 
  #--------------------------------------------------------------------------
  # * ALIAS - Start
  #--------------------------------------------------------------------------
  unless method_defined?(:choice_s23eH7xd_wcl_start)
    alias_method(:choice_s23eH7xd_wcl_start, :start)
  end
 
  def start(*args, &block)
    update_background
   
    choice_s23eH7xd_wcl_start(*args, &block)
  end
 
  #--------------------------------------------------------------------------
  # * SUPER - Free
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_all_windows
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Free All Windows
  #--------------------------------------------------------------------------
  def dispose_all_windows
    self.help_window.dispose
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Update Window Background
  #--------------------------------------------------------------------------
  def update_background
    @background = $game_message.choice_help_dim_bg
    self.help_window.opacity = @background ? 0 : 255
  end
 
  #--------------------------------------------------------------------------
  # * NEW - Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    lines = $game_message.choice_help_win_lines
    self.help_window = Window_ChoiceHelp.new(lines > 0 ? lines : 1)
    help_window.z = self.z
    help_window.hide
  end
 
  #--------------------------------------------------------------------------
  # * OVERWRITE - Update Help Window
  #--------------------------------------------------------------------------
  def update_help
    if index >= 0 && $game_message.choice_help_texts[index].is_a?(String)
      @help_window.set_text($game_message.choice_help_texts[index])
    else
      help_window.clear
    end
  end
 
end # Window_ChoiceList
« Last Edit: August 10, 2015, 10:19:19 PM by exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 72
RMRK Junior
Nailed it. Thank you very very much. This adds a little bit of polish to the help window for sure.

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Is there a way to have the help window appear with a dim background, instead of using the windowskin? :)

Thanks again! I love dis script~ ;o;
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Updated the above code to include a dim background option.  o:

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Ahhhhh! That's awesome! :gracie: Thank you, Exhydra!!

Just one little thing I noticed...the text codes (such as \c[1] and stuff) don't seem to work when I added it. o.o They worked before, though... Did I break it? ;~;
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Mm, where at? In the choice window or help window?  o:

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Mm, where at? In the choice window or help window?  o:

I had a text code set up to make the font change color in the help window, and it stopped working when I added the add-on. ;_; That's really weird... :o

Spoiler for Nerdy Screenshot:

« Last Edit: August 09, 2015, 11:14:04 PM by yuyu! »
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Aah, yeah, the new alignment option is not playing well with text codes. I'll have to fiddle with it.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Aah, yeah, the new alignment option is not playing well with text codes. I'll have to fiddle with it.

Huh... That does make more sense... o.o

Thank you again for that neat little scriptlet and all of your patience and help! ^_^
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Updated the script to parse the text codes while retaining the alignment. Not perfect, and kind of ugly ... but it works.
« Last Edit: August 10, 2015, 10:22:59 PM by exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
It works!! Thank you so much, exhydra! ^_^
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


***
Rep:
Level 82
We learn by living...
Concerning this script, I was wondering if there was a way to swap the location of the questions and answers?

Currently, when I use it, my questions appear on the bottom, and the answers appear on the top right of the question.

Is there a way so that my questions appear on the top of the screen, and the answers appear below the questions and to the left?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Most Mature Member2011 Favourite Staff Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Sorry for the delay. Yes, you can change the position of the text box by selecting "Top" or "Middle" when writing your message. If you need more positioning options for the message box, you can try my ATS: Message Options.

With respect to the position of the choice box, that is controlled by the settings described in the portion of the script at lines 116-140:

Code: [Select]
    #  :choice_win_x - This controls the horizontal position of the choice
    # window. It can be set to either :L, :R, :C, or an integer. If an integer,
    # then it is set directly to that x-coordinate. If :L, it is flush with the
    # left side of the message window. If :C, it is in the centre of the
    # message window. If :R, it is flush with the right side of the message
    # window.
    choice_win_x:           :R,
    #  :choice_win_x_offset - This is the number of pixels offset when
    # :choice_win_x is set to :L or :R. When :L, it is added. When :R, it is
    # subtracted.
    choice_win_x_offset:    0,
    #  :choice_win_y - This controls the vertical position of the choice window.
    # It can be set to either :T, :B, or an integer. If an integer, then it is
    # set directly to that y-coordinate. If :T, it is flush with the top of the
    # message window. If :B, it is flush with the bottom of the message window.
    choice_win_y:           :T,
    #  :choice_win_y_offset - This is the number of pixels offset when
    # :choice_win_y is set to :T or :B. When :T, it is added. When :B, it is
    # subtracted.
    choice_win_y_offset:    0,