How would I go about creating a traditional menu conversation system? I assume for now I’d have to make due with the base extensions as the other custom Conversation extensions have yet to be updated.
Which version of Inform do you plan to use?
I plan to use Inform 7. Though I’d be willing to make the switch if it makes my life a lot easier.
I wanna have big conversation trees like some of the more verbose WRPGs (not Planescape: Torment level). I heard Simple Talk might be what I’m looking for though I’m also worried it might run into some issues. For example, how robust can I make the ‘prerequisite’ part of the conversation work to open new options when the player learns something, has done something prior to the conversation, said something to the NPCs previously, etc. etc.
Not planning to make a whole RPG in the game though, just make it a bit more robust than ‘ask about…tell…’
Sorry, I was unclear: are you using Inform 7 Release 6G60, 6L02, or 6L38? Different extensions have been updated for each.
Oh I see. Using 6L38, the current release IIRC.
Currently my weapon for a menu conversation system would be the Hybrid Choices extension by AW Freyr which lets you switch in and out of CYOA at will.
If you want to get really fancy probably the most powerful conversation extension is Threaded Conversation, but the overhead to learn and use it may be too much depending on the size of your project.
The threaded conversation extension gives a lot of quip errors before I even began writing my story.
Any idea on how to fix that?
I am trying something with the extension Activity-based Simple Chat by Shadow Wolf.
You can write something like below and this works fine.
Greeted-Willie is a truth state that varies. Instead of talking to Willie: if greeted-willie is false: start a conversation with willie-chat-1; now greeted-willie is true; otherwise: now greeted-willie is false; say "[noun] walked away.".
Then I can change the last part then it reads:
Greeted-Willie is a truth state that varies. Instead of talking to Willie: if greeted-willie is false: start a conversation with willie-chat-1; now greeted-willie is true; otherwise: start a conversation with willie-chat-2; now greeted-willie is true.
The first example you talk one time and the second time you can’t as the person walks away.
The second example you can talk two times but now come the problem I want the person to walk away on the third attempt.
What can I use in “otherwise” place to let it work as a “if else” statement like in C#?
“Otherwise” does already work like the “else” in an “if else”. If you need more than two options, you can use:
if ...: [...] otherwise if ...: [...] otherwise if ...: [...] otherwise if ...: [...] otherwise: [...]
Of course, in the particular example from the previous post, since we’re testing against a boolean value which can only be true or false, the two options “if” and “otherwise” exhaust the two possible states. Also note that in your second example, since the “otherwise” branch will only be executed if greeted-willie is true already, it is redundant to set it to true in the last line.
If you need to distinguish more states, you could introduce additional truth states and check against them in additional “if-otherwise” sub-blocks, or you could keep track of the conversational state with a number variable, for example, like this:
Conversation-state is a number which varies. After asking Adam about "briefing": if conversation-state is: -- 0: say "Adam starts the briefing."; increment conversation-state; -- 1: say "Adam continues with stage 1 of the briefing."; increment conversation-state; -- 2: say "Adam continues with stage 2 of the briefing."; increment conversation-state; -- 3: say "Adam finishes with stage 3 of the briefing."; increment conversation-state; -- otherwise: say "Adam has already briefed you.";
(Of course, you can set the conversation-state to any number and check for any number, you don’t need to increment it one by one.)
Also, check out the documentation at 11.8. Otherwise.
Thanks, will have a look and see if I can get on top of this.
I have tried the following:
Greeted-Willie is a truth state that varies. Greeted-Willie is false. Instead of talking to Willie: if greeted-willie is false: start a conversation with willie-chat-1; otherwise if greeted-willie is false: start a conversation with willie-chat-2; now greeted-willie is true; otherwise: say "[noun] walked away.".
This code compiles without errors but when I type the second time talk to… then it reverts back to willie-chat-1. It never gets to willie-chat-2.
I am obviously doing something wrong but I cannot figure it out.
I think it could be at these lines:
otherwise if greeted-willie is false: start a conversation with willie-chat-2; now greeted-willie is true;
In any run through an “if … otherwise if … otherwise” structure, only one branch will be executed, namely the first branch where the condition is fulfilled. When greeted-willie is false, this will be at the first if (“
if greeted-willie is false:”). The “otherwise if” branch will not be executed then.
And as I said above, since greeted-willie can only be true or false, you cannot distinguish more than two game states using that variable.
You either need to introduce another truth state, something like this:
Greeted-willie is a truth state which varies. Willie-done is a truth state which varies. Instead of talking to Willie: if greeted-willie is false: start a conversation with willie-chat-1; now greeted-willie is true; otherwise: if willie-done is false: start a conversation with willie-chat-2; now willie-done is true; otherwise: say "Willie walks away.";
Or use a numeric variable as I showed further above.
(In some cases, you can also consider using the “
[one of]...[or]...[stopping]” construct when you want to output different texts on subsequent occasions like talking several times to someone, see 5.7. Text with random alternatives.
Inform also provides ways to check how many times the player did an action like talking to someone, but that doesn’t play well with the “instead of…” rule.
And it’s more advisable to first understand the basic if-otherwise structures anyway.)
Thanks, now it makes more sense than before.
I just could not figure it out, but now I think I got it.
I will amend my code and see how it goes from there.
Thanks for your help and patience, I really appreciate it.
Is there a way that a command like “talk to Alicia” can be atomized without the player typing it in as a command?
I’m not sure what you mean by “atomized”. If you mean triggered or executed as if it had been parsed as a command, you can use “
try talking to Alicia” in an action rule, like this:
Instead of talking to the intercom: try talking to Alicia;
See also 7.4. Try and try silently.
I am not sure how to explain it but I will try again.
When a game run you get this
Restaurant You can see Nathan and Alicia here. >
At this > sign the player needs to type in a command like “talk to Alicia” or “talk to Nathan”.
Restaurant You can see Nathan and Alicia here. >talk to Nathan Hey, Alicia? 1) Alicia (or 0 to say nothing) >>
When the player presses 1 Alicia’s response will appear like below:
Restaurant You can see Nathan and Alicia here. >talk to Nathan Hey, Alicia? 1) Alicia (or 0 to say nothing) >> 1 Oh hey, I didn't see you there. Did you already get a table? >
Now we are at the > sign again.
Instead of the player typing “talk to Nathan” like in the beginning I want this to be automated when Alicia’s response shows.
Restaurant You can see Nathan and Alicia here. >talk to Nathan Hey, Alicia? 1) Alicia (or 0 to say nothing) >> 1 Oh hey, I didn't see you there. Did you already get a table? >talk to Nathan
Without the player typing anything.
Hope this is a little bit clearer as my first try.
In order to have a seamless menu-based conversation which continues over several turns/inputs, you need to employ the functionality of the extension which you are using. I’m not too familiar with that extension, but a quick look at the examples in the documentation (accessible in the Inform IDE under the Extensions tab → scroll down to Shadow Wolf → Activity-based Simple Chat) suggests that you need to link up the chat nodes like this:
Rule for finding responses to chat-hello-larry: link to chat-hows-tricks; link to chat-good-bye. Rule for finding responses to chat-hows-tricks: link to chat-good-bye.
These rules and links determine which chat nodes will be offered to the player, and what the chain of conversation looks like.