Hi,
I’m using Inform for Windows 10.1.2.20220830. It’s been a while (many years) since I last used Inform and I’m struggling a bit on some basic conversation. I had all this working when I didn’t create additional rules, though I think my code is unnecessarily verbose. Now I want to include multiple commands in a conversation, with responses based on ownership of an item in the inventory:
I have a man called a fisherman (inclusion of ‘a’ so it prints correctly). I have set a rule so ‘a fisherman’, ‘the fisherman’ or ‘fisherman’ are all accepted.
I want the player to either ‘ask’ or ‘talk to’ the fisherman about a particular subject. The subject is ‘weather’, but can be covered by ‘clouds’ or ‘sky’. However, his response is different if you are holding the fishing rods.
I’ve included this at the beginning of the story:
Understand "talk to [someone]" as talking to. Understand "talk to [something]" as talking to. Talking to is an action applying to one visible thing.
But I get this:
>ask fisherman about weather
There is no reply.
>talk to fisherman about weather
I only understood you as far as wanting to talk to fisherman.
>ask the fisherman about the weather
"Last night's squall was fierce and ...(correct response).
>ask the fisherman about sky
There is no reply.
Here is the remainder of my code:
In the end of dock is a man called a fisherman. Understand "the fisherman" or "fisherman" as fisherman.
Instead of telling someone about something, try asking the noun about it. Instead of answering the noun that something, try asking the noun about it.
Weather is a privately-named thing. Understand "clouds/the weather/sky" as "[weather]".
Check asking about "weather/clouds/sky":
If the player has the collection of fishing rods,
say "The fisherman looks at you disapprovingly and you feel a flush of shame. 'Why don't you mind your own business, and I'll mind mine?', he says. With that, he turns his back on you and continues fishing." instead.
Check asking about "the weather/weather/clouds/sky":
If the player does not have the collection of fishing rods,
say "'Last night's squall was fierce and..." instead.
‘Talking to’ only gets so far. ‘Fisherman’ is ignored, I have to type ‘the fisherman’. My alternative words for weather (eg ‘sky’) are ignored. I have tried adding:
Check talking about "the weather/weather/clouds/sky":
… and that throws an error.
I’m just a little confused. Can anyone help me:
- Set up the correct rule so the player can type either ‘ask the’ or ‘talk to’
(It would be nice if when the player types ‘talk to the fisherman’ it returned ‘about what?’ and the player could just type ‘weather’ and they get the correct response) - Allow ‘fisherman’, 'the fisherman, ‘a fisherman’ etc
- Any definition of ‘weather’ (‘the weather’, ‘sky’, ‘clouds’) to be used
- The correct code to check when any variation of weather is inputted either with ‘ask about’ or ‘talk to’ is used in conjunction with ownership of the item (fishing rods).
I’m not sure if this warrants a topic table, but that’s a bit further down the line, I think. Thanks in advance.