How to I give a hint to the player about the proper syntax?

Hi again.

I have a combining function in the mould of the example “What makes you Tick”.

I’d like to be able to help players make things, which leads to the question…

If a person writes “make bicycle” (or whatever) I want to show them the “right” way to do it.

I have…

Making is an action applying to a thing.

Understand “make [something]” as making.

Instead of making:
say “try combining etc…”

My ultimate goal is to give this hint, even if the thing they are trying to make is not an object in the game, basically an all-encompassing “try combining etc” help statement.

1 Like
Making is an action applying to one topic.
Understand "make [text]" as making.

The [text] token will match any words at all.

If you also want to accept the input MAKE with no words, add the line:

Understand "make" as making.
2 Likes

Thank you very much. So simple. For the life of me, I couldn’t get a search right to find that. I tried lots of things and learned stuff along the way so not all was lost.

I wonder if, along the same lines, this construction is good. It works but maybe I’m not seeing something that will cause a problem along the way.

Understand "disassemble [something]" as disassembling. Disassembling is an action applying to one carried thing.

instead of disassembling hooked line:
	say "you take the hooked line apart.";
	now the hooked line is in limbo;
	move the string to the player;
	move the wire hook to the player.
1 Like

The built-in ‘syntax hinting’ phrase is ‘Understand “otherwise-unrecognised-grammar-line” as a mistake (“hint text”)’.

In this case:

Understand "Make" or "Make [text]" as a mistake ("Try combining etc...")

See Documentation 17.21

3 Likes

Thank you for the reference.

I appreciate it.