Aliases with multiple object actions

Silver
Under the use/give tab I've selected 'handle objects individually' in order to run a script when object a is used with object b.

But I don't see anywhere to input any aliases. For example object a could be a lit match and object b a lamp. So far so straight forward. But I also want 'light lamp' to work too as some players may try that. Do I have to set this up as a verb/command instead and do an object check or is there a simple way of adding alternative commands to what I have done that return the same action?

The Pixie
It should work like any other command; just set the alias and any alternative names for each object as normal. For the give command, the pattern is this:
^give (?<object1>.*) to (?<object2>.*)$

So Quest will search for both objects using the name/alias/alt names as normal.

Silver
But one is using one object on another (use match on lamp) whilst the other is a command (light lamp).

I was wondering if the command can in some way be linked (a function ?) to the use a on b script or whether I have to set up an entirely different command that performs inventory checks etc to cover that angle?

Silver
There seems no place to input alternative command structures for the same action is my point I guess.

The Pixie
The way Quest handles things like this is to match the names of objects in scope (i.e., in the current room and inventory). They may look like this to Quest:
^use (?<object1>.*) on (?<object2>.*)$
^light (?<object>.*)

When it sees something like this, (?<object1>.*), it searches though the nearby objects looking for a match. So it is the same search and match for the LAMP in LIGHT LAMP as it is for both MATCH and LAMP in USE MATCH ON LAMP.

If you want the same command to handle both forms, I do not think that is workable, as you are looking at two objects in one, and only one in the other. However, you could set up a script or function that both commands invoke.

OurJud
For what it's worth, I'd have gone straight to adding the command individually, and just checking for the required objects in the script.

Not much help as you'd already looked at this as a solution anyway.

I do everything with commands, but that's because I'm too impatient to work out how to do them the proper way.

Silver
Okay, thanks all, I've figured it out. I've ran away from functions, for now, but realised that use match on lamp is dealt with in the match actions (or is in my example) but the verb is added to the lamp ie - light lamp. So it was just a case of creating that verb for the lamp object and then copying and pasting the code from the first script to that one.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums