cMud Map Importer

Share your scripts and packages with other Mudlet users.
User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: cMud Map Importer

Post by Vadi »

Ok cool - I added some fluff to the script and updated the post, hope that's ok

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: cMud Map Importer

Post by chris »

That's all good. One thing to note is that I scale the x/y coordinates down. In cMud they are separated by 240 pixels, I divide by 60 to make it 4 pixels. You need to figure out the math that works with how you offset your directions.

tarrant
Posts: 49
Joined: Thu Apr 15, 2010 10:36 pm

Re: cMud Map Importer

Post by tarrant »

After running the commands cmud makedb and cmud importmap, i get this:

null roomdesc:27967
cMud map successfully imported.

but when i open map up, there's nothing there. how do i get the map to display?

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: cMud Map Importer

Post by chris »

You need to set yourself to a room number. The null roomdesc means that room number 27967 doesn't have a room desscription. You can set yourself to a room number centerview(roomId). This needs to be called from an alias, etc.

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: cMud Map Importer

Post by Vadi »


User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: cMud Map Importer

Post by Vadi »

Which Mudlet color scheme are you meaning?

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: cMud Map Importer

Post by Darmir »

Hey I am trying your map importer for my Shadows of Isildur map created in cmud. I ran the "cmud makedb" alias and I didn't get any confirmation message saying success or fail. I also ran the "cmud importer" alias and picked my map. hit the open button and nothing happens. I don't see the successful or fail message.

Not sure why the alias's aren't firing. Any ideas?

I just noticed that the SqlMap Initiator has a bug. The error says
Lua syntax error:[string "..."]:36: unexpected symbol near '..'

I believe it is this line:
Code: [show] | [select all] lua
local profilename = string.sub(dir,loc+10)
In the InitSql function. When I comment it out the bug goes away.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: cMud Map Importer

Post by chris »

That line is actually extremely important. What does doing display(dir) and display(loc) give? It may be that you don't have your default save directory as '.../profiles' because I parse for that in loc. There actually is no output when its successful, which I can change after this issue is resolved.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: cMud Map Importer

Post by Darmir »

The line in the initSl function that is showing an error is:
Code: [show] | [select all] lua
local loc = string.find(dir, "[\/]profiles[\/]")
I believe this is the problem. If I remove "[\/]" from the line the error goes away. Once I do that I can run the script with a debug line for the dir and loc variable.
The dir variable is: C:\Users\Shawn\.config\mudlet\profiles\Shadows of Isildur
The loc variable is: 31

After I remove the [\/] from that line it gives the DB created successfully line.

I ran the "cmud importmap" alias and selected my map. It delays and shows nothing while the import begins then I got this messaage:
Code: [show] | [select all] lua
cmud importmap

null roomdesc:820
null roomdesc:889
null roomdesc:892
null roomdesc:896
null roomdesc:897
null roomdesc:900
null roomdesc:901cMud map successfully imported.
As for the output I suggest having a line at the beginning saying import started please wait. Then make sure the successful is on a separate line.

Now after I got that information I went and clicked on the map button and it says there is no map.

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: cMud Map Importer

Post by Vadi »

No map means either no map or no position to display - try centerview(1) to center on the first room.

Post Reply