Page 1 of 4

Mudlet mapper script Q&A

Posted: Sat Nov 30, 2013 8:02 pm
by Vadi
Need help getting your mapper script for Mudlet working? Here's the thread where you can ask Mudlet developers & other scripters for help.

Re: Mudlet mapper script Q&A

Posted: Mon Dec 02, 2013 10:19 pm
by Zaphob
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?

Re: Mudlet mapper script Q&A

Posted: Tue Dec 03, 2013 8:22 am
by Vadi
Hm. Did you use addRoom first to create the room?

Re: Mudlet mapper script Q&A

Posted: Wed Dec 04, 2013 5:50 pm
by Zaphob
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.

Re: Mudlet mapper script Q&A

Posted: Sun Jan 05, 2014 8:16 pm
by Belgarath
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?

Re: Mudlet mapper script Q&A

Posted: Sun Jan 05, 2014 8:28 pm
by Vadi
Never seen it happen, how does it look like on a screenshot?

Re: Mudlet mapper script Q&A

Posted: Sun Jan 05, 2014 8:42 pm
by Belgarath
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

Re: Mudlet mapper script Q&A

Posted: Sun Jan 05, 2014 8:49 pm
by Vadi
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?

Re: Mudlet mapper script Q&A

Posted: Sun Jan 05, 2014 9:24 pm
by Belgarath
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 :/

Re: Mudlet mapper script Q&A

Posted: Mon Jan 06, 2014 10:01 am
by Vadi
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.