Advanced displayverbs

OK ... I'm not sure if there's a better way to do this.
Figured I should share this, in case anyone else finds it useful. Not ready to release my actual code, because it's so messy, but here's an explanation of the method.

But when working on a game for the Easter competition (yes, I know I missed the deadline already), I found that there isn't an easy way to encourage a player to put one object in another using the GUI.

So... after some playing around (really ugly code; nothing I feel comfortable sharing yet), I now have an object with "Put ___ in {container|...}" in its displayverbs.

Some tweaking with the JS function buildMenuOptions, I've got it so that when I click on "red egg" in the text, the pop up verbs menu includes "Put in ...", but clicking on it sends the command "Put red egg in container" to the server.
All my containers have "container" as a name in their alternate alias lists; so the default disambiguation menu pops up with a list of containers.

Similarly, Uncle Jimmy has the displayverb "Give chocolate {to}", so it shows up as "Give chocolate" in the verb menu, because that seems neater to me. And because I've got various chocolate items with "chocolate" as an alternate alias, it comes up with a sensible disambiguation menu; as does the chocolate's "Give {to npc|...}" verb.

I know this probably isn't useful most of the time. But I find myself wondering how easy it would be to build Monkey Island style verb buttons; maybe have the display verbs "Use ! on ___", which will allow the player to click a second object in the inventory/placesobjects panes before sending a whole command back to Quest. If it was just the side panes, or just object links in the text, I think I could do it. But making it work with both will be the hard part.


K.V.

I was playing around with something to this effect, but not on this level.

You need to get a beer from Jerry and give it to another NPC.

On the beer object, I set up "Give (on its own)", then checked 'Display a list of objects...' (I just now thought of running a script in this spot, returning a list of NPCs in the location, else saying "No one is here.")

In the script where Jerry hands over the cold one, I added the display verb "Give beer to" to the NPC and "Give" to the beer object.


It would be very nice if "Put (on its own)" listed all the reachable, visible containers! A marvelous idea!

I just added a "Deposit" verb to my eggs, which puts them in the basket.


I created a "PUT ALL EGGS IN ONE BASKET" command last night, which (of course) puts all held eggs into the basket, but I now think this is probably too silly (and too random) to be included.


To ask Granny about bread, I just added this to her display verbs: "Ask about bread".

When clicked, it says your command was "ask about bread Granny", but that doesn't hurt my feelings too much. (In fact, I just now realized I could use JS to replace that text with "ask Granny about bread" in the ask script!)


mrangel, you think up all sorts of useful stuff! (And you usually inspire me to think up a thing or two while doing so!)


When clicked, it says your command was "ask about bread Granny", but that doesn't hurt my feelings too much. (In fact, I just now realized I could use JS to replace that text with "ask Granny about bread" in the ask script!)

It's always bugged me when playing games if an object's verbs do that. That's why I spent 3 hours (so far) playing with displayverbs so it won't do that.
(Note: This method may well result in the web editor doing strange and incomprehensible things with its verbs)

When I've got more time to work on a project, I think I'm going to kill the verbs list in favour of a command pane. Select an object and the relevant commands are highlighted (but the full set of commands are always displayed); select a command and the objects it can be applied to are highlighted. Then, displayverbs like "give" and "open" would just highlight the matching command, whereas "extend" and "confabulate" would appear in the standard verbs pane.
(In this model, you could look at or unlock a door by selecting the relevant verb and then clicking a compass button; while clicking a direction on its own would still just go there.)


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

Support

Forums