Write [text] with [something] on [something]

Hey all–

Is this possible? I tried several permutations of this, but Inform doesn’t like an action applying to one topic and two things. It likes 2 things, or one topic and one thing, but it yells about this. I couldn’t find anything in the docs.

I don’t need to do this, but I’m thinking about that pesky player who starts with “write BOOYA with pencil on paper” instead of just “write BOOYA” or “write BOOYA with pencil” or “write BOOYA on paper.”

Any way to implement this?

1 Like

There are some extensions that allow you to get three-object actions into Inform, but personally I wouldn’t mess around with them unless you have to – I’d just do something like

Understand “write [text] on [thing] with pen/pencil/blood” as a mistake (“Just WRITE TEXT ON THING”).

3 Likes

No, not directly, but I can imagine ways to do it with regular expressions in After reading the command rules.

For instance, you could require the text be in quotes: WRITE 'frotz' WITH BURIN ON CUBE and then your regex could extract the ‘frotz’, put it in a global variable and then rewrite the player’s input to be WRITE WITH BURIN ON CUBE.

3 Likes

A simple solution!

I’m always getting stuck on implementing elaborate commands that aren’t strictly necessary but that I know someone will try. And I worry that will be a new player and they’ll hate parsers forever if I don’t implement every possible way to say something, and, and…

Yes, that’s the sound of OCD you’re hearing. Maybe I’ll just default to this suggestion more often, if my brain will allow it.

4 Likes

That’s exactly what the Understand .... as a mistake... phrase was designed to deal with… :slightly_smiling_face:

2 Likes

Yeah, actions can’t have more than two parameters (two things, a text and a thing, etc), but “understand as a mistake” can have as many as you want! This makes them useful for catching excessively elaborate commands. You can even understand “write [text] on [thing] with [text]” as a mistake, if you want to catch literally anything they put after it.

2 Likes

Third Noun by Daniel Stelzer lets one handle a third noun for real.

2 Likes

I thought that too, but when I just tested it I got a compiler error - maybe I was doing something wrong though, wouldn’t be the first time!

1 Like

It worked like a charm for me.

It hurts me to redirect a player instead of just implementing the thing. Which is a ridiculous mindset because you can’t implement all the things. But I’ll sure try anyway, I guess because I’m nuts.

5 Likes

Eeeeeek. This brings back the most stressful of memories. But hey, just remember to get all ways of saying it down!

>WRITE WITH X ON Y
>WRITE TXT ON Y WITH X
>WRITE TXT WITH X ON Y
>WRITE ON Y WITH X

and then you need "about"...

>WRITE ABOUT TXT ON Y WITH X
>WRITE ABOUT TXT WITH X ON Y
>WRITE WITH X ABOUT TXT ON Y
>WRITE ON Y ABOUT TXT WITH X
>WRITE WITH X ON Y ABOUT TXT
>WRITE ON Y WITH X ABOUT TXT

Phew! I think that’s it. :joy:

1 Like

The is a legitimate and laudable concern.

Think of it this way. What if you did implement every possible way to phrase every command? That wouldn’t get your players to love parser games, just your parser games. They would then turn around and play other games only to be disappointed at how “dumb” their parsers are. It would be better for them in the long run to gently suggest a phrasing that is not only easier for you to handle, but more likely to be used in other parser games. It would be more of a “Hey, this game is smart enough to get what you’re trying to say, but that’s not how we usually do things in this neck of the woods. Try phrasing it like this.”

Of course, you could always do both. You could use a three noun solution (such as Daniel’s or the ones that have been offered up on this forum in the past) and then give the player a warning that your game understands this sort of complex phrase, but that it’s nonstandard. Of course if you do this, you would also have to allow the two-noun only version to work as well. Experienced players will likely only try those.

2 Likes

I’m not sure if this was once true, but it doesn’t seem to be now- for either Ver 9.3/6M62 or 10.