ID:151038
 
Darke Dungeon uses a magic mirror to let players change certain things, like their name. The trouble is, if I face the mirror and simply type "rename", it gives me this ugly prompt that says: rename mirror "text". I want the verb to accept null input without automatically promting for text, so that the internal code can deal with it attractively.

I've tried modifying the argument list in the verb declaration every way I could think of, but it still keeps giving me rename mirror "text"

Here's my snippet:

rename(N = "" as text|null)
//set category = "System"
set src in range(1)
set desc = "Select a new name for your character."
while (!N)
N = input("What name would you like to be known by?","Rename character",usr.name)
world << "[usr.name] is now known as [N]"
usr.name = N
flick("think",usr)

rename(N = "" as text), rename(N as text|null), and other permutations I have tried still do the same thing, though adding "|null" did give me a nice button labeled "none".

I know there is some simple way to do this that I am overlooking.
On 5/30/01 6:27 pm Shadowdarke wrote:
Darke Dungeon uses a magic mirror to let players change certain things, like their name. The trouble is, if I face the mirror and simply type "rename", it gives me this ugly prompt that says: rename mirror "text". I want the verb to accept null input without automatically promting for text, so that the internal code can deal with it attractively.

Ooh, I see what's going on, and I'll think about handling this more intelligently. Basically, the prompt is occurring first for the src object (which mirror?) and is then extending itself to the text (which text?) even when the src is implicit (there is only one mirror available).

You might try forcing the src to be implicit, eg:

obj/mirror/verb/rename(T as text|null)
set src = usr.contents // or whatever
...

In this case the command-line action would be
rename "text"
rather than
rename mirror "text"

but no prompts will be necessary.
In response to Tom
Changing
set src in range(1)
to
set src = range(1)
fixed it. I knew it was something simple. ;)
Thanks Tom!