intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 7:22 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Apr 05, 2009 8:32 pm 
Offline

Joined: Thu Apr 02, 2009 8:50 pm
Posts: 6
Hi guys! Another quick question, if anyone can help:

I'm making use of Emily Short's menu system, and am making a Setting Options section. Using the code sample in Inform 7's documentation, I added the Notify Mode for notifying the player of score changes, and thought, another setting that could be useful is having the Verbose mode turn on or off. (I usually prefer to have it on, myself)

This is how my Table of Setting Options looks:

Code:
Table of Setting Options
title   subtable   description   toggle
"[if notify mode is on]Score notification is on[otherwise]Score notification is off[end if]"   --   --   switch notification status rule
"[if verbose mode is on]Verbose is on[otherwise]Verbose is off[end if]"   --   --   switch verbose mode status rule



I tried copying the score notification, but changing the wording:

Code:
To decide whether verbose mode is on:
   (- verbose_mode -) ;

This is the switch verbose mode status rule:
   if verbose mode is on, try switching brief mode on;
   otherwise try switching verbose mode on.



I'm not sure what the correct wording for handling verbose and brief modes is. This brings up these errors:

Code:
Problem. You wrote 'if verbose mode is on, try switching verbose mode off'  : but this is not an action I recognise, or else is malformed in a way I can't see how to untangle.

Problem. You wrote 'otherwise try switching verbose mode on'  : again, this is not an action I recognise.


Any advice would help :)


Top
 Profile Send private message  
 
PostPosted: Mon Apr 06, 2009 3:20 am 
Offline

Joined: Sun Feb 17, 2008 3:51 pm
Posts: 256
Hi there,

First of all, there are three settings for this: brief (the standard mode), verbose, and superbrief (which never shows descriptions). The current setting is stored in an i6 global variable called "lookmode". This isn't discussed in the main documentation, but can be discovered by searching the template document (appendix B on the website). I6 variables are (basically) all numbers, so I've created a new kind of value to make it easier to read. (1, 2 and 3 are automatically converted to standard, verbose and superbrief.) There are also three actions used to switch this setting which can be located in the actions index under "Actions which happen out of world." Try adding this code to your example:
Code:
Table of Setting Options (continued)
title   subtable   description   toggle
"Room descriptions are currently set to [current-lookmode]."   --   --   toggle lookmode rule

Lookmode is a kind of value. The lookmodes are standard, verbose and superbrief.

The current-lookmode is a lookmode that varies.
The current-lookmode variable translates into I6 as "lookmode".

This is the toggle lookmode rule:
   if the current-lookmode is:
      -- standard: try preferring unabbreviated room descriptions;
      -- verbose: try preferring abbreviated room descriptions;
      -- superbrief: try preferring sometimes abbreviated room descriptions.
Note that the tabs might get screwed up when you copy and paste from this board, so you might have to fiddle with it a bit. I've tried it on my end and it works. You can test it by adding these rooms:
Code:
The Lab is a room. "This is the description of the Lab." The player is in the Lab.
The Back Room is north of the Lab. "This is a description of the Back Room."
Hope that helps!

EDIT: The tabs do get messed up. As long as you replace the "<tab>" in the following code with an actual tab stop, you should be okay.
Code:
This is the toggle lookmode rule:
<tab>if the current-lookmode is:
<tab><tab>-- standard: try preferring unabbreviated room descriptions;
<tab><tab>-- verbose: try preferring abbreviated room descriptions;
<tab><tab>-- superbrief: try preferring sometimes abbreviated room descriptions.

_________________
Skinny Mike


Top
 Profile Send private message  
 
PostPosted: Mon Apr 06, 2009 5:10 am 
Offline

Joined: Thu Apr 02, 2009 8:50 pm
Posts: 6
The people on this forum are so helpful, it's great! I don't think I would have worked that out on my own, so thanks. My story is coming along quite nicely now. I'll have to go and check out that Appendix B template document, and see what other stuff is in there.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 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