Page 1 of 1

[Hugo] out with multiple choices

Posted: Fri Jan 12, 2007 10:08 pm
by Ice Cream Jonsey
Let's say I wanted to do the following in Hugo:

Code: Select all

>out

Which way do you mean? Through the red door or the green door?
Is it possible to get "out" (as a direction) starting a question for the user like that, when there are two door objects in the room? How would I do that?

Posted: Sat Jan 13, 2007 10:37 pm
by Merk
Sure. I did this in TTS. There is spot where a ladder leads up (south of you) and steps lead up (north of you). If the player tries to go UP, the game asks them to be more specific.

I didn't do it exactly like you want, though. I think I give a message like "you can climb the ladder to the south or the stone steps to the north" -- something like that. They'll either type "climb ladder" or "climb steps" or maybe "north" or "south". What you're looking for is something that the Hugo engine itself does -- disambiguation. But that only happens when it's trying to match objects to a verb definition, and more than one object qualifies without any rules to treat one as more important than the other.

I know of know good way to mimic *that* behavior. In order for the user to answer the question, you'd either have to (a) have verbs set up that *are* the answers, or (b) maybe give a custom prompt. But that's not ideal, because the user should be able to pick neither, and type something else entirely.

You *might* be able to do it with a PreParse() routine. I think, though, that PreParse() doesn't get called until the engine has already parsed the command line into the word[] array. Actually, it'd have to be like that, else PreParse() would have nothing to look at. If that's the case, the engine will already have complained that their answer ("red door" or "green door") doesn't start with a verb.

But again, you could make pseudo verbs "red" and "green". Have a flag any time the game is actually expecting the user to type one of them (otherwise the flag is false). When it's false, the VerbRoutine can call the library "that's not a verb I recognize" mesasge (or whatever it says).

If I think of any other ideas, I'll post again. It seems like maybe I'm forgetting something that might help.

Posted: Sun Jan 14, 2007 9:54 pm
by Ice Cream Jonsey
Thanks, Merk. Yeah, there are definitely some ways to hit this up. I guess I like the slickness of the game asking a direct question to the user, but if it doesn't end up being in the game it won't be the end of the world. Thank you again for your perspective!

Posted: Tue Jan 16, 2007 12:43 pm
by Merk
I'm disappointed that nothing really clever comes to mind. I mean, you *could* mimic the behavior by just asking the question and then pausing with a prompt, but it just wouldn't be as slick as real disambiguation because anything that *doesn't* answer the question wouldn't get parsed by the engine.

For now, you could just state that it's not clear (without actually phrasing it as a question), and then do something better if a better idea comes along. If you do figure something out, I'd be happy to know what. There are times where I'd have used the same kind of thing if there was a way.

Posted: Tue Jan 16, 2007 6:00 pm
by Zork VI
>out

Which way do you mean? Through the red door or the green door?

>look green door

While considering an exit, a large impact is made to the top portion of your skull. The last thing you see is a large, hairy, poorly lighted creature draging you through the YELLOW door (the one behind you), that then precedes to devour you whole and semi-concious.

You scored 0 out of 8719 points earning you the rank of, Wondering Prophet.

RESTART, RESTORE, or EXIT?

>restore

EXIT is not spelled RESTART. I'll now correct this mis-spelling for you. Arn't I wonderful?

Posted: Tue Jan 16, 2007 9:05 pm
by Zork X
>out

Which way do you mean? Through the red door or the green door?

>look green door

The door flies off its hinges and smacks you in the face! Blood running down your eyes, a hand leaving the mark dripping red, the last thing you see is an edge of textured, floating green, above your face before it smashes and connects to the ground through your head.

You scored 9 out of 2032032039 points, giving you the rank of Wonderful Russian.

RESTORE, RESTART, EXIT?

>exit

This game isn't good enough for you, eh? Fuck you! For that, we'll restart and you can play from the beginning because you missed the gum wrapper, you fucken twit.

Posted: Tue Jan 16, 2007 10:12 pm
by Vitriola
Poor Alana.

Posted: Fri Jan 19, 2007 7:59 pm
by Ice Cream Jonsey
Merk wrote:I'm disappointed that nothing really clever comes to mind. I mean, you *could* mimic the behavior by just asking the question and then pausing with a prompt, but it just wouldn't be as slick as real disambiguation because anything that *doesn't* answer the question wouldn't get parsed by the engine.

For now, you could just state that it's not clear (without actually phrasing it as a question), and then do something better if a better idea comes along. If you do figure something out, I'd be happy to know what. There are times where I'd have used the same kind of thing if there was a way.
Yeah, I doubt I will come up with something more elegant, but if I do I'll update this thread or mail you. The prompt doesn't bother me all that much, I suppose, and I think newbies would be able to comprehend it instantly.

Posted: Fri Jan 19, 2007 8:01 pm
by Ice Cream Jonsey
Zork X wrote:This game isn't good enough for you, eh? Fuck you! For that, we'll restart and you can play from the beginning because you missed the gum wrapper, you fucken twit.
Hey now. That was more a Hitch-Hiker's Guide thing. Although if I remember correctly you could waste a lot of time in Zork III if you didn't do something unmotivated.

I think you can get Fallacy of Dawn in an unwinnable state and that always bugged me. But I think you had to start shooting people to get it that way. And hell, in that case a game (of life?) should be "unwinnable."