Two or More Choices


#1

Is it possible to have more than one choice on one page? I know I’ve seen it done, but I’m not sure whether or not it was done through JS or something similar. Like you get two sets of uh boxes that you can tick in and then click next to select both choices at once. No combinations I’ve tried seemed to have done the trick.


#2

I’ve seen it, too, though I don’t know how to do it. Do you mean where you can pick one out of three, then one out of three, then one out of three before finally hitting next and seeing what happens?


#3

I don’t remember where I learned how to do it, so I’m afraid I can only offer my scene file for CoReb Ch 3:

https://dl.dropboxusercontent.com/u/88501596/CoRTest/web/mygame/scenes/platon.txt

The bit (very close to the top) that starts:

    You decide who to send back with Alira, and the orders you'll give them:
    *choice Leader Order
      #Zvad
        #"Watch them, but let them pass unhindered unless you see good reason."
        [etc]

Which will display as two banks of choices – one with “Leader” and one with “Order”. It’s definitely a CS function, not JS.


#4

I think I recall @Reaperoa making an initial post about it way back, but it’s since been documented in full with a proper example on the wiki: http://choicescriptdev.wikia.com/wiki/Choice (under the Multiple Choice heading).


#5

Ah, can’t believe I missed that, I thought I knew the wiki like the backside of my hand by now. Thanks guys!


#7

I learnt this trick from @Reaperoa and you can see it in action in Blackraven (quick start mode).

Here’s the code:

*choice
  #Begin The Game
    *goto prologue
  #Restore Game
    *restore_password
  #Quick Start
    What is your name?
    *input_text name
    What is your surname?
    *input_text surname
    *set handle surname
    Are you male or female, ${name}?
    *choice
      #Male
        *goto looks
      #Female
        *gosub gender
        *label looks
        What are you like?
        *choice appearance alignment
          #Thin
            #Angelic
              *set niceness+2
              *set profile_1 "With a slim physique, people often wonder how you can eat so much without putting on weight.  Personally though, you wish you could add a few pounds."
              *set profile profile_1
              *set profile_1 "skinny"
              *set figure "skinny"
              *set physique 25
              *goto_scene 12cell
            #Good
              *set niceness+1
              *set profile_1 "With a slim physique, people often wonder how you can eat so much without putting on weight.  Personally though, you wish you could add a few pounds."
              *set profile profile_1
              *set profile_1 "skinny"
              *set figure "skinny"
              *set physique 25
              *goto_scene 12cell
            #Just
              *set profile_1 "With a slim physique, people often wonder how you can eat so much without putting on weight.  Personally though, you wish you could add a few pounds."
              *set profile profile_1
              *set profile_1 "skinny" 
              *set figure "skinny"
              *set physique 25
              *goto_scene 12cell
            #Bad
              *set niceness -1
              *set profile_1 "With a slim physique, people often wonder how you can eat so much without putting on weight.  Personally though, you wish you could add a few pounds."
              *set profile profile_1
              *set profile_1 "skinny"
              *set figure "skinny"
              *set physique 25
              *goto_scene 12cell
            #Evil
              *set niceness -2
              *set profile_1 "With a slim physique, people often wonder how you can eat so much without putting on weight.  Personally though, you wish you could add a few pounds."
              *set profile profile_1
              *set profile_1 "skinny"
              *set figure "skinny"
              *set physique 25 
              *goto_scene 12cell
          #Fit
            #Angelic
              *set niceness+2
              *set profile_1 "You have a good upper-body physique and strength to match.  You exercise regularly and eat a healthy balanced diet when you can."
              *set profile profile_1
              *set profile_1 "fit"
              *set figure "fit"
              *goto_scene 12cell
            #Good
              *set niceness+1
              *set profile_1 "You have a good upper-body physique and strength to match.  You exercise regularly and eat a healthy balanced diet when you can."
              *set profile profile_1
              *set profile_1 "fit"
              *set figure "fit"
              *goto_scene 12cell
            #Just
              *set profile_1 "You have a good upper-body physique and strength to match.  You exercise regularly and eat a healthy balanced diet when you can."
              *set profile profile_1
              *set profile_1 "fit"
              *set figure "fit"
              *goto_scene 12cell
            #Bad
              *set niceness -1
              *set profile_1 "You have a good upper-body physique and strength to match.  You exercise regularly and eat a healthy balanced diet when you can."
              *set profile profile_1
              *set profile_1 "fit"
              *set figure "fit"
              *goto_scene 12cell
            #Evil
              *set niceness -2
              *set profile_1 "You have a good upper-body physique and strength to match.  You exercise regularly and eat a healthy balanced diet when you can."
              *set profile profile_1
              *set profile_1 "fit"
              *set figure "fit"
              *goto_scene 12cell
          #Fat
            #Angelic
              *set niceness+2
              *set profile_1 "While not obese, you could definitely benefit from a diet.  However, you do enjoy your food and find diets hard to stick to."
              *set profile profile_1
              *set profile_1 "fat"
              *set figure "fat"
              *set physique 15
              *goto_scene 12cell
            #Good
              *set niceness+1
              *set profile_1 "While not obese, you could definitely benefit from a diet.  However, you do enjoy your food and find diets hard to stick to."
              *set profile profile_1
              *set profile_1 "fat"
              *set figure "fat"
              *set physique 15
              *goto_scene 12cell
            #Just
              *set profile_1 "While not obese, you could definitely benefit from a diet.  However, you do enjoy your food and find diets hard to stick to."
              *set profile profile_1
              *set profile_1 "fat"
              *set figure "fat"
              *set physique 15
              *goto_scene 12cell
            #Bad
              *set niceness -1
              *set profile_1 "While not obese, you could definitely benefit from a diet.  However, you do enjoy your food and find diets hard to stick to."
              *set profile profile_1
              *set profile_1 "fat"
              *set figure "fat"
              *set physique 15
              *goto_scene 12cell
            #Evil
              *set niceness -2
              *set profile_1 "While not obese, you could definitely benefit from a diet.  However, you do enjoy your food and find diets hard to stick to."
              *set profile profile_1
              *set profile_1 "fat"
              *set figure "fat"
              *set physique 15
              *goto_scene 12cell

And now the same thing simplified:

Pick a fruit and a vegetable.
*choice fruit vegetable
  #Apple
    #Carrot
      You like orange and green.
    #Potato
      Pomme de terre?
    #Broccoli
      Your favourite colour is green.
  #Orange
    #Carrot
      Like orange much?
    #Potato
      A funny combination.
    #Broccoli
      Healthy when blended.

#8

Grr found a really annoying thing. Apparently you can’t name the two sub options the same thing (if you do, it will break the dual choice selection), which is extremely annoying since you’re only allowed one word for the choice. Grammatically, that’s pure murder when you’re trying to have one that says hair color and eye color. If I write hair and eyes, it says;

Select a Hair
Select an Eyes

Uuuuuuurgh! And hair-color and eye-color doesn’t work either, which is the only compromise that makes some sense. Hair:Color doesn’t work, but Hair_Color does. It’s just that it looks soooo dumb. It’s not huge but I work hard on my grammar dammit! Quotes doesn’t work either… I guess I’ll settle for calling it Coiffure and Gaze.


#9

I think it’s something of a tag on, it’s not a particularly popular or well supported feature and those are some definite limitations.

If I recall correctly *if (and/or selectable if) don’t work properly with multiple choices either, limiting their usefulness a little bit.


#10

They don’t?? Oh crud… Good thing you told me now. A shame though. There are times when more than one choice at a time can add a lot, it certainly makes for a less frustrating/time consuming character creation process.

Still, I hope that gets fixed, even if not a whole lot of authors have discovered this yet, I see a lot of potential in it, though it is a bit clunky to code, especially having to repeat all those secondary/tertiary etc choices.


#11

So long as the *if you want is simple, it’s possible to nest the *stackedchoices into *ifs, but I’d recommend against it in most cases due to complexity and bloat. For example:

*if early_enough_to_order_breakfast
  *choice meal drink
    #Breakfast Burrito
      #Drinks
    #Burger
      #Drinks
    #Salad
      #Drinks
*else
  *choice meal drink
    #Burger
      #Drinks
    #Salad
      #Drinks

#12

Ah, yeah that would work, but I know what you mean, bloat yeah…


#13

The wiki example uses two words in the choice, but it works? I thought I read that it had to be 1 word?

I want to use this feature, but need to better understand its limitations.

No *if or *selectable_if allowed?


#14

It’s one word per set of choices. Maybe a more direct example would be more helpful? Check out the first choice on Æon Sage and compare it against the code here. You’ll see the first choice has it’s named ‘tag’ at the top (which shows up as “Select a Verbosity” in the game itself), and the #choices are each shown once, followed by the second choice which has a separate ‘tag’ at the top with the #choices duplicated for both of the choices already listed.

*choice Verbosity Difficulty System
  #High
    #Normal
      #Imperial
        *gosub easy_mode_defaults
        *set imperial true
        *finish
      #Metric
        *gosub easy_mode_defaults
        *set metric true
        *finish
    #Hard Mode
      #Imperial
        *set hardmode true
        *set imperial true
        *finish
      #Metric
        *set hardmode true
        *set metric true
        *finish
  #Low
    #Normal
      #Imperial
        *gosub easy_mode_defaults
        *set verbose false
        *set imperial true
        *finish
      #Metric
        *gosub easy_mode_defaults
        *set verbose false
        *set metric true
        *finish
    #Hard Mode
      #Imperial
        *set hardmode true
        *set verbose false
        *set imperial true
        *finish
      #Metric
        *set hardmode true
        *set verbose false
        *set metric true
        *finish

As for *if / *selectable_if, I don’t recall all the details, but I do remember giving up on using an *if in one. IIRC, they just don’t include the option. *If #choices break the game, and *selectable_if #choices are simply rendered as normal #choices.


#15

The wiki appears to use 2 words, don’t they?

*choice Order Sash Emblem
   #Crimson Guard
     #Red Sash
       #Star Cluster
         *finish
       #Crossed Swords
         *finish
     #Purple Sash
       #Star Cluster
         *finish
       #Crossed Swords
         *finish
   #Knights of Centauri
     #Red Sash
       #Star Cluster
         *finish
       #Crossed Swords
         *finish
     #Purple Sash
       #Star Cluster
         *finish
       #Crossed Swords
         *finish

It appears to use 2-word choices, unless I’m misunderstanding something?


#16

Check the ‘Result’ tab of the IDE. You’ll notice that there are three choices there, not two.

Order is either Crimson Guard or Knights of Centauri
Sash is either Red or Purple
Emblem is either Stars or Swords.


#17

Yes, but Purple Sash is two words, not one.


#18

Perhaps it’s confusing because of the choice of words? Here, let’s try this (Notes are listed in [Brackets] on each line, see the bottom of the post for the actual notes):

*choice number letter [1]
  #One is chosen [2]
    #A is chosen [3]
      1A [4]
    #B is chosen 
      1B
  #Two is chosen [5]
    #A is chosen [6]
      2A
    #B is chosen
      2B

[1] This is where we tell ChoiceScript this choice will have multiple series. For each series of choices we need a single word descriptor which will be put above the series as “Select a(n) Foo” Each series has to have exactly one word describing it here (underscores can be used, but they will also show up in game).
[2] This is the first choice of the first series of choices on the page. It’s indented the same way as a normal #choice and works the same as usual (meaning it can be multiple words).
[3] This is the first choice of the second series, and comes directly after the first choice of the first series of choices. It also works like normal (meaning it can contain multiple words). The only thing to note is it’s indented an twice beyond the original *choice to indicate that it’s part of the second series of choices.
[4] This is what plays when the first two choices are selected, as it’s under them directly.
[5] This is the second choice of the first series. It’s indented the same amount as the first choice of the same series.
[6] This is the first choice of the second series, and it has to be exactly copied from the line above where it’s under the first choice of the first series.

The single word restriction is only about the actual *choice line. Hopefully that (and the edits to the wiki) clear up any confusion.


#19

@Lucid
If I’m getting you: You can make a choice “option” as long as you like (unrestricted as normal), it’s the names of each choice/selection (e.g. 'Choose a {one-word-option}) bit in which you can only use one word (because they’re separated by spaces):

*choice word1 word2 word3

Just an elucidation on what Reaperoa said about it being the *choice line we’re talking about!


#20

I think I have it figured out now. Hmmm, I’m not sure if it’s as useful as I had hoped. Thanks @Reaperoa and @CJW


#21

Is there a way to turn off the words? Select a X

It would be more useful to use our own words.