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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun May 23, 2010 2:46 pm   

Map functions not working right
 
For the life of me I can't even figure out the simplest of tasks.

First off I am trying to use mapquery to find rooms and return the vnums, roomname, and zone so I can come up with a walk to script.

Well the problem %mapquery returns a stringlist of the objid numbers or room keys. Okay fine. So now I want the vnum. So I use %roomvnum(id). Well what does it print? The absolute wrong number. I use %roomnum(id) and it prints out the same exact number. I can't even get any function to work right or at least how they say they are SUPPOSED to work. For example, room 2232 has a vNum of 5365. I use %roomvnum(2232) it returns 3689, which is absolutely wrong and not the vnum for that room! When I do #print %roomname(%roomvnum(2232)) I get a completely different room name than it actually is. YET #MAPQUERY command always returns the right values. So what gives? Am I just not understanding these functions according to what is in the help file? Because I am becoming so confused I am ready to give up. If the functions were not supposed to work like this then how the heck does the example in the help file of #LOOP %numrooms {#ECHO %roomname(%roomvnum(%i))} even work correctly?! I can't get anything to work right. What am I doing wrong?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun May 23, 2010 7:46 pm   
 
%roomvnum(), despite its name, uses the %roommode() setting to determine the room to look up. My guess is that just like most of the rest of us you never modified %roommode() from the default value of 1 (vnums). Thus, %roomvnum() wasn't looking at the vnum for room 2232, but at the room that had a vnum of 2232 (I bet you will discover this by locating room 3689).
_________________
EDIT: I didn't like my old signature
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon May 24, 2010 10:42 pm   
 
Yeah I figured out afterwards that roommode was in the WRONG mode. It defaults to 1 every time I open Cmud and the map. However, for some things I have to change it back to 1 from 0 and then back to 0. I'm not sure I understand why roomvnum works the way it does.

It works fine now though. My main gripe is that I always want to work off of vnums and have to continually switch to roommode 0 because I teleport to the vnum not the room key since I use ATCP. The vnum of each room in my map is the actual room number of the room in the MUD retrieved through ATCP. It makes moving around and verifying where I am much easier. Like I said I can gallop or dash move and just teleport to the room I end up at or teleport to any room I am in, if I have it mapped, when opening the mapper without manually having to set my location. Otherwise if I don't set roommode to 0 I end up teleporting to some random location on my map that I am not really at.

Oh well I am still learning the mapper. Razz
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue May 25, 2010 2:17 pm   
 
You could set your roommode automatically on login, with an onConnect event.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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