How do I take HINT

So I am working on my latest game, and the player can ask for help if they have never played an IF game before, so in my code I have for example: (how do I add code snippets and what does Preformatted Text mean? How do I add tabs in my code sections?)

Include Basic Help Menu by Emily Short.

The lab is a room.  The description of the lab is "You are in a lab.  If you have never played an IF game before, type 'HELP' to get a big menu by Emily Short.  If you just want a specific hint about how to get out of a room or solve a puzzle, type 'HINT'."

Hinting is an action applying to nothing.  Understand "hint" as hinting.

Check hinting:
     say "To get out of the lab, type 'xyzzy' and then press the green button.";
     stop the action.

So if the player types HELP they get Emily Short’s menu. But if they type HINT they also get Emily Short’s menu. That’s because she has a line of code in the extension that must say something like:

Understand "help", "hint,", "info", "about" as asking for help.

This is the asking for help rule:
     [Display the menu and all options.];
     [Return to the game when the player exits help.], etc;

So how do I take HINT out of Emily Short’s understand statement so I can make it separate from her help menu?

Also, is there any way to see the source code of someone else’s extension after you include it? How would you modify it?

And how do I add code snippets when I have a coding question and what does Preformatted Text mean? What does the button </> mean and did I do it right? How do I add tabs in my coding sections?

1 Like

It isn’t necessary to edit the extension. All you need to do is tell Inform 7 that the command means something else.

understand the command "hint" as something new.

In the windows IDE, you would select the “file” drop down from top left, then select “open installed extension.” In my opinion editing the extension is not ideal (though reading it is usually useful), there is often a way to make changes in your own project.

Inform out of the box does not really have page layout options. Here’s what I use for tabs (I got this from @Zed I believe).

You can tweak the number of spaces to get what you’re looking for.

To say tab:
	say "[fixed letter spacing]   [variable letter spacing]"

Where are you seeing this? I’m not sure what this is.

2 Likes

addendum: before you get too far into this, you may want to investigate Wade Clarke’s extensions instead, since they were designed with screen reader support in mind.

1 Like

Drew’s substantive answers are all right on! The preformatted text thing is how you can format code nicely when posting it on the forum. You can either highlight the code and then click the </> button (it might be under the gear button depending on layout/theme), or put three backticks above and below the code.

3 Likes

I thought he was clicking the code block around what was supposed to be code, but our default text is different; it’s

type or paste code here

I see you were entering

 `preformatted text`

before and after your code. You’ve almost got it, just put three backticks ``` on a single line before and after your code like this.
Screenshot 2024-09-14 at 12.33.41 PM

Understand "help", "hint,", "info", "about" as asking for help.

This is the asking for help rule:
     [Display the menu and all options.];
     [Return to the game when the player exits help.], etc;

You can also monospace inline like this with a single backtick ` before and after the formatting.

You can also `monospace inline` like this.
2 Likes