|
Hawkstarr Beginner
Joined: 16 Aug 2005 Posts: 10
|
Posted: Tue Aug 16, 2005 8:08 pm
CoffeeMud Export Script |
A loooong time ago and with some help from Kjata a script was created for the ACK! codebase to export a Zmud map into an .are file. Well I just wanted to post this new one for the CoffeeMud codebase. Some of this is Kjata's script, and some of it is mine. But it works wonderfully.
#CLASS {AreaCreator}
#ALIAS makecmArea {
#VARIABLE Conn %comcreate( "ADODB.Connection")
#CALL @Conn.Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%-1")
#PROMPT zoneName "Enter the name of the zone to extract."
#PROMPT fileName "Enter the name of the area file."
#PROMPT zoneDesc "Enter the zone's description string."
#PROMPT SYSOPPS "Sysopp's name for this area?"
#Prompt Dlocal "What is the default locale?"
#EXECUTE %concat( "#VARIABLE Rooms @Conn.Execute( ", %char( 34), "SELECT ObjID,ObjectTbl.Name,ObjectTbl.Desc,RefNum,UserStr,UserInt FROM ObjectTbl INNER JOIN ZoneTbl ON ObjectTbl.ZoneID = ZoneTbl.ZoneID WHERE ZoneTbl.Name = '", @zoneName, "'", %char( 34), ")")
#SAY Extracting area...
#FILE 1 @fileName
#GAG
#WRITE 1 "<AREA>"
#WRITE 1 "<ACLAS>StdArea</ACLAS>"
#WRITE 1 %concat( "<ANAME>", @zoneNAME, "</ANAME>")
#Write 1 %concat( "<ADESC>", @zoneDesc, "</ADESC>")
#WRITE 1 "<ACLIM>5</ACLIM>"
#WRITE 1 %concat( "<ASUBS>", @SYSOPPS, "</ASUBS>")
#WRITE 1 "<ATECH>0</ATECH>"
#WRITE 1 "<ADATA><ARCHP /><PARENTS /><CHILDREN /><IMG /><BEHAVES><BHAVE>"
#WRITE 1 "<BCLASS></BCLASS><BPARMS /></BHAVE></BEHAVES><AFFECS />"
#WRITE 1 "<AUTHOR/></ADATA>"
#WRITE 1 "<AROOMS>"
#CALL @Rooms.MoveFirst
#WHILE (not @Rooms.eof) {
#WRITE 1 "<AROOM>"
#WRITE 1 %concat( "<ROOMID>", @zonename, "#", @Rooms("RefNum"), "</ROOMID>")
#WRITE 1 %concat( "<RAREA>", @zonename, "</RAREA>")
#WRITE 1 %concat( "<RCLAS>", @dlocal, "</RCLAS>")
#WRITE 1 %concat( "<RDISP>", @Rooms("Name"), "</RDISP>")
#WRITE 1 %concat( "<RDESC>", @Rooms("Desc"), "</RDESC>")
#WRITE 1 %concat( "<RTEXT>", "<IMG />", "<BEHAVES />", "<AFFECS />", "</RTEXT>")
#WRITE 1 "<ROOMEXITS>"
#CALL @Exits.MoveFirst
#EXECUTE %concat( "#VARIABLE Exits @Conn.Execute( ", %char( 34), "SELECT ToID,DirType FROM ExitTbl WHERE ExitTbl.FromID = ", @Rooms("ObjID"), %char( 34), ")")
#WHILE (not @Exits.eof) {
#WRITE 1 %concat( "<REXIT>", "<XDIRE>", %item( "0|7|2|9|1|10|3|8|4|5", %eval( @Exits("DirType") + 1)), "</XDIRE>")
#EXECUTE %concat( "#VARIABLE vNUM @Conn.Execute( ", %char( 34), "SELECT RefNum FROM ObjectTbl WHERE ObjID = ", @Exits("ToID"), %char( 34), ")")
#WRITE 1 %concat( "<XDOOR>", @zonename, "#", @vNUM("RefNum"), "</XDOOR>")
#WRITE 1 %concat( "<XEXIT>", "<EXID>", "StdOpenDoorway", "</EXID>", "<EXDAT />", "</XEXIT>")
#WRITE 1 "</REXIT>"
#CALL @Exits.MoveNext
}
#WRITE 1 %concat( "</ROOMEXITS>", "<ROOMCONTENT>", "<ROOMMOBS />", "<ROOMITEMS />", "</ROOMCONTENT>")
#CALL @Rooms.MoveNext
#WRITE 1 "</AROOM>"
}
#WRITE 1 "</AROOMS>"
#WRITE 1 "</AREA>"
#CLOSE 1
#GAG
#SAY Area extracted.
To call it:
makeCMarea pathtomapfile |
|
|
|
miller0521 Beginner
Joined: 21 Jan 2007 Posts: 15
|
Posted: Sun Jan 21, 2007 12:51 am |
I know this post was made quite awhile ago, but I have just started working with CoffeeMUD and I wondering if you know if this script will still work. And what purpose does it serve, I mean can I create my Zone in the zMapper if I purchase that program, and then convert it into an area for my CoffeeMUD?
|
|
|
|
seamer Magician
Joined: 26 Feb 2001 Posts: 358 Location: Australia
|
Posted: Tue Jan 23, 2007 10:56 am |
It would likely be easier to use the grinder located at http://yourip:27777 to make areas, items and mobiles. If you need help with the grinder, there is a coffeemud yahoo group where the creator of CM answers questions daily.
|
|
_________________ Active contributer to coffeemud.net, the advanced java-based mud system. |
|
|
|
miller0521 Beginner
Joined: 21 Jan 2007 Posts: 15
|
Posted: Tue Jan 23, 2007 12:47 pm |
The Grinder is nice, however when looking at the map, it doens't always display correctly. I Imported one of my areas from my CircleMUD and on the graphical screen it doesn't show most rooms as being connected. Just was wondering if zMapper would be worth using.
|
|
|
|
seamer Magician
Joined: 26 Feb 2001 Posts: 358 Location: Australia
|
Posted: Tue Jan 23, 2007 4:58 pm |
If you dont mind you could email the area to bo@zimmers.net and he'll work out why the rooms didnt link properly. Bo (the coffeemud designer) is excellent at adding support for other codebase areas into coffeemud.
Actually, the grinder just likes to group as much as it can into grid displays - the leftover pieces are displayed elsewhere in the same view. If you hover around the appropriate exits you'll probably find the rooms are connected. |
|
_________________ Active contributer to coffeemud.net, the advanced java-based mud system. |
|
|
|
|
|
|
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
|
|