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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Mon Oct 18, 2010 4:37 pm   

Reset Roomvnum
 
Hi,
Is there anyway to reset the vnum being used by the mapper? I've mapped about 27000 rooms manually, and the vnum sequence jumps all over the place, ie in many different zones.
So like in zone1, i'll have vnum 1,4,7,9, in zone2, i'll have 2,3,10,11,12, in zone3, i'll have 5,6,8,13.

And because sometimes things get mapped wrongly, the vnum assigned to new rooms is upwards of 30000. All this seems very messy. Is there any script or code, that i can use to reset everything to 0, and go through each room in each zone setting the vnum for the rooms in sequence/or with some kind of logic? like change it such that zone1 is 1,2,3,4, zone2 is 5,6,7,8,9 and zone3 is 10,11,12,13.

and also reset the vnum that the mapper assigns newly created rooms such that it follows the sequence properly, instead of it looking like i have 3000 rooms wasted.

thanks in advance!
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Oct 18, 2010 5:42 pm   
 
I have Perl code that accomplishes this:
http://forums.zuggsoft.com/forums/viewtopic.php?t=36068&sid=205238c8c8dad50c1efc9718d9e97835

You'll need to install the free Perl from ActiveState before you can use it.

It does pretty much exactly what you are asking. Without any flags it simply checks for errors and inconsistencies in the data, but with the -renumber flag it reorders zones alphabetically, reorders rooms by zone, makes the numbering consecutive (eliminating any gaps in the numbering).

It will also finish by performing a vacuuming of your database to potentially reduce its size.

There are two options I put in for vNums. The one I use most often is its default option. Unless the 'vnum from server' flag is checked it sets the vnum equal to the key number. This makes it look like the default for a newly created room, since newly created room's have their vnum equal to the key number. I also have an options where it won't touch the vnum's regardless of whether the flag is set. You'll probably want to use it with the default behavior. You wouldn't ever want to set all your vnums to 0, as the default is for them to take the key number, not 0.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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