So I’m trying to dabble with using Inform 7, and I have some questions. I started off with the complimentary peanuts example in the documentation, trying to explore conversation. The code I’ve written is below. I tried adding in the ability to ask quesitons (and make statements" of characters (eg, “Mr Green, Who is Professor Plum?”, “green, Where is Plum?”, “green, Where was plum at 3:30pm?”, “green, where was the murder”, “green, when was the murder?”, “green, plum was in the study at 2pm”).
I have some of it working to a certain degree. I look up in a table to try to determine what kind of question it is, which sends me to another table, where I can narrow down the question and return an answer.
-
How can I refer to rooms? eg, “Where is the study?”
-
Some weirdness comes into referring to people. I’m not sure if it’s because the person is not visible, but I can refer to Mr Plum, but not Plum or Professor Plum (I can refer to green or Mr Green, who is in the room)
eg, “Green, who is Plum” does not work, but “Green, who is Mr Plum” does.
- My questions seem to work as long as I don’t have a question mark in it.
eg, “green, where is green” works, but not “green, where is green?”. Changing the table so it has “Where is [person]?” doesn’t fix this.
- I wan’t to be able to create events, where an event has a start time, an end time, a location and maybe a description. How do I do this?
This is so that I can make the game understand “Wherewas the [event]” or “When was the [event]”
eg, “Green, where was the party” (The party was in the ball room), “Green, when was the murder” (The murder was between 5pm and 6pm).
- Is there any way to get it understand multiple tokens in a table?
eg. “Where was [person] at [time]” “Plum was in [room] at [time]”
-
How do I modify time, apart from “to the nearest 10 minutes” eg, say I have a time, say 4:20 pm, and I want to set one time to 4pm and another time to 5pm.
-
I’m trying to copy information from one table to another while modifying it at the same time, but having problems with it. I save the information (in this case, the roomname entry) as locationOfPlum, and I want to add “I heard he was in the [locationOfPlum]”) but I get an error message that it was expecting locationOfPlum to be something to say and it isn’t. This even though I’m able to use it to say something on the next line.
Thanks in advance.
[code]“Clue”
The Library is a room. “A room full of books, with some chairs and a desk.”
The study is a room.
Mr Green is a man in the Library. Professor Plum is a man in the study. Professor plum is a person. Understand “plum” as professor plum. Understand “Mr Plum” as Professor plum. A book is in the library. A chair is in the library. A desk is in the library. A box is in the study. boddy is a person in the study.
Asking someone about something is speech.
Telling someone about something is speech.
Answering someone that something is speech.
Asking someone for something is speech.
Table 1 - Type of Question
topic numnouns tabname commentary
“Hello” 0 Table 2 “‘Why, hello there’”
“Who is [person]” 1 Table 2 – [2 refering to Mr Plum works, but not professor plum or plum]
“Where is [room]” 1 Table 4 – [1 why does this not work ?]
“Where was [person]” 1 Table 5 –
“Where is [person]” 1 Table 6 –
“Where is [thing]” 1 Table 4 –
“Where were you at [time]” 10 Table 10 “test succeeds”
“Where was plum at [time]” 10 Table 11 “test succeeds” [5 I’d prefer to have “Where was [person] at [time]”, but that doesn’t work]
Table 2 - subjects
topic commentary
“green” “‘That’s me!’”
“plum” “‘He’s an absent minded professor’”
Table 4
topic commentary
“library” “‘Why, this is the library’”
“the study” “‘The study is to the east’”
Table 5
topic commentary
“green” “‘I was right here’”
“plum” “‘I’m not entirely sure’”
Table 6
topic commentary
“green” “‘I’m right here’”
Table 10
timestart timeend commentary
3 pm 4 pm “‘I was reading in the study’”
4 pm 6 pm “‘I was playing pool in the billiards room. Or is it billiards in the pool room?’”
Table 11
timestart timeend commentary
4 pm 6 pm “‘He was playing pool with me in the billiards room’”
with 20 blank rows
Table 100 - statements
topic tabletochange roomname
“plum was in the study at [time]” Table 11 “study”
“plum was in the billiards room at [time]” Table 11 “billiards room”
“plum was in the lounge at [time]” Table 11 “lounge”
The tablelookup is a table-name that varies. The tablelookup is Table 1.
Instead of speech when the noun is Mr Green:
repeat through Table 1:
if the topic understood includes topic entry:
if numnouns entry is 0:
say “[commentary entry]”;
rule succeeds;
if numnouns entry is 1:
Change the tablelookup to tabname entry;
repeat through tablelookup:
if the topic understood includes topic entry:
say “[commentary entry][paragraph break]”;
rule succeeds;
if numnouns entry is 10:
Change the tablelookup to tabname entry;
repeat through tablelookup:
if the time understood is after timestart entry and the time understood is before timeend entry:
say “[commentary entry][paragraph break]”;
rule succeeds;
if the time understood is the timestart entry:
say “[commentary entry][paragraph break]”;
rule succeeds;
say “‘I don’t know’”;
rule succeeds;
repeat through Table 100:
if the topic understood includes topic entry:
let locationofPlum be the roomname entry;
change tablelookup to tabletochange entry;
choose a blank row in tablelookup;
change timestart entry to time understood; [ 6 I want to set this to the start of the current hour]
change timeend entry to time understood; [ 6 I want to set this to the end of the current hour]
change commentary entry to locationofPlum; [ 7 Why can’t I change this to “I heard he was at the [locationofPlum] at that time”?]
say “‘Oh, he was in the [locationofPlum]?’”; [ 7 Why does this work? ]
rule succeeds;
say “‘Hmmf,’ says Mr Green.”;
[/code]