How to implement a comma based NPC´s dialogue system à la Infocom?

Thanks, Daniel. Could you give a code example?

The Temple is a room.
The Oracle of Delphi is a woman in the temple.
Instead of answering the Oracle of Delphi that a topic:
    say "'[the topic understood]', you say, hoping for divinely-inspired insights into the future…".
Test me with "oracle, my crops are failing".
2 Likes

Thank you, Daniel. Unfortunately, I don´t know why but it didn´t work for me.

I entered the following code, but when I try “mayordomo, reciclaje” there is no answer from the NPC.

Reciclaje is a thing.

Instead of answering the mayordomo that "reciclaje":
	say "¿Qué me dice del reciclaje?- digo inquisitivamente al mayordomo…";

This worked great for me. Maybe you forgot to say Mayordomo was a person? Because I made that mistake for one second.

Here’s my code (copying yours):

`"Sandbox" by mathbrush

Toyroom is a room.

The mayordomo is a person in toyroom
	
Reciclaje is a thing.

Instead of answering the mayordomo that "reciclaje":
	say "'¿Qué me dice del reciclaje'?- digo inquisitivamente al mayordomo…";`

and here’s the result:

Toyroom
You can see a mayordomo here.

>mayordomo, reciclaje
"¿Qué me dice del reciclaje"?- digo inquisitivamente al mayordomo…
>

Edit: also, you don’t need ‘reciclaje’ to be a thing to talk about it. ‘Answering it that’ only looks at the text you type in, not if it corresponds to anything in the world.

3 Likes

Thank you, Brian.

No, the mayordomo is a person in my game, so that doesn´t seem to be the problem. Maybe I have another line of code interfering with the command. I will check if there is something like that messing with this instruction.

The one other thing I can think of is that Inform has a character limit to comands, so if you have a command that starts with the same letters (like ‘reciclar’ or something), inform might be cutting off the end of the word and thinking you’re ordering the guy to recycle.

2 Likes

I suppose it is something else, but who knows? The code its long and maybe there are some other things interfering. If I can´t find the problem maybe I could stick to say, tell, ask…

Thanks everyone for all the help!

1 Like

Try using the ACTIONS command, then talking to the NPC. That will let us see what the parser thinks you’re doing.

2 Likes

Thanks!

This is the message I get:

actions

Actions listing on.

mayordomo, reciclaje

[answering el mayordomo that "

[** Programming error: tried to read from -->-1 in the array “parse”, which has entries 0 up to 60 **]

mayordomo , reciclaje"]

No hay respuesta.

[answering el mayordomo that "

[** Programming error: tried to read from -->-1 in the array “parse”, which has entries 0 up to 60 **]

mayordomo , reciclaje" - succeeded]

1 Like

Now that absolutely should not be happening. That means something’s broken inside the parser so it’s setting “the topic understood” to an invalid snippet.

If you make a new project, and just put Brian’s code into it exactly as shown above, do you get the same error?

1 Like

If you’re using the Spanish language extension, maybe that is interfering in some way?

2 Likes

I was hoping it wasn´t that, but maybe it´s that.

1 Like

It gives an error, yes.

Problem. You wrote ‘Use interactive fiction language elements’ : but the ability to activate or deactivate compiler elements in source text has been withdrawn, in favour of a new system with Inform kits.


Problem. You wrote ‘Use interactive fiction language elements’ : again, the ability to activate or deactivate compiler elements in source text has been withdrawn.

Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

I suspect you’ve got the wrong compiler version for the Spanish Language extension, then. You can adjust that in the Settings tab.

1 Like

I am not sure, I think the 6M62 it supposed to work with the Spanish extension, but I will check it.

Thanks!

This is what happens when you have so-called ‘verbless grammar’ defined in your story- that is, ‘Understand’ phrases for actions that start with a token in square brackets rather than with a verb word.

See this thread for a detailed explanation and a fix (for 9.3 / 6M62).

5 Likes

That was the problem!

An impressive solution. With your permission, I will use the code and I will credit you for that.

Thanks everyone!

1 Like

I detected some conflicts between this fix and my previous code. I don´t know if it is due to my convoluted code or not, but just in case others have the same problem, now the parser says doesn´t recognize some verbs. For example, you eat an apple and then try it again and it says it doesn´t recognize the verb.

OK, thanks for the DM- I am looking into it.

1 Like

After Dr Peter Bates kindly looked into the problem, it seems the problem must be somewhere else, I suppose it is something in my code, or a problem with my extensions.

For time being I am going to stick to “ask”, “tell” and “say”.

Thanks again everyone.