The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

Renumbering Vnums

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Building
View previous topic :: View next topic  
Author Message
Lugh



Joined: 12 Sep 2003
Posts: 9

PostPosted: Tue Sep 16, 2003 9:30 am    Post subject: Renumbering Vnums Reply with quote

This is probably quite a silly question, but keep with me...I'm real new to this Wink

Is there a way, besides manually, to renumber Vnums from an entire area?

For instance, should an area be shared with another, and the vnums class with an existing area....well it'd be a lot of work to renumber if it's a large area.

Another example would be if an area 'outgrows' it's plotted vnum range. Good planning would prevent this from ever happening, but the possibility is still there.

Comments?

Flames? *grin*



_________________
There is no spoon...

...unless I'm having pudding!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Tue Sep 16, 2003 10:33 am    Post subject: Reply with quote

You can edit the areafile saved in dawn format, and modify the Vnum_offset in the #DAWNAREADATA section.

For example if you wanted to move mekali.are from 3000 to 17500 you would edit mekali.are and change "Vnum_offset 0" to "Vnum_offset 14500" (17500-3000 = 14500).

You can use a negative Vnum_offset to move an area down in vnum range.

Be aware that the system will not translate vnums included within mobprogs... for example if you have "mob load obj 3005", that wouldn't become "mob load obj 17505".

Also use exitlist before you do the transfer, if the room will need relinking, you may want to manually check it.

As a strategy, I would recommend leaving the core areas in the range they are... (i.e. mekali), simply because they make more use of mobprogs than most areas. If you are trying to import an area from another format (say rom) and the area uses an existing range on your mud, you can load it up in a temporary mud with no areas (say use the win32 compile of dawn on your own pc)... import the area, resave it (which will save it in dawn format, and add the Vnum_offset header). Shutdown the mud, manually edit the recently saved files, and set the Vnum_offset to what you want. Load up the mud (watching the bootup messages). Resave the area (which will save in the new vnum range). Copy the converted area onto the mud you want to use it on, and add it to the arealist.txt.

Good luck,

- Kal


Back to top
View user's profile Send private message Visit poster's website
Ixliam



Joined: 18 Jan 2003
Posts: 165
Location: Georgia

PostPosted: Tue Sep 16, 2003 11:39 am    Post subject: Perl script Reply with quote

Here's a quick perl scripts I use.

perl -pi~ -e 's/66(\d\d)/17\1/g' filename.are

This would change all 66XX vnums to 17XX. The \d\d indicates the number of digits behind the 66.

So, if you wanted to do a renumber of 26XXX to 64XXX.

perl -pi~ -e 's/26(\d\d\d)/64\1/g' filename.are

Or, 264XX to 14XX

perl -pi~ -e 's/264(\d\d)/14\1/g' filename.are

Ixliam



_________________
Once you go Mac, you'll never go back.
Back to top
View user's profile Send private message
Lugh



Joined: 12 Sep 2003
Posts: 9

PostPosted: Wed Sep 17, 2003 12:05 am    Post subject: Reply with quote

Thanks guys...that's exactly the type if info I was looking for. Very Happy



_________________
There is no spoon...

...unless I'm having pudding!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Kalahn
Codebase Developer


Joined: 18 Jan 2003
Posts: 710
Location: New Zealand

PostPosted: Wed Sep 17, 2003 11:37 am    Post subject: Reply with quote

Seeing the perl one liner made me remember why I wrote the vnum offset code. The perlscript doesn't translate exits going into the area from other area files, but vnum_offset will translate these.

Then again the perl script will translate vnums within mobprog text... vnum offset currently doesn't.

- Kal


Back to top
View user's profile Send private message Visit poster's website
Lugh



Joined: 12 Sep 2003
Posts: 9

PostPosted: Wed Sep 17, 2003 11:24 pm    Post subject: Reply with quote

Judging from that then, I guess the best way to go about it would be to renumber using the offset as per Kalahn's instructions, and then, once successfully done, give it a run through with the perl script to pick up on the vnums within mprogs.

I might give this a go later to see how it works out.



_________________
There is no spoon...

...unless I'm having pudding!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
boblinski



Joined: 27 Nov 2007
Posts: 40

PostPosted: Sun Jun 01, 2008 11:57 am    Post subject: Reply with quote

Where do I input this script?

I'm completely new to scripts.


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Building All times are GMT + 13 Hours
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


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin