Changing 'show a menu' styling or display in front-end?

Hi. I'm creating a gamebook style game with text adventure in quest and really hoping you guys get the questjs compiler or version 6.0 going sometime in the future!!

I've recently removed the numbered styling from show a menu so that it doesn't show 1,2,3, etc for the response options via someone's guide.. But now I want to create more space between each line for the menu options. I don't want all the text of the game to have more space, just more space between the menu's selections. Anyone got any hints how to hard code that into quest? Thanks in advance.


"Show me your, and I'll show you mine"...
or, just add a blank msg(" ") between response options...

msg("Response #1")
msg(" ")
msg("Response #2")
msg(" ")
msg("Response #3")
Like this???


well here was my code,

ShowMenu ("Are you ready?", Split ("Let's Go;Wait I have questions", ";"), false) {
if (result= "Let's Go") {
MoveObject (player, page_3)
}
else {
MoveObject (player, page_2_morequestions)
}

I simply changed it to this,

ShowMenu ("Are you ready?", Split ("Let's Go; ;Wait I have questions", ";"), false) {
if (result= "Let's Go") {
MoveObject (player, page_3)
}
else {
MoveObject (player, page_2_morequestions)
}

I added a ' ; ; ' in between the first two questions. I didn't think it was that easy but it worked. It of course turns that line in between the two answers into a clickable answer but it's hard to press. My goal was to hard code this into the main code of the game so that it does this every time I use 'show a menu' because if I have to do this for hundreds of options in the future with the game it will become tedious. The reasoning behind this is if I port this into a cell phone game one day, it would be hard to select the correct answer with your finger.


and now I'm getting more complicated but I figure I'll ask..

Is it possible to use show a menu and give the hyperlink answers presented to the player but have a NEXT button that acts like a confirm your answer button? So basically the user selects their hyperlink answer, it becomes highlighted and then they have to select NEXT to confirm it!?


aaaaa
aaaaaaaaaaaaa

I can't help you with your most recent post, the code/quest experts will have to help you with that...


You might want to look into List Attribute and/or Dictionary Attribute usage also...


if the built-in 'show menu' (popup window) and/or the 'ShowMenu' (in-line) Functions aren't the design you want, than create your own menu Functions

for example

// this creates a numbered menu (just so you can see how to manually create your own, instead of using the built-in menu Functions):

<function name="custom_menu_function" parameters="prompt_string_parameter, stringlist_attribute_parameter">
  ClearScreen
  msg (prompt_string_parameter)
  numbering_integer_variable = 0
  foreach (string_variable, stringlist_attribute_parameter) {
    numbering_integer_variable = numbering_integer_variable + 1
    msg (numbering_integer_variable + ". " + string_variable)
  }
  get input {
    if (IsInt (result) and ToInt (result) > 0 and ToInt (result) <= ListCount (stringlist_attribute_parameter)) {
      selected_choice_string_variable = StringListItem (stringlist_attribute_parameter, ToInt (result) - 1)
      // do whatever you want with 'selected_choice_string_variable'
    } else {
      custom_menu_function (prompt_string_parameter, stringlist_attribute_parameter)
    }
  }
</function>

we can alter (more or less arguments/parameters and etc stuff) this Function for whatever you need (it's just a simple example Function), as well as create a Function that uses Dictionary Attributes instead of List Attributes


as for line spaces...

we can again create our own Function for what we want, an example:

(there's probably a more simple/direct way to do: carriage returns / line breaks / empty lines, rather than using my 'msg("")' method, but whatever)

<function name="custom_carriage_return_function" parameters="integer_parameter">
  if (IsInt (integer_parameter)) {
    for (not_used_variable, 1, integer_parameter) {
      msg("")
    }
  }
</function

we can then apply this carriage return function into our menu function:

<function name="custom_menu_function" parameters="prompt_string_parameter, stringlist_attribute_parameter, carriage_return_integer_parameter">
  ClearScreen
  msg (prompt_string_parameter)
  msg("(Type in the number of your choice)")
  numbering_integer_variable = 0
  foreach (string_variable, stringlist_attribute_parameter) {
    numbering_integer_variable = numbering_integer_variable + 1
    msg (numbering_integer_variable + ". " + string_variable)
    if (numbering_integer_variable < ListCount (stringlist_attribute_parameter)) {
      custom_carriage_return_function (carriage_return_integer_parameter)
    }
  }
  get input {
    if (IsInt (result) and ToInt (result) > 0 and ToInt (result) <= ListCount (stringlist_attribute_parameter)) {
      selected_choice_string_variable = StringListItem (stringlist_attribute_parameter, ToInt (result) - 1)
      // do whatever you want with 'selected_choice_string_variable'
    } else {
      custom_menu_function (prompt_string_parameter, stringlist_attribute_parameter, carriage_return_integer_parameter)
    }
  }
</function>

lastly, for hyperlinking a custom menu, you just need to concatenate your menu items displayment as Commands (see text processor commands: http://docs.textadventures.co.uk/quest/text_processor.html ) ... not easy to get the syntax correct ... see Pixie's 'level lib' library file and/or look into his 'combat v?' library file which I'm pretty sure you can find the 'level lib' code used within/for it.

Since you're using hyperlinks, you need to remove the 'get input' code, as you're not using and thus not needing it, as it'll mess up stuff if you don't remove it.

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums