Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Maximum number of characters in the Show Choices option?

Totum

Member

Hi!
I was wondering if it is possible to adjust the maximum number of characters in the "Show Choices" option. I find the choices too short to make interesting answers.
 
im sure you can, but tracing out the code i didnt see how :(
[rgss]#--------------------------------------------------------------------------
  # * Setup Choices
  #--------------------------------------------------------------------------
  def setup_choices(parameters)
    # Set choice item count to choice_max
    $game_temp.choice_max = parameters[0].size
    # Set choice to message_text
    for text in parameters[0]
      $game_temp.message_text += text + "\n"
    end
    # Set cancel processing
    $game_temp.choice_cancel_type = parameters[1]
    # Set callback
    current_indent = @list[@index].indent
    $game_temp.choice_proc = Proc.new { |n| @branch[current_indent] = n }
  end
[/rgss]
i hope someone can help you, i hate when i find something in rgss i cant do
 
The limitation is in the interface, not the scripts.

Here's a cheesy way around it...

Script: $game_variables[100] = \
"A choice longer than 23 characters"
Script: $game_variables[101] = \
"Another choice longer than 23 characters"
Show Choices: \v[100], \v[101]
 
Yeh, Ruby is really sloppy versatile with it's variables... :scruff:

TCL, the language in which I usually program is even worse. ALL variables are strings. procs have to cast them to other types to do calculations, etc...

Probably the right way to do this would be a module or array of Game_Strings.
Which would lend itself nicely to Localization (releasing your game in multiple languages)

But, this way works nicely for limited application.
 

Totum

Member

Brewmeister":iq2uthn5 said:
The limitation is in the interface, not the scripts.

Here's a cheesy way around it...

Script: $game_variables[100] = \
"A choice longer than 23 characters"
Script: $game_variables[101] = \
"Another choice longer than 23 characters"
Show Choices: \v[100], \v[101]

Thanks for your reactions! I'm quite new to scripting in RMXP, so I hope you will forgive me if I ask where I should put this piece of code. And what to do with the variables...
It would be great if I could use longer answers because I would like to make a monkey island kind of game in which dialogues are important!
 
Script:

Is referring to the "call script" event command.

\v[100], \v[101]

Is what you put instead of your choice.

So for example, where you may previously have done:

Show choices: "Yes", "No"

Instead do:

Call Script: $game_variables[100] = \
"This is to go where the word yes is in the previous text"
Call Script: $game_variables[101] = \
"This is a lengthy message that replaces the word no in the above"
Show Choices: "\v[100]", "\v[101]"

Basically, \v 
 

Totum

Member

@Amy Pond
Great, it works now! Many thanks! BUT there still is, as Brewmeister mentioned, a problem with the interface: with two answers the show choices option still lets you choose between the 'first line' and the 'second line' while the text of my second answer only starts on the third line...
A solution might be to use a smaller font? Any other ideas?
 
If there's anything on the 3rd line, that means you have an un-escaped linefeed in your script..

Code:
Call Script: $game_variables[100] = \

"This is to go where the word yes is \

in the previous text"

Call Script: $game_variables[101] = \

"This is a lengthy message that \

replaces the word no in the above"

Show Choices: "\v[100]", "\v[101]"

make sure no spaces after the backslashes

Now the problem is, the text is so long it runs off the end of the window.
This could be solved with a smaller (or narrower) font, making sure you don't overextend the window, or making the message window wider.
 

Totum

Member

Hm... there is still a problem. I think I used the code as you said but it still looks like this:
Textbox%20problem.jpg
 
You have other custom scripts? If so, try this in a new project. It works fine for me.

You're absolutely, positively, beyond a shadow of doubt.... that there are no spaces after the backslashes???
 

Totum

Member

Brewmeister":3aqyqf5y said:
You have other custom scripts? If so, try this in a new project. It works fine for me.

You're absolutely, positively, beyond a shadow of doubt.... that there are no spaces after the backslashes???

I am sure there are no spaces after the backslashes :) And although I use a custom script (XAS_Hero_3_82), a test with a new project didn't work either.
I find this rather puzzling! I hope I just made a stupid mistake.
Does this look right to you? (it's without the backslashes because they didn't make a difference)
Textbox%20problem2.jpg
 
You're missing the backslashes after the words, "yes" and "that".

The backslash escapes (ignores) the next character after the backslash. If the backslash is the last character in the line, then next character is the linefeed/return/Enter character. this is the character you want to ignore.

You want to use these 2 statements

$game_variables[100] = "This is to go where the word yes is in the previous text"
$game_variables[101] = "This is a lengthy message that replaces the word no in the above"

but you have to spread them out over 3 lines.

$game_variables[100] = \
"This is to go where the word yes \
is in the previous text"
$game_variables[101] = \
"This is a lengthy message that \
replaces the word no in the above"
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top