The Synonym Sin

witch wyzwurd
20 Jan 2007, 07:35
Still creating with 3.53....

When defining synonyms, I'm allowed only to provide up to two words per synonym, such as: lift off = lift. But nothing more than two words, like: lift off the = lift. When I run game, I get my message for "doesn't understand command" when I type in "lift off the cliff" for "lift cliff." "Lift cliff" is a player command in a room. Is there a two word limit per synonym?

Also, when I provide two synonyms that include the same word under the same source-word: sound; the sound = audio.... or.... under different source-words:

sound = audio
sound = noise...

...I get my message for "doesn't understand command." Can a word be used as a synonym only once?

And, if I provide other names for an object, how do I match those other names to the object if the object's name is used in a player command, like:

define object <shoe>
alias <boot>
alt <hi-top; lo-top>
end define

command <wear shoe>

As of now, I figure the only option I have is to relist the alternative names for "shoe" as synonyms. Is there a simpler way?

Does Quest 4.0 solve any of the aforementioned issues?

Thanks

Alex
20 Jan 2007, 10:38
You can use more than two words in a synonym. Be aware of the order of your synonyms though - it sounds like you have set up this:

lift off = lift
lift off the = lift

If the player types "lift off the cliff", Quest checks the first synonym and finds "lift off = lift", so it translates the input to "lift the cliff". The second synonym then doesn't match, so your "lift cliff" command doesn't work.

To resolve this, put your more detailed synonym first.

A synonym should only be used once. If you set "sound = audio", then it will translate all occurrences of "sound" into "audio", so it will never translate it into "noise".

Your "wear shoe" command is hard coded, so it won't recognise the alternative names for "shoe". Your command should look more like this:

command <wear #@item#> if (#item# = shoe) then ... else msg <You can't wear that.>

This will allow Quest to recognise "wear shoe", "wear the shoe", "wear the hi-top" etc. It will also give a sensible response for "wear hat", if there's a hat object in the room, and it will say "I can't see that here" if the player tries to wear something that doesn't exist. This is much better than hard coding your commands.

It is of course slightly more work, which is why I introduced verbs in Quest 4.0. You can get the same behaviour I just described by adding a "wear" verb to the shoe object - much much easier.

witch wyzwurd
20 Jan 2007, 12:02
Thanks for response Alex:

Does the synonym rule for "multiple listings not allowed" apply to 4.0 version also? Is there a way around it?

Alex
20 Jan 2007, 12:33
You can't have synonyms translating to multiple things, because otherwise you'd end up with one command translating to multiple possible commands. Quest's command handler only handles one command at a time.

So in your example, "listen to sound" can only translate to one thing. It can't be both "listen to audio" and "listen to noise". I wonder if you're setting synonyms up the wrong way round? You can set "audio; noise = sound" and then both these commands would translate to "listen to sound".

witch wyzwurd
26 Jan 2007, 20:34
Yah, Alex, I wasn't thinking other way around, but I was thinking to code how we think as people. With the ability to differentiate between two source words for the same synonym. Before I read your response above, it occured to me that Quest would have no way of knowing which source word to choose from for the same synonym. i figured how to make my code work though.