Common Commands Sidebar extension

You can change the commands–each group of commands is a string, and the margin is a separate window so you don’t need to indent them individually. I don’t know how to do that with a table, but I’m open to suggestions.

Edit: Now I think I misunderstood you…you mean change the commands as the story progresses by amending a table? For instance, if a new action becomes available? It doesn’t do that.

This looks really nice. I’d love to have a look at the code.

Nice! Is there a way to toggle it on and off as an optional help feature?

Yes, you can start with it either on or off, and toggle it during play.

Absolutely I do, I have a 10yo who has an interest in IF which I am cultivating, so would love to see the code and test it out.

I’ve incorporated the suggestions I’ve gotten so far. If anyone else wants to look it over or test it and give feedback, please feel free.

Known issues: extra line breaks when the sidebar is visible, the cursor being invisible in Gargoyle when the sidebar text is white.

If you want to test it, you’ll need these extensions.

(Edit: Deleted the file as it’s no longer current.)

Post an example game so people can try it.

Can you make commands clickable?

Reviewing the code:

[code]Table of User Styles (continued)
window (a g-window) color (a text)
sidebar “#ffffff” [Set the sidebar text color to white]

When play begins (This is the Sidebar Background Default Color Rule):
if the background color of the sidebar is empty:
now the background color of the sidebar is “#2c3c49”.[/code]

It appears that the user would need to use two different means to set text colour and background colour at design time (in I7 source) or at run time. You could provide a phrase to set both at run time.

[code]To say LB:
say line break.

To say PB:
say paragraph break.[/code]
These names LB, PB are too short. They could easily conflict with user code or another extension - do you want to test every other extension?

Direction_commands is some text that varies. Direction_commands is usually "[fixed letter spacing]     N[LB]  NW   NE[LB]W    *    E[LB]  SW   SE[LB]	    S[variable letter spacing][PB]In/Out[LB]Up (U)/Down (D)[LB]".	

It would be better to compose individual commands (e.g. put commands in a table) - that way each extension that adds/removes a command could update the list automatically.

Does the sidebar display a more prompt if it would overflow the screen? (Does the sidebar open running in Inform 7?)
I think interpreters would do that for a text window. You can play IF with a paragraph view of say 5 lines on a small e-reader device (also, how can a screenreader access it?) - the sidebar should be accessible e.g. printable in the main window as a text dump.

There are translations of the IF postcard; you could use one as a crib to prototype a translated sidebar - how easy would it be for a user to make a translated sidebar? What about making a translated extension e.g. is it easy to make a French Common Commands Sidebar extension?

Most people prefer to read on mobile phones and handheld devices in portrait (1:2 like a book - not landscape 2:1 like a computer screen) - a “sidebar” at the top/bottom would be suitable.

What interpreters have been tested? Does it work in Quixe and Parchment?

Thanks for your suggestions! Reading your questions, I’m not sure if you meant them to be rhetorical or if you want me to answer them here.

Regarding this

Do you mean that if another extension says, for instance, “Understand nothing as taking inventory” or “Understand taking inventory as something new,” Common Commands Sidebar would automatically remove “inventory” from the sidebar? And if another extension says

Listing available exits is an action out of world. Understand "exits" as listing available exits.
then “Exits” would automatically appear on the sidebar?

For anyone who plays IF on a mobile phone: I’d be curious to know what amount of space (i.e. how many lines) would be acceptable to be used by a separate window for commands at the top or bottom.

I’ll need to investigate this some more. As it is, some interpreters are showing it with a scrollbar and some aren’t.

I think he means something like this.

In your extension:

Table of Common Commands
action    name
taking inventory    "inventory"
examining    "look at"
looking    "look around"

Then in someone’s story file, they could alter it…

Table of Common Commands (amended)
action    name
looking    "description"

…or expand it.

Table of Common Commands (continued)
action    name
frotzing    "frotz"
blorbing    "blorb"
rezroving    "rezrov"

Hmm. Maybe there could be a default table with a single column–just the strings, with one command (generally) per row–or story authors could opt to create their own, copying and pasting from a template. That way they could add commands where they wanted them pretty easily. That would also make it relatively easy to cut and paste entire chunks of commands to move them around.

Draconis has it. You may be able to list actions (and test existence) in Inform 6 but there are many actions - only a few are the common ones which should be picked to be listed.

For a table of common commands, the sidebar extension needs to know what category (directions, people, meta) to put a new command in - that could be another table column (or one table per category).

The questions aren’t rhetorical except: do you want to test every other extension?

I don’t want to put you off - if a game uses the sidebar and the IF postcard I think it can provide for most players. But remember to test it on players!

Right. So I was confused by this part, because I wasn’t sure where the “automatically” came in:

But looking at the code Draconis posted, I’m not sure what the benefit is to having a column for the action itself as well as a column for the string that will appear in the sidebar.

So you’re wanting to keep the ability to rearrange the categories without touching the commands themselves, then (as opposed to copying and pasting the commands into the order wanted in a single-column table). I can see how that would be easier for an author who doesn’t want to change any of the commands, but it seems like it’d be more complicated for authors who wanted to change the commands in multiple categories. Either they’d need to change/continue multiple tables, or they’d be changing the commands all in one table, but the order of categories in that table wouldn’t necessarily correspond to the order they are displayed in the sidebar, which doesn’t seem very intuitive. And then there’s the question of making sure there’s one command per hyperlink number. Hmm. I will think on this.

As for your questions:

Right now you can’t, but it looks like it’d be a relatively simple option to add for authors who want it.

Yes, but at the moment only some interpreters show a scroll bar and allow you to see the overflow. I don’t know if this is something the story author can control or if it’s dependent on the player’s interpreter settings.

The sidebar does open in the IDE.

There’d have to be an option to print the commands in the main window. Though it seems like maybe it’d be annoying to listen to the whole list at once.

You’d be writing a new list of commands. If I went with the single-column-table-handles-everything idea, you’d be putting the new commands, in order, in quotation marks, something like this:

Table of Commands Commands "Command 1" "Command 2" "Command 3"

I don’t know what the usual way is to go about translating an extension, but I’m happy to do what I can to make it easier, if anyone can point me to some guidelines or suggestions.

I’ve tested it in Gluxe, Gargoyle, and Quixe. With Quixe I’m assuming the CSS sylesheet will need to be customized in order to show the text in a custom color. I haven’t tried Parchment yet.

I’ll see what I can do about posting a sample game.

I use an iPod Touch. If the sidebar is supposed to elliminate my need for typing entirely - being that I can doubletap any word onscreen to add it to the command line - I can forego about 2/3 of the screen, which is pretty much the amount of space usually taken up by the keyboard anyway.

I’ve barely skimmed this thread, so apologies if I’m about to be redundant, but for mobile use I’d really appreciate it if this sidebar were toggleable. Sometimes I want to type more freely, sometimes I want all shortcuts I can get. There isn’t a fixed method, because if I’m playing on a mobile I can play anywhere, any time, in various frames of mind, and with more or less ease in typing.

If it helps, here are a couple of screenies (showing some formatting bugs here and there) I’ve shared with the developer of iFrotz in bug reports. … 0&inline=1 … 0&inline=1 … 8&inline=1

The size of the font is customizable, and I’m still bugging him to push it up one extra notch. It’s almost perfectly comfortable - but not quite; it’s still just slightly uncomfortable.

Well, the sidebar won’t show every possible command, just some of the most common ones. Even with hyperlinks, it probably wouldn’t eliminate the need for typing entirely.

With that in mind, how much of the screen would you be ok with it using?

Thanks for the links, but I was not able to follow them.

Actually, come to think about it for more than a couple of seconds, my input won’t help.

Pretty much all the commands in your nifty sidebar are already covered in a nice toggleable overlay that iFrotz supports by default, very similar to the one Zarf uses in his iOS games.

So you don’t have to worry about the iOS terp at all, it wouldn’t benefit from your extension.

As far as mobile goes, my only experience is with an older phone running ZaxMidlet. I wouldn’t want a sidebar THERE either because the screen was small enough already! But that’s not the sort of phone people are using nowadays anyway.

So… er… I wasn’t any help at all. Sorry.

EDIT - If a game were to make use of it, I would be willing to forego 2/3 of the screen, as I said, though I’d be switching between the keyboard and the sidebar. It’d get old in a hurry, and anyway, iFrotz has a beautiful autocomplete, so I’d probably not be toggling the sidebar on at all.

Actually, this is very helpful, if it means I don’t need to worry about figuring out how to make the commands line up nicely in windows on the top or bottom of the screen, and I can just leave left and right as the only options.

(I’ve never played IF on any kind of mobile device, so I don’t know what other interpreters people might be using for that, if any.)

I agree that a single column table is simpler. I couldn’t get a test action column to work (except as stored action).
Table amendment can only change a second column, not the first. But it could be convenient to use an auxiliary table for amendments.

In the quote,

I mean that, from the perspective of the author, if I add an extension e.g. Inform ATTACK (which defines an important action e.g. CONCENTRATE), do I need to do something to make CONCENTRATE appear in the sidebar or will Inform ATTACK do that (add CONCENTRATE etc. to the table) automatically - and likewise for removing an extension and removing its action.

Thank you for answering my questions.

Here’s a minimal demo using the sidebar that you can play online in Quixe or download and run in an interpreter: … ple-game-1

I’m still working on the hyperlinks, so this sample doesn’t currently show any.

Also, I’ve now tried Parchment and it does not display the sidebar. (But it doesn’t display the status bar either, so perhaps that’s to be expected.)

Seeking opinions: what would be a good typed command to use for toggling the sidebar on and off, and a good one for printing/listing the commands in the main window? Or toggling could also be two separate actions, “sidebar off” and “sidebar on” for instance.

At the moment it’s “commands” for toggling the sidebar and “list commands” for listing them in the main window but I’m not sure if that’s what players would think to type.

I like “sidebar on” and “sidebar off” and just plain “sidebar” to toggle (as in “actions/actions on/actions off”). And why not put that in the sidebar itself?