Conversation threads

Chuck
30 Aug 2003, 18:02
I am very interested in constructing great conversation threads in the IF I am putting together for Quest. In my opinion, any IF without semi-realistic conversations will never achieve the status of a great story.

If you are interested in IF conversations, I'd like to suggest you read a series of articles discussing conversations in Inform:

http://www.onyxring.com/InformGuide.aspx?article=20

Although not entirely suitable for Quest users, the ideas described in the articles certainly apply.

I am leaning toward combining an ask/tell approach with a menu system (the "conversationalist model") described in the excellent overview of "NPC Conversations: Ask/Tell Theory" at:

http://www.onyxring.com/InformGuide.aspx?article=74

Creating textured conversations in Quest is no simple task, and certainly one that separates the casual from the serious developer. If we want Quest to be taken seriously by the IF community, we have to create stories that show its full power. I have not yet seen a Quest story that had believable conversations. Can we achieve "conversational model" interactions in Quest?

Chuck

GameBoy
30 Aug 2003, 18:35
what do you mean by "Great Conversation Threads"? i did a game a while ago in which you had to talk to NPC's. for example, the NPC Legosis would ask you what you wanted to buy from the shop, now instead of typing /bye <item> or buy <item>, you would type a sentance as if you were saying it, like. i would like a <item>. its quite easy to impliment to as all you would be doing is checking what the player has put for #item#, and using conditions to decide what happens next.

Anonymous
30 Aug 2003, 19:16
Of "conversation threads",

I think that the TADS 'chatter.t' object/topic methodology probably would lend itself to modification for use in Quest. This basically implements all potential topics of conversation in 'objects' and has these as either 'known' or 'not known' by specific NPC's. I've not really played with this concept enough to know how well it works in practice, but it would at first sight seem to be a good approach for Quest, given the essentially object-oriented nature of it.

Might be worth having a more protracted discussion on how to implement this idea - I too think that being able to hold some sort of conversation with NPC's is a 'Good Thing' but I'm not crazy about the 'choose your question from this menu' approach, although it has the undeniable merit of being dead simple to implement!.

Al (MaDbRiT)

Having written the above, a germ of an idea comes to mind. I'm off to play with some code :-)

Chuck
31 Aug 2003, 03:16
Al, I agree with you on dislking an exclusive "choose your question from a menu" approach. I'm going after the most natural conversation possible. One possible problem with menus is that there may be too many options for a nice tidy menu. The second link in my first post in this thread provides a nice overview.

With your previous help, I'm now focusing on the use of knowledge properties assigned to characters. For example, giving an NPC "ObjectA" can assign the NPC the property, "knows-object_a." The NPC's reaction to a question about "ObjectA" can vary depending on whether he received it. All knowledge properties can begin with "knows-" to make them easy to spot in the code.

I think an attitude property is another requirement. Ask someone the time of day, they will tell you if they know. Then spit on them. Then ask them for the time of day. Different response with the second request because being spit on set a proprety of "attitude-hostile" for the NPC.

This is better than using flags or game properties variables because the knowledge or attitude is tied to the character object. Some NPCs can have the knowledge and some may not. Plus, NPCs can "lose" knowledge when that helps the storyline.

It seems to me that the use of properties is key in creating believable conversations. I also think randomizing some responses and/or using counters might also help. For example, ask someone what time it is... and they answer. Ask them the same question again, and they might give the time to you once again but begrudgingly. Ask them a third time, and they might do nothing more than glare at you.

An NPC can be assigned many different knowlede properties. I find this more like "real life" than having objects of knowledge and coding who has this knowledge. I don't know enough about TADS 'chatter.t' object/topic methodology to comment though.

Ooooh, the MaDbRiT is off to code! Can't wait! Yum yum. 8^)**

Chuck

Anonymous
31 Aug 2003, 08:14
Hmm

As I thought, coding an ask/tell knowledge based system where objects are known or not known to individual NPC's is actually quite an easy extension to make to my typelib350.qlb. I was approaching it a little differently to your suggestion though Chuck, by storing 'what there is to know' in the object and then the object a 'known by' list. You can have 'common knowledge' of specific objects this way, and more detailed knowledge only known by some NPC's, so it would seem a 'fair enough' approach.

This concept allows the 'spoon feeding' of topics to create the impression of conversation flow - which is quite nice.

What I don't like is that this forces the repeated questioning style, which isn't natural to conversation. e.g.

ask Bob about Sally.

"Sally is the bartender at the Blue Dolphin Club, nice girl."

ask Bob about Blue Dolphin Club

"It's a club on Commercial Road, has karaoke nights I think."

ask Bob about karaoke

"You know, where people sing out of tune to old Frank Sinatra tracks."


(The above is lifted straight from the game log of the 'test code' I ran off to do two postings ago by the way)

Because each ask and response starts a whole new sequence, you HAVE to specifiy who is being asked, but that's unnatural, the conversation would more likely go:

ask Bob about Sally.

"Sally is the bartender at the Blue Dolphin Club, nice girl."

what's the Blue Dolphin Club?

"It's a club on Commercial Road, has karaoke nights I think."

karaoke nights? what are they?

"You know, where people sing out of tune to old Frank Sinatra tracks."

O.K. so I'm being a bit unrealistic, but you get the point, once initiated a conversation tends to have an implied 'partner', you don't specify who you are asking every time.

So I think there needs to be a kind of 'conversation mode', so that once a conversation is begun, we stay in that mode and assume the questions are directed at the partner in conversation until the conclusion. This would allow much more natural exchanges.

It would also allow a 'history' of what's been asked in this conversation to be built up - which if you apply a 'tolerance' property read from the NPC might allow some NPC's to show endless patience in replying to the same question, and others to demonstrate rather less :-)

It would (probably) by default also 'reset' the history (and thus tolerance) once the conversation was ended. So your player could ask the same questions of the same player later, but not in the same conversation - I'm sure this would be 'tweakable' with a simple flag for those 'listen carefully, I shall say this only once' characters.

So, what do you think, is a 'conversation mode' worth wasting a lot of code time on? (it would get pretty hairy - even my preliminary tests show this), or is a simple ask/tell model good enough?

Al (MaDbRiT)

Farvardin
31 Aug 2003, 09:08
Chuck,
the points you mention are very interesting. I'll try to remember them for a personnal use.
I haven't implemented yet such a system with properties in one of my game, but it's a good idea, even if it's quite complicated to program.

I agree too with the menu driven conversation : for some uses, it can be o.k., but generally it's much less natural than if for ex. the player have to type :

>Frank, tell me about Mathilde
>Ask Frank me about the lost passages

etc.

I wish the player has to *guess* what to talk about.
In one of my game, there are several points to talk about for getting further in the adventure (for ex. 10), but they can be randomly choosen from 20 or 25 topics, it means the players has several possibilities to find relevant questions. For going further it means the player has to get a certain knowledge, and 10 out of 20 possibilities are enough (a NPC reveals more things when the player reach this knowledge). Of course by searching in the adventure, the player has clues for the good questions to ask.

The problem with such a system is the player has to type several times : "ask ... about ..." and it can be quite boring. It could be less natural to enter in a conversation mode with only some words to type instead of the whole sentence, but it would be quicker for the player.

I discussed of this issue here :
http://groups.google.com/groups?selm=3e ... put=gplain

More or less it means :

>talk to Alfred
[or "chat with Al
[talk mode (new prompt)]

-? green room
Alfred answer it's his mother's room
-? room five
etc.

Back to what Chuck said, I remember the game Mortville Manor (click adventure game) which had a conversation mode, but only by clicking on some clue words, like "your timetable / what do you think of Leo, Elisa etc. / how are your relations with Leo, Elisa etc.". If you annoy the NPC with too many personnal questions, or if the NPC find you looking in her / his room, she / he won't answer or answer harsly.

I think Im Dead
31 Aug 2003, 12:25
So I finally got over my hangover today, and didn't really feel like putting the finishing touches on my demo for a coordinate based system(which is gonna be really, really cool) and I figured I would help you out. I'm barely coherent but I tested this and it works fine. I think it is what you guys were going for....


There are 3 basic parts of this code you have to understand.

1. The first step is to make a command that will call the process, in my example I used an apostrophe as the speak command, it's common and quick for me.

Example: 'hello world! - I think I'm Dead exclaims, "Hello world!"
command <'#text#> do <speaker>

Now that you have the command you need what it calls, the procedure.

2. Paste this procedure into your text file around any other procedures you have(generally near the bottom of your file...ie: not in the game definition block).

define procedure <speaker>
set numeric <said; 0>
set numeric <q; 0>
set numeric <s; 0>
set numeric <e; 0>
set numeric <a; 0>
set numeric <wordsearch; 0>
set numeric <searchresults; 0>
set numeric <detectedqkeys; 0>
set numeric <detectedekeys; 0>
set numeric <detectedskeys; 0>
set numeric <detectedakeys; 0>
for each object in <#quest.currentroom#> if property <#quest.thing#; npc> then {
set numeric <searchresults; %searchresults% + 1>
set numeric <say-length-format; $lengthof(#quest.command#)$ - 1>
set string <text; $right(#quest.command#; %say-length-format%)$>
set string <punctuation-format; $right(#quest.command#;1)$>
set string <searchname; $displayname(#quest.thing#)$>
for each object in <#quest.currentroom#> if ( $objectproperty(#quest.thing#; speaking)$ = yes ) then {
if ( #punctuation-format# = ? ) then {
msg <You ask, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <q; 1; $objectproperty(#quest.thing#; qkeywords)$> {
set string <qkeyword; $objectproperty(#quest.thing#; qkeyword%q%)$>
if ( $instr(#text#; #qkeyword#)$ <> 0 ) then {
set numeric <detectedqkeys; %detectedkeys% + 1>
set string <qanswer; $objectproperty(#quest.thing#; qanswer%q%)$>
msg <#qanswer#>
}
}
}
}
}
if ( #punctuation-format# = ! ) then {
msg <You exclaim, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <e; 1; $objectproperty(#quest.thing#; ekeywords)$> {
set string <ekeyword; $objectproperty(#quest.thing#; ekeyword%e%)$>
if ( $instr(#text#; #ekeyword#)$ <> 0 ) then {
set numeric <detectedekeys; %detectedekeys% + 1>
set string <eanswer; $objectproperty(#quest.thing#; eanswer%e%)$>
msg <#eanswer#>
}
}
if ( #punctuation-format# = . ) then {
msg <You say, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <s; 1; $objectproperty(#quest.thing#; skeywords)$> {
set string <skeyword; $objectproperty(#quest.thing#; skeyword%s%)$>
if ( $instr(#text#; #skeyword#)$ <> 0 ) then {
set numeric <detectedskeys; %detectedskeys% + 1>
set string <sanswer; $objectproperty(#quest.thing#; sanswer%s%)$>
msg <#sanswer#>
}
}
if ( #punctuation-format# <> ? ) and ( #punctuation-format# <> ! ) and ( #punctuation-format# <> . ) then {
msg <You say, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <a; 1; $objectproperty(#quest.thing#; akeywords)$> {
set string <akeyword; $objectproperty(#quest.thing#; akeyword%a%)$>
if ( $instr(#text#; #akeyword#)$ <> 0 ) then {
set numeric <detectedakeys; %detectedakeys% + 1>
set string <aanswer; $objectproperty(#quest.thing#; aanswer%a%)$>
msg <#aanswer#>
}
}
}
}
}
else {
set numeric <say-length-format; $lengthof(#quest.command#)$ - 1>
set string <text; $right(#quest.command#; %say-length-format%)$>
set string <punctuation-format; $right(#quest.command#;1)$>
set string <searchname; $displayname(#quest.thing#)$>
if ( #punctuation-format# = ? ) and ( %said% = 0 ) then msg <You ask, "$capfirst(#text#)$"|n>
if ( #punctuation-format# = ! ) and ( %said% = 0 ) then msg <You exclaim, "$capfirst(#text#)$"|n>
if ( #punctuation-format# = . ) and ( %said% = 0 ) then msg <You say, "$capfirst(#text#)$"|n>
if ( #punctuation-format# <> ? ) and ( #punctuation-format# <> ! ) and ( #punctuation-format# <> . ) and ( %said% = 0 ) then msg <You say, "$capfirst(#text#)$"|n>
}
end define


The procedure is now in place, now the most important part is how you use it.

3. USE - This procedures relies on objects that are listening to have a few properties, I'll explain the reason for them, their use and such as we go through.

First property an object will need to be given is one called 'npc'(without the apostrophes of course). This defines the object as a creature capable of speaking or interacting based on what is said around it. This property doesn't need a value, it's suggested you don't give it one.

Second property is one called 'speaking' this property does have a value option, basically boolean, yes or no. I included this check to easily implement having characters who ignore you and such until you've completed some task. In order for a npc to be 'listening' to what's being said around, the value of the speaking property must be 'yes'.

Now creating the final product. This procedure looks for properties called, qkeywords(question keywords, responds to questions, eg 'how are you?), skeywords(say keywords, responds to general statements, 'it's hot out.), ekeywords(exclaim keywords, responds to exclaimed statements, 'HELP!) and akeywords(anything keywords, used for text without an appropriate punctuation at the end).

These properties should have a value equaling the total amount of the type of keywords you have given the npc to listen for. qkeywords should be a count of only keywords heard in questions, skeywords statements, etc.

Next this procedure looks for the keywords for the type, these should be properties called 'qkeyword1, ekeyword3, etc. The value for each of these properties should be what word you want the npc to listen for from the players SAY command.

Hand in hand with the qkeyword1 type property, are answer properties. These should be called as such... qanswer1, sanswer5, etc. The value for this property should be exactly what you want messaged to the player when they say this word around the npc(if it is listening). If you want a person to sneeze, or say something in return, place the message here exactly how you want it displayed to the player. An example of how an npc object would look coded is as follows...

define object <obj1>
alias <puppy>
prefix <a scruffy, overgrown>
properties <npc; l=2, w=2; speaking=yes; ekeywords=0; skeywords=0; akeywords=0; qkeywords=5; qkeyword1=where; qkeyword2=you alright; qkeyword3=bite; qkeyword4=home; qkeyword5=come with; qanswer1=The young puppy playfully paws at your leg.; qanswer2=The puppy sneezes suddenly, a shocked expression fills it's face.; qanswer3=The puppy playfully growls at you and scuffles around a bit.; qanswer4=The puppy sniffs around the area, finding nothing in particular.; qanswer5=The puppy yawns and settles on the ground.>
end define

Now to see how this code works, you should try running your game with all these pieces of code added to it, and try to talk to the npc.

***NOTICE*** For this quick make up, I made it a requirement for you to say the npc's name in the sentence for it to listen for other keywords. It is easily changed, but I hastily threw it in there to make it close to what was being described, even though I know it's not very open ended. An example on how to use this npc would be to type.... 'are you alright puppy?

This will message...

You ask, "Are you alright puppy?"

And then some simple message I gave the puppy that responds to, 'you alright'.

It's easily changed to not require saying the name, but eh, like I said, I thought it went. Try it out, post on any problems and let me know of any troubles/bugs or your success.

Anonymous
31 Aug 2003, 14:04
Holy shite Sherlock, you guys are great. I think I'm Dead (who obviously isn't), can I be you when I grow up?

Just looking at this code gives me a glorious headache. Only work makes it go away, so I'll be reading (and rereadind, and rereading, and...) to better understand what you are suggesting and then seeing if I can make it work inside a simple game.

Wow! You certainly have given something for Bob (errr... AL!) Bampton to chew on as well. <inside joke>

I tip my hat to I think Im Dead, Ste, and Al for their ideas here. Let's keep working on this. I think we are on an interesting track. I will certainly learn a lot as we proceed. So thanks!

Chuck Smith

Chuck
31 Aug 2003, 14:10
What a maroon! I was so excited about the previous posts that I forgot to log in. I thought it was worth reposting just to give you guys a bunch of "attaboys!"

define object <Chuck>
properties <quest_newbie>
action <learn code> say <Ouch! What fun. Ouch!>

Chuck
31 Aug 2003, 15:17
I think Im Dead, I pasted your puppy object into a simple room. Then I pasted in the procedure just before "define text <intro>"

Run the program and try to talk to the puppy. Nothing happens. No ASL Log errors. All properies for puppy appear to be activated.

Loads fine into QDK. Then try to examine the speaker procedure. QDK crashes with a:

Run-time error '5':
Invalid procedure call or argument

I am using Quest Pro 3.5 Beta and QDK 3.5 Beta. The presence of the typelib library has no effect.

Chuck

GameBoy
31 Aug 2003, 19:22
Cas, you inspired somebody today, how do you feel? lol :lol:

i cant wait to see your coordinated-based game btw, i remember us talking about it when you first started it, and i did these little test runs, you're a genious. A suggestion if i may add one....

You know those little sites which have HTML Help, why dont you make one and put lots of detailed stuff in, and bits of ASL code to help people hand-code ASL properly, or you could be like Joe Burns and write your own 'ASL Goodies' book :lol: lol

I think Im Dead
31 Aug 2003, 20:10
Um, since I have no clue why it didn't work, possibly because you didn't create a SAY command to run the procedure, I'll post my ASL here and you can copy that straight to a blank notepad, save it as speaker.asl and then run it(as that's exactly what I'm doing and it works fine). I made a few changes that I noticed...

1. Noticed an error where it wouldn't print a period even if you placed one(forgot I had to use #quest.command# instead of the #text# variable).

2. Took out the part where it listens for the name as I noticed it didn't work(and as I said originally it was kind of a flaw).

Here it is, note that I have rooms setup to look different, all that is preference, don't let it distract you. I'll edit this in a few minutes and set up a direct link to the file if necessary.


' "Speaker Test"

define game <Speaker Test>
asl-version <350>
start <room>
game info <Testing Co-ordinate/Grid Based Ideas>
error <badcommand; I don't understand what you typed.>
error <badthing; I could not find what you were referring to.>
error <badplace; You can't go there.>
error <itemunwanted; Your offer has been declined.>
error <defaultuse; I don't understand what you typed.>
error <cantdrop; For some reason you can't drop that.>
error <noitem; I could not find what you were referring to.>
error <badexamine; What is it you would like to examine?>
error <badgo; You can't go there.>
error <baduse; I don't understand what you typed.>
error <badgive; Give to whom?>
error <badtake; You can't pick that up.>
error <baditem; I could not find what you were referring to.>
error <baddrop; You are not holding that.>
error <badpronoun; I could not find what you were referring to.>
error <defaultout; You can't go there.>
background <black>
foreground <white>
panes off
'specifies room appearance
description {
msg <[$objectproperty(#quest.currentroom#; title)$]>
if ( #quest.formatobjects# <> ) then msg <$objectproperty(#quest.currentroom#; look)$ You also see here #quest.formatobjects#.> else msg <$objectproperty(#quest.currentroom#; look)$>
if not <#quest.doorways.dirs#> then msg <Obvious exits: none> else msg <Obvious exits: #quest.doorways.dirs#>
}
command <'#text#> do <speaker>
end define


define room <room>
alias <The Grid>
properties <title=The Grid; look=Massive white lines cross vertically and horizonally over the surfaces of this room making it impossible to tell it's true size.>
define object <obj1>
alias <puppy>
prefix <a scruffy, overgrown>
properties <npc; speaking=yes; ekeywords=1; skeywords=0; akeywords=0; qkeywords=5; ekeyword1=die; eanswer1=The puppy is suddenly startled and begins whimpering.; qkeyword1=where; qkeyword2=you alright; qkeyword3=bite; qkeyword4=home; qkeyword5=come with; qanswer1=The young puppy playfully paws at your leg.; qanswer2=The puppy sneezes suddenly, a shocked expression fills it's face.; qanswer3=The puppy playfully growls at you and scuffles around a bit.; qanswer4=The puppy sniffs around the area, finding nothing in particular.; qanswer5=The puppy yawns and settles on the ground.>
end define
end define

define procedure <speaker>
set numeric <said; 0>
set numeric <q; 0>
set numeric <s; 0>
set numeric <e; 0>
set numeric <a; 0>
set numeric <wordsearch; 0>
set numeric <searchresults; 0>
set numeric <detectedqkeys; 0>
set numeric <detectedekeys; 0>
set numeric <detectedskeys; 0>
set numeric <detectedakeys; 0>
for each object in <#quest.currentroom#> if property <#quest.thing#; npc> then {
set numeric <searchresults; %searchresults% + 1>
set numeric <say-length-format; $lengthof(#quest.command#)$ - 1>
set string <text; $right(#quest.command#; %say-length-format%)$>
set string <punctuation-format; $right(#quest.command#;1)$>
set string <searchname; $displayname(#quest.thing#)$>
for each object in <#quest.currentroom#> if ( $objectproperty(#quest.thing#; speaking)$ = yes ) then {
if ( #punctuation-format# = ? ) then {
msg <You ask, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <q; 1; $objectproperty(#quest.thing#; qkeywords)$> {
set string <qkeyword; $objectproperty(#quest.thing#; qkeyword%q%)$>
if ( $instr(#text#; #qkeyword#)$ <> 0 ) then {
set numeric <detectedqkeys; %detectedkeys% + 1>
set string <qanswer; $objectproperty(#quest.thing#; qanswer%q%)$>
msg <#qanswer#>
}
}
}
}
}
if ( #punctuation-format# = ! ) then {
msg <You exclaim, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <e; 1; $objectproperty(#quest.thing#; ekeywords)$> {
set string <ekeyword; $objectproperty(#quest.thing#; ekeyword%e%)$>
if ( $instr(#text#; #ekeyword#)$ <> 0 ) then {
set numeric <detectedekeys; %detectedekeys% + 1>
set string <eanswer; $objectproperty(#quest.thing#; eanswer%e%)$>
msg <#eanswer#>
}
}
if ( #punctuation-format# = . ) then {
msg <You say, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <s; 1; $objectproperty(#quest.thing#; skeywords)$> {
set string <skeyword; $objectproperty(#quest.thing#; skeyword%s%)$>
if ( $instr(#text#; #skeyword#)$ <> 0 ) then {
set numeric <detectedskeys; %detectedskeys% + 1>
set string <sanswer; $objectproperty(#quest.thing#; sanswer%s%)$>
msg <#sanswer#>
}
}
if ( #punctuation-format# <> ? ) and ( #punctuation-format# <> ! ) and ( #punctuation-format# <> . ) then {
msg <You say, "$capfirst(#text#)$"|n>
set numeric <said; 1>
for <a; 1; $objectproperty(#quest.thing#; akeywords)$> {
set string <akeyword; $objectproperty(#quest.thing#; akeyword%a%)$>
if ( $instr(#text#; #akeyword#)$ <> 0 ) then {
set numeric <detectedakeys; %detectedakeys% + 1>
set string <aanswer; $objectproperty(#quest.thing#; aanswer%a%)$>
msg <#aanswer#>
}
}
}
}
}
else {
set numeric <say-length-format; $lengthof(#quest.command#)$ - 1>
set string <text; $right(#quest.command#; %say-length-format%)$>
set string <punctuation-format; $right(#quest.command#;1)$>
set string <searchname; $displayname(#quest.thing#)$>
if ( #punctuation-format# = ? ) and ( %said% = 0 ) then msg <You ask, "$capfirst(#text#)$"|n>
if ( #punctuation-format# = ! ) and ( %said% = 0 ) then msg <You exclaim, "$capfirst(#text#)$"|n>
if ( #punctuation-format# = . ) and ( %said% = 0 ) then msg <You say, "$capfirst(#text#)$"|n>
if ( #punctuation-format# <> ? ) and ( #punctuation-format# <> ! ) and ( #punctuation-format# <> . ) and ( %said% = 0 ) then msg <You say, "$capfirst(#text#)$"|n>
}
end define


I think Im Dead
31 Aug 2003, 20:22
Hope that works, also, while I don't think I'd be very qualified for making a site filled with what I know of ASL(I could easily make the site, and I know a bit, but, I don't think it's enough to constitute a site) I think it would be a good idea to start an ASL TWiki. It could not only have ASL information but also ideas on game development and implementation.

For those of you who are unaware of the TWiki system, here's a link to one on Mud dev' I have bookmarked. It's not anything close to the hear all say all of Mud development, but some ideas are good and every so often I like to read it.

linky linky

Chuck
31 Aug 2003, 22:01
I tID, I still get the error on trying to load the procedure into the QDK. Maybe someone else will have more success.

Chuck

I think Im Dead
31 Aug 2003, 22:33
Here's a link to download my speaker.asl file. It is the same as what I just pasted here. Try downloading it and running it, it loads in qdk just fine for me as well as plays just fine.

speaker.zip

Save link as, I'm using firebird, but it should work with IE, etc.

*edited the code pasted above to represent another change(made a mistake in that I forgot to set a few variables if there are no objects listening or anything.

Chuck
01 Sept 2003, 04:12
I know this involves considerable work on your part and you must be getting frustrated... but I get the same crash when I try to examine the procedure within QDK 3.5 Beta. Plus, when I tried to run the speaker file after unzipping, I could not elicit any talk to responses. Sorry.

Chuck

paul_one
01 Sept 2003, 13:28
QDK loads the file, but whenever you try to edit the procedure it goes into a runtime error number 5.

I haven't even tried the commands in Quest but it loads!

_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
NO SONG
Using Winamp.

Chuck
01 Sept 2003, 13:41
That's the error I get. After loading it into Quest, I cannot say or do anything to the puppy. It might have been better to use a human character to demo his idea.

Glad to see that I wasn't alone in having a problem with the file within QDK.

Chuck

paul_one
01 Sept 2003, 13:51
Honestly - I'm not posting more to put up my post count :wink: .

I had a look into it and it looks like you've got some arry {}'s to me... I use almost exactly the same format for *my* programming ( }'s on the same indent as the indent of the original opening line ).

I messed around with it and it now opens in QDK (I also removed the second "for every object in #quest.currentroom#"). BUT that's all I changed. The second "every object" which was not needed IMO - why go through one object and then through all the objects, then through the next object and again through all of them etc...

The {}'s are where you should start looking though!

EDIT:
I tried it - it works, you also had "%detectedkeys%" instead of "%detectedqkeys%".

I have uploaded it here (I hope you don't mind... I'll remove it in a day or two!):
Edited Speaker

EDIT 2:
You might want to have this inside a "talk mode". Ie you speak to a character - you enter "talk mode" and this deals with multiple characters having the same keywords, and stops you from changing from person to person all the time with different keywords.

Maybe a " ' #objectname# #sentance# #! or ? or . or other# " command instead....

_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
Barenaked Ladies - Brian Wilson (Acoustic)
Using Winamp.

Chuck
14 Sept 2003, 20:13
I don't want to see this thread fade too quickly. Al (MaDbRiT), are you making any progress on your conversation options in your library?

I have coded the following as a custom command:

command <ask #@person# about #@subject#> {
if action <#person#;ask> then doaction <#person#;ask> else {
if ( #(person):displaytype# = person ) then msg <You ask $displayname(#person#)$ about #subject#. But there is no response.> else msg <Why would you ask the $displayname(#person#)$ about #subject#? You need to get a hold of yourself.>
}
}


Then include the following script property action "ask" for a character named Tiny Tim:

action <ask> {
if ( #subject# = key ) then msg <"Ah yes, I put that key there yesterday. It was an extra that your father had.">
if ( #subject# = table ) then msg <"Yes, we have had that in my family for a long time. Isn't it elegant?">
if ( #subject# = book ) then msg <"Yes, I sure do love to read that book.">
}


This has several problems when I ask Tim various questions. First, all the objects have to be in the same room as Tim. That seems odd to me. Second, if I have a question that does not involve a created object (e.g., ask Time about the bird" there is an error message about the object not being there. This I understand since there are no "else" messages in the action script.

I have struggled most of the day to try to figure out how to code the above to achieve several things:

First, ask Tim about something he knows and have him answer correctly (as per his action property script).

Second, ask Tim about objects not present that are programmed into his action property script.

Third, have a default response to things he has no knowledge of.

Any ideas?

Chuck

Alex
14 Sept 2003, 20:36
Instead of:

command <ask #@person# about #@subject#>

I suggest you use:

command <ask #@person# about #subject#>

The "@" sign forces the thing to be an object name - but in your example you want the subject to be anything.

paul_one
14 Sept 2003, 20:40
You may want to get rid of #@subject# and just use #subject# - this will allow you to use lines/proper subjects instead of objects...

There are two ways to get a default response...
[1] Have multiple IF's, in layers, inside each other...
eg:
If ... then {
if ... then {
if ... then {
}
else {
default message
}
}
}

That way is if you don't have a select case - pretty standard.
[2] Have a #flag#... After every if have it set a flag, if at the end no flag is set display the default message...
eg:
Flag [default]   (on)
If ... then {
[message]
flag off [default]
}
If ... then {
[message]
flag off [default]
}
if flag [default] then {
[default message]
}


This is pretty nice to read and easily allows you to add/remove other options without worrying too much about {}'s all the time.
I'd personally go with 2!

I just noticed Alex's post... So ignore the tip of my post!

_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
NO SONG
Using Winamp.

Chuck
14 Sept 2003, 20:54
Great. Thanks Alex. That removes the problem of not being able to respond to questions about objects that are not present.

Now, for my other problem. I need to figure out a default response for the script in the person-object's action property.

action <ask> {
if ( #subject# = key ) then msg <"Ah yes, I put that key there yesterday. It was an extra that your father had.">
if ( #subject# = table ) then msg <"Yes, we have had that in my family for a long time. Isn't it elegant?">
if ( #subject# = book ) then msg <"Yes, I sure do love to read that book.">
}


I'd like to avoid putting "if ( #subject# = whatever) into the else statement. There might be twenty or thirty subjects so a list like above works best. What I need is a final line that I can't figure out how to code that is an ASL translation of

If the subject is none of the above then msg <"I don't know anything about that.>


This would seem to be relatively simple, but the answer has eluded me.

Chuck

paul_one
14 Sept 2003, 21:02
Look at my post :lol: !!
"LOOK AT ME" "LOOK AT ME" "LOOK AT ME!" "LOOK AT ME!"
#runs around room#
_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
NO SONG
Using Winamp.

Chuck
14 Sept 2003, 21:07
Thanks for the suggestions CW. Two problems. First, assume there are thirty topics for possible discussion among ten characters.

The nested if...then commands would be horrendously complicated but would do the trick.

The flags would work fine if there was only one character. I think I'd have to have a flag for every topic for every character. I could be wrong on this. I'll think out the logic.

I may have to combine the code I now have in combination with character-object or subject properties, something I talked about uptopic. I know Al is working on this as a feature in his library so the problem might be resolved there.

Thanks for your ideas!

Chuck

paul_one
14 Sept 2003, 21:35
You only need the one flag - since you're turning it on before you go through any IF's... It doesn't matter if another character uses the same flag since you are turning it on at the beggining of every action it's ALWAYS going to be the same so the characters don't interfere with each other.
_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
NO SONG
Using Winamp.

Anonymous
15 Sept 2003, 00:02
Chuck wrote:



I don't want to see this thread fade too quickly. Al (MaDbRiT), are you making any progress on your conversation options in your library?



Surely have, at the moment the 'asktell 'add-on to typelib allows the player to ask NPC's about any object in the game (including themselves) - however I'm waiting on the next fix of Quest to allow me to extend this to asking about locations (without getting tied up in needing fake room objects etc - shudder!)

My code doesn't require the object asked about to be present, as it uses routines from typelib which itself needed to deal with manipulating 'not present' objects (things in containers) - hopefully this will result in a plug and play addition of limited conversation in due course. :-)

Al (MaDbRiT)

Chuck
15 Sept 2003, 00:29
Al (the MaDbRiT), you da man! Looking forward to the new library.

Also, when are you going to release your new Quest Tutorial <Chuck ducks and runs....>

Thanks for all the responses to this thread.

Chuck

codingmasters
01 Nov 2003, 06:14
What are NPC's?

Matthew G.

kewldude606
02 Nov 2003, 02:26
Non PLayer Charachers

You can interact with them, but the computer is simulating them and there is no real person on the other side.

GameBoy
03 Nov 2003, 15:53
or interactive player objects, as some may call it

paul_one
03 Nov 2003, 21:37
I've never eaven heard of an "IPO" .

Oh, and NPC in my mind means "Non Playable Character". Basically because it's good English and kinda makes more sense. :P

codingmasters
03 Nov 2003, 21:38
Do you see what I mean? I just want to work out quite a few things with Quest,and you guies are just flaming me

Matthew G.

PS Thanks anyway

paul_one
03 Nov 2003, 21:48
I don't see any mention of you in my or Ste's replies.

codingmasters
03 Nov 2003, 21:51
I know that, but you guys are flaming me elsewhere in this forum, and I didn't know what and NPC or an IPO was.

Matthew G.

paul_one
03 Nov 2003, 21:55
You didn't ask what an IPO is - Ste just came up with it from nowhere.

And I know you didn't know what a NPC was.

codingmasters
03 Nov 2003, 21:58
I know I didn't ask about IPO's, but now I do know what they are

And if you knew I didn't know what an NPC was, why didn't you tell me when asked back in another thread

Matthew G.

paul_one
03 Nov 2003, 22:02
This is the only thread *I* know that has comments on NPC's.
I didn't think there was a point for me to reply since Kewldude said something quite close to the answer. I only replied because I wanted to know what Ste was on about - plus I might as well point out that NPC's (for me) is slightly different from kewldude's.

codingmasters
03 Nov 2003, 22:03
Well then I'm sorry.

Matthew G.

paul_one
03 Nov 2003, 22:06
That's ok.

GameBoy
03 Nov 2003, 23:06
C.W. - IPO is used VERY rarely, and probably only by me, but it is another term used for computer data in a game which acts like a player, but isnt, its just an object.

CM - ...

p.s. sorry C.W. im using your method :D