Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Palmer
Novice


Joined: 21 Mar 2003
Posts: 38
Location: USA

PostPosted: Sat Mar 22, 2003 4:21 am   

%roomname syntax
 
(Zmud verison 6.4)
On my MUD (Discworld), 'look' ing in verbose mode won't output the room's name, just its description and exits, while brief mode yields the name, but not the description. As a result, I can have the name picked up by the Mapper automatically, or the description, but not both. I can 'glance' and the name will output, so I'm trying to create a trigger that will update the current room name in the mapper when I glance. I'm stuck on the %roomname function.

It's a simple syntax problem, but while I can use %roomname to #SHOW the currently stored name, I can't figure out how to set the name. Here's a sample glance output:

The Mended Drum [n,s].

Here's my trigger with the color codes stripped for simplicity:

#TRIGGER {glance} {};#COND {(*)%s~[*~]} {%roomname( %1)} {Within|Parameter=5}

What command should I use with the %roomname function to set the name?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Mar 22, 2003 6:51 am   
 
#NOOP

The NOOP command stands for NO OPeration, basically it does nothing. What happens though is that all of its parameters are fully expanded, and in the case of room functions acted upon, then the output of those function and parameters just goes away. The end result being the roomname gets changed, but nothing is displayed to the output window.
Reply with quote
Palmer
Novice


Joined: 21 Mar 2003
Posts: 38
Location: USA

PostPosted: Sat Mar 22, 2003 6:59 am   
 
That did it. Thanks so much Vijilante!
Reply with quote
Palmer
Novice


Joined: 21 Mar 2003
Posts: 38
Location: USA

PostPosted: Sat Mar 22, 2003 8:40 am   
 
I spoke too soon. I thought it worked, now I can't be sure if it worked once, or not at all. Too simplify, I dispensed with the trigger - I can't even get #NOOP to work from the command line. I must have the syntax wrong, but I'm following the wizard and help files scrupulously. With the mapper in map mode, I enter from the command line:

#NOOP %roomname("blank name")

I've taken the syntax for %roomname directly from the wizard. After entering this line, #DES shows the room name property unchanged. Taking a suggestion from the help file to use #CALL, I also tried from the command line:

#CALL %roomname("blank name")

Again #DES reveals no change. On the offchance that these commands don't work from the command line (?), I created a whole new trigger:

#TRIGGER {Whispering to yourself? Neat trick.} {#NOOP %roomname( "blank name")}

Whispering anything to myself triggers this, and it fires correctly, but #DES and manually checking the room properties reveal no change to the room name. I tried the trigger with the Newline option checked, with the Prompt option checked, and with both of them checked.

What am I missing here?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Mar 22, 2003 3:01 pm   
 
A ,

%roomname's first parameter is the room you want to change or check, blank for current room. So you need to do #NOOP %roomname(,"blank name") to set then name of the room your currently standing in.
Reply with quote
Palmer
Novice


Joined: 21 Mar 2003
Posts: 38
Location: USA

PostPosted: Sun Mar 23, 2003 8:43 am   
 
Thanks again Vijilante, now I've got it. Incidentally, I sure wish little things like this were documented in the help files. I could be wrong, but I looked for it and couldn't find it.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Mar 23, 2003 11:57 am   
 
It is:
quote:

Syntax: %roomname([vNum], [s])

Return or set the name of the room to string s. If vNum is omitted, the current room is used.



I think Zugg added the part about using the current room if vNum is omitted recently, but I can't remember if it was before 6.40 or after.

Anyway, when the new public version comes out you will see a much better and updated help file, brought to you by Vijilante.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 23, 2003 6:39 pm   
 
The current help [6.40]
quote:
roomname

Syntax: %roomname( room, [s])

Return or set the name of the room to string s. If room is omitted, the current room is used.

What's probably not entirely clear is that the room parameter can be blank ("omitted") but still has to be present (you need a comma before string s).

LightBulb
Advanced Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net