Creating a list of usable commands

Hey All-
I’ve been asked by several play testers to add a VERBS command to my game. Since it uses non-standard verbs (emotions) for nearly every action you can take, it would be nice to have an updating list of what you can do. I can’t add them all at the beginning, since I don’t want the player to know what they are before they learn them in the game.

I’ve managed to get this working:

Understand the command "verbs" as something new. Understand "verbs" as verbsing. Verbsing is an action out of world applying to nothing.

The verblist is a list of text that varies.
Verblist is initially {"examine[line break]look[line break]"}.

Carry out verbsing: say verblist.

When the player learns the command for the new verb (fear), I have this line:
add {"Fear[line break]"} to verblist
And this works fine except for the “and” it sticks in there, which I can’t figure out how to remove:

> **verbs**
examine
look
and Fear

I have tried a couple of things to get rid of the “and”. Like:

Replace {"and"} in verblist with {""} 
Rule for deciding whether verblist contains the text {"and"}: it does not.

And multiple variations on those- none of which work. And I’ve spent hours trying to find something in the Documentation, but searching for a way to get rid of an automatic thing like this… can’t find it. Can someone show me the correct syntax?

The “and” comes up from the depths of the I6 template code involved in saying a list of values. While it’s possible to alter that behaviour by replacing the relevant I6 routine, it’s probably easier to forego the automatic list-formatting and doing it ourselves:

The verblist is a list of texts that varyies.
The verblist is initially { "examine", "look" }.

Carry out verbsing: say the verb-list-hint.

To say the verb-list-hint:
    say "These are some verbs you may want to try at this time:";
    repeat with V running through verblist:
        say "[line break][V]";
    say paragraph break.

(Edit: everything just works so much better when you actually substitute the value!)

2 Likes

Thanks- this is a great idea. Since I had to add each verb to the list anyway as players went along, it’s not too taxing to just change the verb-list-hint with each new action learned.
Much appreciated.

Whoo- I just can’t get this to work. It’s the first time I’ve programmed something like this. I read the chapter on this in the documentation, and futzed around with this bit of code for about an hour, and couldn’t get it to work. It never would add anything to the list, or it would just replace everything with “fear” and not add anything new. I went through way too many iterations of it to post any here.
Right now I think players just need to write things down if they want lists.

1 Like

There are a couple small typos here – try this (with example of how to add something to the list):

Test chamber is a room.

Before jumping for the first time:
	add "jump" to the verblist.

The verblist is a list of texts that varies.
The verblist is initially { "examine", "look" }.

Verbsing is an action applying to nothing.  Understand "verbs" as verbsing.

Carry out verbsing: say the verb-list-hint.

To say the verb-list-hint:
	say "These are some verbs you may want to try at this time:";
	repeat with V running through verblist:
		say "[line break][V]";
	say paragraph break.

Duh. [smacks forehead]… I thought that line looked weird when I posted it. Sorry about that!

1 Like

I figured out the [V] typo myself (pats own back), but was missing the “add to verblist” because that had caused the “and” problem earlier, so I was avoiding it like the plague. This works beautifully, although I confess I’m not sure why I’m getting the right result without the “and.” I guess I’ll tinker with it until I understand its anatomy.

Thanks to both of you!

2 Likes

The built-in code (“say verblist”) turns the verblist into text with commas and “and”. This code uses a custom command “say the verb-list-hint” (though “command” is probably not the proper Inform 7 term?) and that command uses “repeat with V running through verblist” to say each verb individually and doesn’t invoke the built-in “say” command for lists at all.

Does that help?

1 Like