1

假设我有一个不同的文本,其中包含“大厅”。

现在假设我的故事中有一个房间a,叫做“大厅”。

有没有办法基于此将一个人(让我们称她为 Laura)移动到大厅?

我正在寻找的是这样的:

Let place be the room called "[the room name]".

或者,如果Anna是一个人:

Now Anna is in the room called "[the room name]".

当然,一定有类似的东西。但我找不到它。

长期目标是将人和地点的名称存储在文本文件中,然后将它们恢复为对事物的引用。

4

1 回答 1

4

I got an answer on an interactive fiction forum. I'm posting it here for documentation purposes:

Rooms and other objects are referenced internally by pointers rather than by name. If you really need to do that, you'd have to use a construction like this:

To decide which object is the (D - description of objects) referenced as (T - text):
    repeat with X running through D:
        if the printed name of X exactly matches T:
            decide on X;
    decide on nothing.
于 2014-09-02T06:32:56.130 回答