jaynabonne wrote:Well, basically, they're completely different parsers with different strategies. I don't think there's a simple solution for what you want (but who knows - I haven't looked totally yet!).
The Quest parser handles an "unresolved object" with something like "I don't see that." The reason why is that the parser makes no distinction between an object (or word for an object) that doesn't exist at all vs one which just doesn't happen to be in the current scope. I suspect that you want it where, if you have an apple in the game but not a banana, if you're in an empty room and type "x apple", it will say, "I can't see that." whereas if you type "x banana", it will response with "I don't know the word 'banana'." You could probably code for that contingency by trying to do a match on all the objects in the game to see if there is one that satisfies the text, but Quest was not coded for that.
Quest is based on pattern matching, not on knowing what various words mean. I think to get the responses you list, you'd have to change the fundamental way the parser is put together, unless you want to create numerous hacks. It's an interesting problem, and I'll think about it some more, but it might not be as easy a change as some others have been!
<function name="UnresolvedCommand" parameters="objectname, varname">
// TO DO: Update names below, we don't need these two variables
unresolvedobject = objectname
unresolvedkey = varname
if (HasString(game.pov.currentcommandpattern, "unresolved")) {
if (ListCount(game.pov.currentcommandvarlist) > 1) {
msg (game.pov.currentcommandpattern.unresolved + " (" + unresolvedobject + ")")
}
else {
msg (game.pov.currentcommandpattern.unresolved)
}
}
else {
// Start replacing here.
if (ListCount(game.pov.currentcommandvarlist) > 1) {
msg (Template("UnresolvedObject") + " (" + unresolvedobject + ")")
}
else {
msg (Template("UnresolvedObject"))
}
// End replacing here.
}
game.unresolvedcommand = game.pov.currentcommandpattern
game.unresolvedcommandvarlist = game.pov.currentcommandvarlist
game.unresolvedcommandkey = unresolvedkey
</function>msg("You used the word " + unresolvedobject + " in a way I didn't understand.")jaynabonne wrote:This function is where it is printed:<function name="UnresolvedCommand" parameters="objectname, varname">
// TO DO: Update names below, we don't need these two variables
unresolvedobject = objectname
unresolvedkey = varname
if (HasString(game.pov.currentcommandpattern, "unresolved")) {
if (ListCount(game.pov.currentcommandvarlist) > 1) {
msg (game.pov.currentcommandpattern.unresolved + " (" + unresolvedobject + ")")
}
else {
msg (game.pov.currentcommandpattern.unresolved)
}
}
else {
// Start replacing here.
if (ListCount(game.pov.currentcommandvarlist) > 1) {
msg (Template("UnresolvedObject") + " (" + unresolvedobject + ")")
}
else {
msg (Template("UnresolvedObject"))
}
// End replacing here.
}
game.unresolvedcommand = game.pov.currentcommandpattern
game.unresolvedcommandvarlist = game.pov.currentcommandvarlist
game.unresolvedcommandkey = unresolvedkey
</function>
What you can do (untested!) is to replace the code I have delimited by comments with this:msg("You used the word " + unresolvedobject + " in a way I didn't understand.")
There is no way to do it without hacking the code. To do that, either paste the above code into your game and modify it, or you can check "Show Library Elements" under "Filter" at the bottom left and then find the function "UnresolvedCommand" and copy it into your game using the button at the top right. Then you can modify it.
[Relatively unimportant note: if you got the message "I don't know the word (s***)", then (if I read the code right), it was in a context where there was more than one object, and it printed out the object name to disambiguate. If you replace as I said above, it will cover both cases, but I was wondering what you had typed to get that. Normally it just prints the text without th word in question. But don't worry about that too much. It's not that important to me. lol]
Jay wrote:The Quest parser handles an "unresolved object" with something like "I don't see that." The reason why is that the parser makes no distinction between an object (or word for an object) that doesn't exist at all vs one which just doesn't happen to be in the current scope. I suspect that you want it where, if you have an apple in the game but not a banana, if you're in an empty room and type "x apple", it will say, "I can't see that." whereas if you type "x banana", it will response with "I don't know the word 'banana'." You could probably code for that contingency by trying to do a match on all the objects in the game to see if there is one that satisfies the text, but Quest was not coded for that. Though, upon further thought, that won't work either, as you could type "take eat", and it would not find an object called "eat" and so say it doesn't know the word, when it does - as a verb. So then you have to search through all the verbs and commands as well, and all the exits names, and... It's just not made to do that. If you designed it to do that, it would be easier to code.
jaynabonne wrote:Mareus, would you be able to post what you have, along with the commands to see what you're seeing? I could modify your doc and post it back to you as well. (If you don't want to do so here for any reason, you could always email me.)
jaynabonne wrote:Attached is your file with the above change made to it (with some minor tweaks like the wrong wording I had and some quotes added around the word). See if it works the way you want. And don't overwrite your original game file until you're sure.