Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Been playing around with the multiple choice commands.  They seem to work quite well and save a lot of faffing around with booleans and integers!  Choices-within-choices also nice and straightforward :)

(I probably have a few too many 'dones' in this code snippet - a result of not having the time to ascertain exactly where one was missing!  The following does work as it's supposed to, though.)

: match "talk server"  {
      : if (is_at "food_van") {
         : if (!menu_examined) {
            : print "'WHAT YOU WANT? LOOK AT MENU.'" ;
            : done ;
         }
         : if (menu_examined) {
            : add_choice "ICE CREAM"  {
               : print "'SILVER COIN PLEASE.'" ;
               : if (is_carried "silver_coin") {
                  : add_choice "Y"  {
                     : print "'HERE'S YOUR ICE CREAM. THANKS!'" ;
                     : create "ice_cream" target = "inventory" ;
                     : destroy {
                     entity = silver_coin
                     }
                     : success ;
                     : done ;
                  }
                  : add_choice "N"  {
                     : print "MAYBE ANOTHER TIME..." ;
                     : done ;
                  }
                  : choose "GIVE SILVER COIN?" ;
                  : done ;
               }
               : done ;
            }
            : add_choice "POPCORN"  {
               : print "'GOLD COIN PLEASE.'" ;
               : if (is_carried "gold_coin") {
                  : add_choice "Y"  {
                     : print "'HERE'S YOUR POPCORN. THANKS!'" ;
                     : create "popcorn" target = "inventory" ;
                     : destroy {
                     entity = gold_coin
                     }
                     : success ;
                     : done ;
                  }
                  : add_choice "N"  {
                     : print "MAYBE ANOTHER TIME..." ;
                     : done ;
                  }
                  : choose "GIVE GOLD COIN?" ;
                  : done ;
               }
               : done ;
            }
            : add_choice "HOT DOG"  {
               : print "'PLATINUM COIN PLEASE.'" ;          
               : done ;
            }
            : choose "WHAT YOU WANT?" ;
            : done ;
         }
         : done ;
      }
   }
(2 edits)

By the way, is there a way of displaying multiple choices on the same line?  The event list in my coach advice system in 'Goblin Decathlon' is a bit too long for the screen when using standard TWO font, so I originally doubled the options per line and coloured the numbers within the paragraph like so:

: ask_int {
   var      = coach_advice
   question = ADVICE FOR WHICH EVENT?\n<1.<#6b5>> 100 METRES <2.<#6b5>> LONG JUMP\n<3.<#6b5>> SHOTPUT <4.<#6b5>> HIGH JUMP\n<5.<#6b5>> 400 METRES <6.<#6b5>> HURDLES\n<7.<#6b5>> DISCUS <8.<#6b5>> POLE VAULT\n<9.<#6b5>> JAVELIN <10.<#6b5>> 1500 METRES
   min      = 1
   max      = 10
   }

It's not really an issue as the integer system also works fine (and the list fits fine when using a smaller/different font) - just wondering!

Yeh, was thinking about putting in a columns setting, let me see what I can do.

Hi Dee,

I added the following option to : choose;

: choose "Choose your destiny." experimental_columns = "3" ;

This should allow you to display more information horizontally.

Update Adventuron again if you want to make use of this.

Chris

Thanks!  Will have a go later on.

Really happy to see you using them. I'll see if I can improve the choices UI later too.