NPC help

hello to all board members, new guy here with a question :smiley:

I’m trying to learn I7 and having a horrible time creating some NPC’s the player can talk to. I’ve tried creating a new action called talking, but i was only able to get it to work with a single response for all npc’s (which is obviously no good). The “reading and talking” section of the I7 documentation is disappointingly brief. I have tried searching rec.arts.int-fiction for info on NPC’s but did not find anything useful. Maybe everything I need to know is there, and I just need some help with search keywords? I don’t think so though. Can anyone help? Where can I find useful information for help like this? The documentation included with I7 is not helpful enough I’m afraid. Also I wanted to change the default “there is no reply” to something unique but could not find out how…

any help would be appreciated!

PS: the design manual and beginners manual for I6 look like they are very informative and well done, is there anything like it for I7? I feel like I will have to switch to I6 if i am to get anywhere!

hello and welcome. There isn’t an I7 equivalent to the DM4 so far. Your best bet is the documentation, RAIF, and this forum.

I’m not sure exactly how you want to implement conversation in your game but here’s something basic:

“Talking” by “G. Oliver”

Report asking a person about:
say “Are you kidding?”
instead.

Report telling a person about:
say “You -really- must be kidding this time.”
instead.

A person called Rodia is in a room called the apartment. A person called Fyodor is here.

Instead of asking Fyodor about “brevity”, say “He smiles wanly. ‘You must be joking.’”

Instead of asking Rodia about “whining”, say “Rodia looks at you coldly.”

test me with “ask fyodor about life / ask him about brevity / ask rodia about axes / ask him about whining”

You’ll notice that’s a rehash of section 7.6, reading and talking. You’ll probably want to go further. There’s a pretty good article about conversation models by Emily Short at:

emshort.home.mindspring.com/Site … ation.html

best of luck, George

thank you for the reply george, happy new year…

i actually got something together but have stumbled upon a curious “programming error” maybe you can help? here is the code:

[npc stuff]

Mood is a kind of value. The moods are happy, sad and angry.

Report asking about:
say " [the noun] doesn’t appear to know." instead.

Talking is an action applying to one visible thing. Understand “talk to [something]” as talking.

Check talking:
if the noun is not a person, say “You cannot talk to that.”

Carry out talking:
if a person is happy, say Reply in row 1 of the Table of Talking to Joe;
if a person is sad, say Reply in row 2 of the Table of Talking to Joe;

the study is a room. “this is the study.”

joe is a person in the study. joe has a mood. joe is sad. “[if joe is sad] You see joe here, he seems a bit down. [end if] [if joe is happy] joe looks like he is in good spirits [end if] [if joe is angry] you better stay away from joe he looks angry. [end if]”

claire is a person in the study.

the player carries a lollipop. the lollipop is edible.

Table 1.1 - Talking to Joe
Reply
" ‘I[apostrophe]m good- never felt better!’ "
" ‘I feel horrible’ "

and here is the output

study
this is the study.

You see joe here, he seems a bit down.
You can also see claire here.

talk to joe

[** Programming error: (object number 42) has no property p55_mood to read ]
“I’m good- never felt better!”
[
Programming error: (object number 42) has no property p55_mood to read **]
“I feel horrible”

any ideas?

even if i can’t figure this out i’m pretty happy with myself, at least i got somehwere.

What’s happening is that “if a person” is happy will check whether or not any person is happy. In particular, it will check whether Claire is happy, but she doesn’t have a mood defined.

Instead, try something like “Carry out talking to target (a person):”, and “if target is happy” (for general code) or “Instead of talking to joe: …”, “Instead of talking to claire:”.

thanks for the tips but it didn’t work, here’s the error message:

Translating the Source
This is the report produced by Inform 7 (build 4B91) on its most recent run through:

Problem. You wrote ‘Carry out talking to target ( a person )’ , which seems to introduce a rule taking effect only if the action is ‘talking to target ( a person )’. But that did not make sense as a description of an action, so I am unable to place this rule into any rulebook.
Because of this problem, the source could not be translated into a working game. (Correct the source text to remove the difficulty and click on Go once again.)

i also just tried giving claire a mood, but that didn’t work either… i guess i’m just going about this the wrong way?

solved it (change is in bold):

Talking is an action applying to one visible thing. Understand “talk to [something]” as talking.

Check talking:
if the noun is not a person, say “You cannot talk to that.”

Carry out talking:
if the noun is happy, say Reply in row 1 of the Table of Talking to Joe;
if the noun is sad, say Reply in row 2 of the Table of Talking to Joe;

joe is a person in the study. joe has a mood. joe is sad.

claire is a person in the study. claire has a mood. claire is happy.

Table 1.1 - Talking to Joe
Reply
" ‘I[apostrophe]m good- never felt better!’ "
" ‘I feel horrible’ "

output from game:

study
this is the study.

You see joe here, he seems a bit down.
You can also see claire here.

talk to joe
“I feel horrible”
talk to cliare
You can’t see any such thing.

talk to claire
“I’m good- never felt better!”

Well some time has passed and I realized my posts thus far on npc’s were pretty useless and kind of…spammy almost. Not really helpful to anyone nor really done properly. But at least now I know.

Don’t worry about it. What’s the point of an open forum if we always have to follow some arbitrary code of conduct? Your posts will help some beginner down the road. :slight_smile: