AskDefault script not running
AvecPardon
21 Jan 2012, 04:36I have several key topics for the player to ask an npc along with a message that it should print in case the npc was asked about something random. The strange thing is that it doesn't run that script, instead it runs the response given for the last topic in the list. The same thing happens with the TellDefault script. Am I doing something wrong?
I had tested out both the ask and tell options by using 'shoes' as the topic. In the case of asking about shoes, Dean gives the same response as if I had asked about the smart phone. If I tell him about shoes, he ends the game. It's a little frustrating, I've poured over the tutorials trying to figure out what went wrong. Any help would be greatly appreciated.
Edit: Ooh, this is an actual bug? It boggles my mind; I've never found a bug in anything I've worked with before. I was about to go find an old piece of code I wrote for another game language and try translating that here to create a looped checklist. You saved me from some major headaches. I've removed the NPC from the game for now and will try using objects to coerce the player into monologuing their questions and answering themselves in narrative.
<askdefault type="script">
msg ("\"Huh? What's that got to do with the dare?\"")
</askdefault>
<telldefault type="script">
msg ("\"Huh? Whatcha talkin' about now? Are you saying you're chickening out already?\"")
</telldefault>
<ask type="scriptdictionary">
<item key="hide from security hidden hiding where to">
msg ("\"You wanna know a good place to hide from security? That's easy. Go all the way to the central plaza and then hang a left. Keep going till you reach the Kiddie Korner, and then take a dive in the ball pit. The mall cops should've already poked at it by now, so they won't be checking again.\"")
</item>
<item key="wallet money cash funds dollars">
msg ("\"You should have some money to get snacks and stuff. Don't try mooching off us, pal; this cash isn't yours till you come out of the mall in the morning. And don't forget to use the camera in your phone! You know the drill; pics, or it didn't happen!\"")
</item>
<item key="gift card certificate">
msg ("\"I dunno, bud. I keep telling you to throw that thing away but you keep hanging on to it.\"")
</item>
<item key="smart cell phone">
msg ("\"It's got a camera in it, so you can take those pics. The word is that you can't call out once you're inside the mall, so everything's pretty much useless except for the camera. But that's all you need to win this bet, am I right?\"")
</item>
</ask>
<tell type="scriptdictionary">
<item key="don't want to go give up forfeit cop out quit">
msg ("\"Really? You're chickening out? You wuss.\"")
finish
</item>
</tell>
I had tested out both the ask and tell options by using 'shoes' as the topic. In the case of asking about shoes, Dean gives the same response as if I had asked about the smart phone. If I tell him about shoes, he ends the game. It's a little frustrating, I've poured over the tutorials trying to figure out what went wrong. Any help would be greatly appreciated.
Edit: Ooh, this is an actual bug? It boggles my mind; I've never found a bug in anything I've worked with before. I was about to go find an old piece of code I wrote for another game language and try translating that here to create a looped checklist. You saved me from some major headaches. I've removed the NPC from the game for now and will try using objects to coerce the player into monologuing their questions and answering themselves in narrative.
Alex
22 Jan 2012, 17:21This looks like a bug to me - logged http://quest.codeplex.com/workitem/988 so I will take a look for v5.1.1.
The code is in the DoAskTell function of the library so if you can figure it out, you (or somebody else) may be able to fix it.
The code is in the DoAskTell function of the library so if you can figure it out, you (or somebody else) may be able to fix it.

Pertex
23 Jan 2012, 09:09Is it correct that AvecPardon insert several words as one key ("wallet money cash funds dollars") or should he add a key for every word?
Alex
23 Jan 2012, 09:24Multiple words for a key is correct. Quest will attempt to find the best match.

Pertex
23 Jan 2012, 21:30I sent a pull request