Assorted Inform 7 questions

I am sorry for being grumpy (and maybe underestimating the search engine) yesterday, and I had planned to edit my post to apologise. But I did mean “non-general topic titles are helpful”: in other words (in order of increasing grumpiness) “specific titles are helpful”, “non-specific titles are unhelpful”, and “general titles are unhelpful”. I like Ask Ryan, though, and can’t work out whether it’s an exception, or specific in its own way!

Oh, I see what you mean now…yes this will not be the best-keyworded topic.

Still, I feel like I would be spamming the board if I start a new topic for each question. Hopefully this is a short and sweet project on my part.

1 Like

I’ve managed to solve this with

After reading a command: if the player’s command matches “get up”,
replace the player’s command with “stand.”

1 Like

But if you do, you can be in my club! I have a general rule: “no more than one coding question on the forum per day.” I tell myself that this makes me less annoying. But actually that rule is useful, because it forces me to solve things that I’d otherwise have asked a question about.

1 Like

This is true, but I feel like a longer explanation is needed.

You can do this:

Understand "get up" as standing.

This compiles, but it doesn’t work. Unfortunately the new definition of “get up” winds up with a lower precedence than the Standard Rules definition of “get up”, so it never triggers.

Replacing pieces of the player’s command is often a clunky and/or buggy approach. In this case, though, it’s simple and I don’t see anything that’s likely to go wrong.

It is possible to solve this without doing that. You have to start with

Understand the command "get" as something new.

…and then re-create every grammar line that involves “get” except “get up”.

Understand the command "get" as something new.

Understand "get up" as standing.
Understand "get in/on" as entering.
Understand "get out/off/down" as exiting.
Understand "get [things]" as taking.
Understand "get in/into/on/onto [something]" as entering.
Understand "get off/down [something]" as getting off.
Understand "get [things inside] from [something]" as removing it from.

This is a lot of Understand lines, but it does what you want.

2 Likes

Thank you for the heads up @zarf. I’ve taken that into consideration and now realize that I only actually need to override the default meaning of “get up” when the player is lying down. Hopefully this does not cause further conflicts, we will see.

After reading a command: if the player’s command matches “get up” and the player is prone, replace the player’s command with “stand.”

Two extensions you might find of interest are Emily Short’s Modified Exit and Postures.

2 Likes

Thank you! I need to tightly control player options because of the way scoring works in my game, but those look otherwise useful.