intfiction.org

The Interactive Fiction Community Forum
It is currently Wed May 22, 2013 7:42 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Help with a project
PostPosted: Wed Apr 25, 2012 5:22 pm 
Offline

Joined: Wed Apr 25, 2012 5:11 pm
Posts: 10
I am working on a final project for my English 871 course on Digital Literature, and I really want to make a piece of interactive fiction. I am brand new to creating it (I have engaged with a few pieces through the confines of my coursework, though), and I feel like I am falling short in a few areas.

I am trying to create ask commands, and I built the table, but when you go to try and actually test the commands, the piece responds saying that [the noun] has better things to do. One thing I want to ask about is an item an NPC is carrying. I'd also like to ask the NPC about itself and about another person who is not in the room. I thought I programmed these correctly in the table, but I must be wrong.

Another thing I am having issues with is: I would like the player not to be able to leave a room without picking up certain items. I tried implementing a rule, but that doesn't seem to have worked, either.

Thank you for any advice you might have, as this contributes to one of my PhD level courses. I really want to see this project flourish!


Top
 Profile Send private message  
 
 Post subject: Re: Help with a project
PostPosted: Wed Apr 25, 2012 5:26 pm 
Offline

Joined: Thu May 20, 2010 9:33 pm
Posts: 479
Could you please post your code? We'll be better able to figure out where you're going awry that way.


Top
 Profile Send private message  
 
 Post subject: Re: Help with a project
PostPosted: Wed Apr 25, 2012 5:29 pm 
Offline

Joined: Wed Apr 25, 2012 5:11 pm
Posts: 10
Code:
The Parlor is a room.

 Your grandmother is a woman in the parlor.  Your grandmother is carrying a book. 

 The description of the book is "You know you've seen that book before, but you cannot quite remember where."

Your grandfather is a man.


A person has a table name called the questions table.
The questions table of your grandmother is the Table of Your Grandmother.

Table of Your Grandmother
Topic   Reply
"book"   "'May I see it, grandmother?  The book, I mean,' you ask somewhat sheepishly.  A vague feeling, a memory, stirs in your mind, but you can't quite make it out. 'Oh,'  your grandmother furls her eyebrows. 'Perhaps after while, my little one.  Let me spend a few more moments alone with him,' she says, appearing in a daze. You wonder if she realizes she said 'him' and not 'it,' meaning the book.  She is going through quite a bit, you think and pass off her remark as a consequence of her grief.  As you continue to occupy the space next to your grandmother, she grows increasingly more aware of your presence and the quizzical look on your face. 'Why don't you find something to amuse yourself with, dear,' she says as she places a hand on your arm.  'This house is old and full of mysteries, I'm sure:  a perfect playground for someone your age.' You nod and begin to walk away, but something inside you urges you to look back at your grandmother.  As you glance over your shoulders, you see the words 'The Seas of Astoria' in a shining, flowing script that you swear was not there before.  You shake your head hurriedly to clear your mind and your vision, and continue back to where you had been sitting before. "
"grandfather"   "'I miss him so much,' she says poignantly as her eyes become misty. 'But let us talk of other things: I only wish to think of happier times.'"
"herself"   "The sight of your grandmother moves you, as you try to understand how she must be feeling.  You approach her, asking, ‘Grandmother, are you feeling alright,’ half expecting her not to respond, as she seems busied with the book she is reading, but you felt as though you should make an attempt to comfort her.  ‘Is there  anything I can do for you?  Get you a cup of Assam breakfast tea, maybe?’[paragraph break]Your grandmother pauses for a moment, closing her eyes and gently inhaling, as if she can smell the tea.  After a second, she opens her eyes and smiles at you.  ‘No, dear,’ she sighs, returning her gaze to the book, ‘I am alright…just reading a bit from your grandfather's favorite book, you know.  It's curious how it reminds me of him, of when he was your age, actually.’" 

Understand "herself" as "[your grandmother]".


Here is one example. Sorry, I'm pretty new to this.


Top
 Profile Send private message  
 
 Post subject: Re: Help with a project
PostPosted: Wed Apr 25, 2012 5:30 pm 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
Rather than reinventing the wheel, you might want to look into some of the extensions for conversation with NPCs.

Robert Rothman


Top
 Profile Send private message  
 
 Post subject: Re: Help with a project
PostPosted: Wed Apr 25, 2012 5:39 pm 
Offline

Joined: Thu May 20, 2010 9:33 pm
Posts: 479
So, assuming that's intended to be an entire working game, the problem is that Inform doesn't handle conversation like that out of the box. It has some verbs for asking/telling, but they are basically stubs, with no useful code behind them. If your code is based on a sample from the documentation or something, it might be relying on either an extension or some code you didn't include. If that's the case, what is your code based on? Otherwise, Example 286 in the documentation, "Nameless," does approximately what it looks like you're trying to do, so you might copy from that.

Alternatively, you can follow Robert Rothman's advice and try on one of the existing conversation extensions: http://inform7.com/extensions/npc/#Gett ... nversation


Top
 Profile Send private message  
 
 Post subject: Re: Help with a project
PostPosted: Wed Apr 25, 2012 8:36 pm 
Offline

Joined: Wed Apr 25, 2012 5:11 pm
Posts: 10
Thank you, both! The ex from the manual worked. I just was missing some preliminary code!


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group