Mudlet mapper script Q&A

All and any discussion and development of the Mudlet Mapper.
User avatar
Vadi
Posts: 4643
Joined: Sat Mar 14, 2009 3:13 pm

Mudlet mapper script Q&A

Post by Vadi » Sat Nov 30, 2013 8:02 pm

Need help getting your mapper script for Mudlet working? Here's the thread where you can ask Mudlet developers & other scripters for help.

User avatar
Zaphob
Posts: 104
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Mudlet mapper script Q&A

Post by Zaphob » Mon Dec 02, 2013 10:19 pm

So I have successfully completed the Mapping script as per the tutorial in the wiki. Thanks for that, it worked! :) Unfortunately, it stops very early. Now the next best thing I found was the complete list of all Mapper Functions. This took a while to digest! After skimming through it, I decided to focus on my first room, add some description to it. I got this via gmcp:

Code: Select all

lua display(gmcp.MG.room.info)
{
  short = "Waldweg.",
  id = "48bb56336af7ddf63baa1638704654ef",
  domain = "Wald",
  exits = {
    "osten",
    "norden",
    "westen"
  }
}
Looking at setRoomName and getRoomName, etc. I assume, this info should be easy to add to my room, however I still managed to fail already, and did not find out why, yet. I can see no error message, neither as return nor in the debug/error consoles.

Code: Select all

lua setRoomName(1, gmcp.MG.room.info.short)
-- no return, nothing seems to happen
lua display(gmcp.MG.room.info.short)
"Waldweg."
lua getRoomName(1)
1
lua getRoomName(2)
2
I did not even create a room 2, yet. What is happening? Do I really fail at the easiest get/set combo there possibly is?

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

Re: Mudlet mapper script Q&A

Post by Vadi » Tue Dec 03, 2013 8:22 am

Hm. Did you use addRoom first to create the room?

User avatar
Zaphob
Posts: 104
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Mudlet mapper script Q&A

Post by Zaphob » Wed Dec 04, 2013 5:50 pm

Yes. I followed the steps in the tutorial to create my first room: http://wiki.mudlet.org/w/Mapping_script#Adding_rooms

Using Mudlet 2.1 on Win7.

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: Mudlet mapper script Q&A

Post by Belgarath » Sun Jan 05, 2014 8:16 pm

Quick question... I recently sat down and went through the torture of creating a mapper for my MUD. It works perfectly but when moving around the different rooms it barely ever shows the Area in the info. However it always shows the Room Name. What's up with that? Is there a way I can make it always show the area?

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

Re: Mudlet mapper script Q&A

Post by Vadi » Sun Jan 05, 2014 8:28 pm

Never seen it happen, how does it look like on a screenshot?

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: Mudlet mapper script Q&A

Post by Belgarath » Sun Jan 05, 2014 8:42 pm

I took a screenshot of the first area (Central Wilderness) I made, and then the fifth area (Marinford) that is bordering the first.
Image
Image

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

Re: Mudlet mapper script Q&A

Post by Vadi » Sun Jan 05, 2014 8:49 pm

Do all rooms in the second area lack a area name being displayed? Have you set a name for the area ID they're in?

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: Mudlet mapper script Q&A

Post by Belgarath » Sun Jan 05, 2014 9:24 pm

Each area has a name attached to it. But only area 1 (Central Wilderness) displays the area name. I don't know how the area name is displayed exactly in the Info, but when I do
Code: [show] | [select all] lua
getRoomArea(1702)
it displays the area ID (38) for Nisse. When I do
Code: [show] | [select all] lua
getAreaName(38)
it displays Nisse. So I don't understand :/

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

Re: Mudlet mapper script Q&A

Post by Vadi » Mon Jan 06, 2014 10:01 am

Looking at the code, it still seems like the mapper is thinking there is no area ID:

Code: Select all

            TArea * _paid = mpMap->mpRoomDB->getArea( _iaid );
            QString _paid_name = mpMap->mpRoomDB->getAreaNamesMap().value(_iaid);
            if( _paid )//if( mpMap->areaNamesMap.contains(__rid))
            {
                text = QString("Area: %1 ID:%2 x:%3-%4 y:%5-%6").arg(_paid_name).arg(_iaid).arg(_paid->min_x).arg(_paid->max_x).arg(_paid->min_y).arg(_paid->max_y);
                p.drawText( 10, mFontHeight, text );
            }
So a bit odd.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests