Custom player commands

Chuck
07 Sept 2003, 14:43
Greetings fellow Questers. One of the aspect of Quest that I really like is the ability to manipulate the parser with:

if action <#obj#;anyaction> then doaction <#obj#;anyaction> else....

Here is my situation. I have a car radio. I can convert "anyaction" above to "listen to." Then give the radio an action property of "listen to" and I'm cookin'.

Some players will type, "turn on car radio." I know of two ways to make this possible. First, set up a synonym of "turn on" for "listen to." I don't like this because the two phrases are not really similar enough to be equivocal in all cases. (Who knows? Maybe I'll want the player to "turn on" one of the NPCs?) 8^)**

Second, create another player command for "turn on" identical to "listen to." This seems like it should be unnecessary.

Now my question. Is there a way within ASL to make "turn on" = "listen to" for the car radio alone without having to program two different custom commands?

Chuck

I think Im Dead
07 Sept 2003, 15:19
Um, there's probably a million ways to do this. One would be to have a procedure called radio, and have each command for the radio do this procedure. You could have the procedure check what the variable #quest.command# is (this variable lists what the player last typed in) and if it's equal to turn on radio, it messages, "You turn on the radio." if it's equal to listen to radio, it messages, "You listen to the radio, blaring rock n' roll eh?" and etc, etc.

Um, I think quest may now even let you define commands like this...



command <turn on radio; listen to radio>



That may be more of what you are looking for, I think I saw alex demo some code like that, but I'm not sure.

Eh, whatever. Like I said there's a million ways to do it.