如何将任意文本处理为“名词”在通知7?

发布于 2024-08-31 21:21:59 字数 991 浏览 3 评论 0原文

在 Inform 中,我希望能够创建一个新操作,并让它能够处理任意文本。

我可以轻松创建一个适用于现有事物的新操作。

Finding is an action with past participle found, applying to one thing.
Understand "Find [something]" as finding.
Carry out finding:
say "You find [the noun]."

但这仅适用于游戏世界中存在的物品。例如,如果我尝试“查找 fdsljk”,它将失败,因为我还没有创建“fdsljk”。

我希望能够“找到 fdsljk”,然后能够获取额外的文本并用它进行响应......类似于“你找到了 fdsljk”。

我想类似的东西

A foo is a kind of value.
Finding is an action with past participle found, applying to one foo.
Understand "Find [something]" as finding.
Carry out finding:
    say "You find [the foo]."

可能很接近......但它不起作用。我收到一条错误,内容如下:

你写了“说“你找到[the foo]。””,特别是“the foo”:但这要求说一些不能说的东西,或者更确切地说,不能打印的东西。尽管当您使用复杂的文本替换时可能会出现此问题,这些文本替换根据所使用的值的种类而以不同的形式出现,但更常见的是,这意味着您尝试使用替换值(例如,在“说”表盘上显示“ [V]."') 之类的无法打印出来。 例如,如果 V 是一个数字或一段文本,则没有问题:但如果 V 是一个解析主题,比如表的“主题”列中的条目,那么就会出现此问题将会出现。

斜体是我的,突出了关键......我认为这应该是可行的,但我走错了路。线索?

In Inform, I'd like to be able to create a new action, and have it be able to work on aribitrary text.

I can easily create a new action that will work on existing things.

Finding is an action with past participle found, applying to one thing.
Understand "Find [something]" as finding.
Carry out finding:
say "You find [the noun]."

But this only works on items that exist within the game world. If I try to "find fdsljk", for instance, it will fail because I haven't created a "fdsljk".

I'd like to be able to "find fdsljk" and then be able to grab that extra text and respond with it...something like "You find the fdsljk."

I was thinking that something like

A foo is a kind of value.
Finding is an action with past participle found, applying to one foo.
Understand "Find [something]" as finding.
Carry out finding:
    say "You find [the foo]."

might be close...but it doesn't work. I get an error that reads:

You wrote 'say "You find [the foo]."' , and in particular 'the foo': but this asked to say something of a kind which can't be said, or rather, printed. Although this problem can arise when you use complicated text substitutions which come in variant forms depending on the kinds of value used, far more often what this means is just that you tried to use a substituted value (e.g., in 'say "The dial reads [V]."') of a kind which could not be printed out. For instance, if V is a number or a piece of text, there is no problem: but if V is a parsing topic, say an entry in a 'topic' column of a table, then this problem will arise.

The italics are mine, and highlight the key...I think this should be doable, but I'm taking the wrong path. Clues?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

真心难拥有 2024-09-07 21:21:59

再次声明,我对 Inform 7 的体验仅限于您之前的问题;-)...我想您需要一些 [text] 而不是游戏中的 [thing ]

Finding is an action applying to one topic.
Understand "Find [text]" as finding.
Carry out finding:
    say "You find [the topic understood]."

Again with the disclaimer that my experience of Inform 7 is limited to your previous question ;-)... I guess you'd need some [text] rather than an in-game [thing]?

Finding is an action applying to one topic.
Understand "Find [text]" as finding.
Carry out finding:
    say "You find [the topic understood]."
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文