intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 15, 2018 7:49 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Nov 05, 2018 4:21 pm 
Offline

Joined: Tue Jan 09, 2018 5:14 am
Posts: 2
Hi folks! Is it possible to create IF with Inform 7 that uses a multiple choice interface to send corresponding text to the parser? If so, are there examples of this approach? If not, do any authoring systems with a complex world model support this approach? Thanks, --da'ud vyd


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 12:58 am 
Offline

Joined: Thu Dec 14, 2017 11:31 am
Posts: 12
Yes, but I think it might be kind of awkward.

Here's a very simple example:

Code:
"1-3" by Me

This is the handle numbers rule:
   if the player's command matches "[number]":      
      if the number understood is 1:
         change the text of the player's command to "north";
      otherwise if the number understood is 2:
         change the text of the player's command to "south";
      otherwise if the number understood is 3:
         change the text of the player's command to "quit";
      otherwise:
         say "Number out of range." instead;
   otherwise:
      say "Numbers only, please." instead.

The handle numbers rule is listed first in the after reading a command rulebook.

Middle is a room.
Top is north of middle.
Bottom is south of middle.
      
When play begins:
   now the command prompt is "1=N, 2=S, 3=Q > ".

You could change the rule to work with a table of values and commands, and "say" the options instead of sticking them in the prompt.

The Questions extension by Michael Callaghan works sort of along these lines.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 4:53 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5839
You can also look at the source code for Bigger Than You Think. https://eblong.com/zarf/zweb/btyt/btyt-src.html

This supports both keyword and link input. You could fairly easily add a check for a typed number -- well, maybe you'll need some I6 for that.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 4:59 am 
Offline

Joined: Tue Jan 09, 2018 5:14 am
Posts: 2
Thank you.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 11:59 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2806
Location: US - Central
There is also an extension called "Hybrid Choices" which lets you switch back and forth between parser and choices - or just remain in choice mode if you like.

I don't remember if it's in the Library in the Inform IDE, but it's also here:
http://inform7.com/extensions/AW%20Frey ... index.html

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group