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
technomage
Beginner


Joined: 18 Jul 2002
Posts: 13

PostPosted: Thu Oct 24, 2002 11:28 am   

newbie question
 
just a simple question about fuctions what can return or set something
for example zonename

how to get a zonename to a string
and how to set(a.k.a change) a zonename
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Oct 24, 2002 12:39 pm   
 
The mapper functions that allow you to change the value of soemthing have an optional final argument. If this argument is present, then it sets it to that value. In the example of %zonename, you can get the name of a zone by doing:
#VAR zname %zonename(zone)

I'm not entirely sure, since I can't test it right now, but I believe that zone is the number of the zone. You can find out the number of a zone by using %zonenum. Also, as with other mapper functions, you should be able to leave this argument blank to signify the current zone. Thus, to get the name of the current zone you do:
#VAR zname %zonename()

To set it, you have to specify the optional second argument. This should work:
#NOOP zname %zonename(zone, newName)

Notice that I use #NOOP, because functions are never called by themselves. they are colled within the context of a command, and since we don't care what the function returns in this case, we use #NOOP which executes any functions but discards whatever they return.

Finally, as mentioned above, you should be able to leave the first argument blank to signify the current zone and thus, change the name of the current zone:
#NOOP %zonenamep(, newName)

Kjata
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