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
doyle
Newbie


Joined: 28 May 2003
Posts: 4

PostPosted: Wed May 28, 2003 9:25 pm   

Map creation from .txt file
 
Hello, Can anyone write a script for me that will take some information from a .txt file and create a map

The information is in the following format:

[vnum1] roomname1
up: vnum2
southwest: vnum5
south: vnum5
southeast: vnum6
east: vnum7
north: vnum8

[vnum2] roomname2
down: vnum1
southwest: vnum23
south: vnum34
southeast: vnum16
northeast: vnum37
northwest: vnum11


I'd like the Vnum and Room Names to be filled in for each room and all directions to link both ways if there is a return link from the opposite direction of the second room and one way if it does'nt (does that make sense?). It doesnt matter if the map doesn't look good as I'll move stuff around as needed.

If no-one wants to undertake this I'll totally understand - Jeez, I'm just lazy and can't be bothered to make the map normally :) So if not, suggestions on how to do it would be really helpful and appreciated :)

Thanks for your time.

Doyle
Zmud 6.62
Zmapper 1.15
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu May 29, 2003 12:40 pm   
 
Start by going to the Support Library on this site and read COM Programming in zMUD and ADO Programming in zMUD. If you have zMapper, read the Using zMapper with zMUD help entry as it provides an alternative but similar way of doing this.

Basically, what you want to do is to create the raw data of the map directly. You would first start by going over the entire file and creating a new record in the ObjectTbl table for each of the rooms. Set the correct VNum under the RefNum field and then create one record for each exit in the room in the ExitTbl table. Set the FromID field to the room you are currently creating but set the ToID field to -1 (since you most likely have not created the other room yet). Then, after creating all the rooms and exits, go back again over the entire file and fill in the ToID field of each exit to the corresponding value by looking up each VNum in the ObjectTbl table.

Note: The ID's of FromID and ToID refer to the ObjID field of the ObjectTbl table, and not the VNum, which is the RefNum field. This ID is automatically asigned for each room, and if the database is completely new, it usually starts at 1 and goes up for each new record.

Kjata
Reply with quote
doyle
Newbie


Joined: 28 May 2003
Posts: 4

PostPosted: Thu May 29, 2003 4:05 pm   
 
Kjata

Thanks for the reply, I'll start reading and get back to you as soon as I get stuck ;)

Doyle
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