Basic Simple Mapping Script Thread

All and any discussion and development of the Mudlet Mapper.
Post Reply
Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Basic Simple Mapping Script Thread

Post by Silvine » Wed Mar 14, 2012 6:58 pm

Is there a basic mapper that exists for Cirlce muds, or can you recomend a good starting point?

Thanks

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

Re: Mapping

Post by Vadi » Thu Mar 15, 2012 5:13 am

I'm not certain. I maintain one mapping script: http://forums.mudlet.org/viewtopic.php?f=13&t=1696 and while I haven't written a great guide to getting one made yourself (start is at: http://wiki.mudlet.org/w/Mapping_script) I could assist you with one getting setup for your MUD.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Mapping

Post by Silvine » Fri Mar 16, 2012 9:36 am

Thanks for that. I had looked at forums.mudlet.org/viewtopic.php?f=13&t=2482 as it looked really simple and I have got the basic triggers to grab the room name and description. I will post these later, as they are not very robust, but i can't find anything else to trigger on, more of that when i post some examples. But now i'm kinda stuck for what to do next as nothing much seems to happen.
Is there any way to force a circle mud to give up its room id's? There are times when I login that i get spammed by this type of information that is generally hidden, i'll post it as well.
As a general rule how complictated is it to get the mapper to work in reasonable fashion?

Thanks

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Mapping

Post by Silvine » Sat Mar 17, 2012 11:54 am

Ok so the output from the mud is:-

You lead south.

Northern End Of Market Square
[Indented here, but doesn't display correctly, I match on the indent] You are on the bustling Market Square. All around you there are stalls and
booths and people walking around between them. The whole wide square is in
constant chaos. Hawkers shout, livestock moo and cluck, people try to make
themselves heard over the noise. To the north you see the temple and to the
south is the river.
[ Exits: n e s w ]
North - The Temple Fountain
East - Inn Street
South - The Middle Of Market Square
West - Alchemy Street
A cityguard stands here. (Blue Aura)
A mighty beholder locks his deadly gaze onto you! (Charmed) (Red Aura)
A Sword Spider is here trying to poison you with its deadly bite. (Charmed)

[560hp - ]>
South
You lead south.

The Middle Of Market Square
[indent] You are on the bustling Market Square. All around you there are stalls and
booths and people walking around between them. The whole wide square is in
constant chaos. Hawkers shout, livestock moo and cluck, people try to make
themselves heard over the noise. To the north you see the temple and to the
south is the river.
[ Exits: n e s w ]
North - Northern End Of Market Square
East - The Main Street
South - Southern End Of Market Square
West - Main Street
A small sparrow is here singing. (Flying)
Odif yltsaeb is here, walking backwards.
A young adventurer is here making ready to start a new journey.
A teenager is here playing in the street.
A stallholder is trying to sell his wares here.
A stallholder is trying to sell his wares here.
A mighty beholder locks his deadly gaze onto you! (Charmed) (Red Aura)
A Sword Spider is here trying to poison you with its deadly bite. (Charmed)

I match using:-
Room name
^ [A-Z]

Room Description
^

Room name gives
The Middle Of Market Square

as a match

Room Description gives
You are on the bustling Market Square. All around you there are stalls and booths and people walking around between them. The whole wide square is inconstant chaos. Hawkers shout, livestock moo and cluck, people try to make themselves heard over the noise. To the north you see the temple and to thesouth is the river. [ Exits: n e s w ]

as a match


code in room name is

mapper.roomName = getLines(getLineNumber()-1, getLineNumber())[1]
enableTrigger("Stop Room Description")
enableTrigger("Room Description")

code in room description is

if(mapper.roomDescription) then
mapper.roomDescription = mapper.roomDescription.." "..getCurrentLine()
else
mapper.roomDescription = getCurrentLine()
end


So, what do I do with this information? I'm worried my triggers will just fire randomly as well, but i dont see what else i could match on really?

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

Re: Mapping

Post by Vadi » Sun Mar 18, 2012 1:21 am

Is the room description any specific colour? That would be the easiest to match off.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Mapping

Post by Silvine » Sun Mar 18, 2012 7:45 pm

Yes, I can filter on the colour then pass that on to the intent.
How do i pass this info to the mapper? Or whats the next step? Thanks.

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

Re: Mapping

Post by Vadi » Sun Mar 18, 2012 8:12 pm

You eventually want to call centerview(exact room ID). So the next step would be to locate what room are you in - you can do that with searchRoom(room name). That will return you a list of possible matches (it does substring searching - so you'll want to filter that list down to exact match).

If you only get 1 room name, then great, ignoring the fact that you might have unmapped rooms, this is the exact room you're in. centerview on that room ID. If you get multiple matches, you could try checking exits of all those rooms to see if you can find a room with only the same exits as your current room. Find such a room and centerview. If you still have multiple matches, well, at this point you can only really set it as a random possible room, -or-, take your mapping a step ahead and also remember the room descriptions (you can store custom data in room user data) against which to match rooms or anything else that's unique to rooms (indoors/outdoors status, maybe) - or filter rooms by area and etc.

If anything is unclear, please feel free to ask for a clarification.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Mapping

Post by Silvine » Sat Dec 15, 2012 11:27 pm

Ok, its been a while but I'd like to build something that's simple but that works pretty well. The mud provides some GMCP stuff so I can get the room id, name, zone, exits, and the terrain. I used this demo forums.mudlet.org/viewtopic.php?f=5&t=1678&hilit=aardwolf&start=10#p6153 to get me started. However I get lots of room collisions (by collisions I mean one room trying to occupy the same coordinates as a room that already exists, I'm not sure this is what a collision actually is). Also when I try to move the room, the map either crashes or it keeps trying to map back to the rooms original coordinates. I suppose what I'm hoping for is for someone to walk me (who isn't that knowledgeable) through the process of building a mapper. I think there are many out there who would gain from it. Before we start this will be a long hard road, but thanks loads if you take up the challenge.
So first question, how do I cope with a room collision?

thanks

Silv

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

Re: Mapping

Post by Vadi » Sun Dec 16, 2012 12:24 am

In regards to the crash, which should not happen, please test with: http://sourceforge.net/projects/mudlet/ ... e/download and let us know if it still happens.

As for room collisions, you can check if a room is already at the coordinates you want to plop the new one with getRoomCoordinates()

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Mapping

Post by Silvine » Sun Dec 16, 2012 2:21 am

Ok thanks, the test5 release looks good , i was on 4b, ill test it.
with regard to the collision, should i find that a room does already exist there, how do i make room for it? Can I shift everything out of the way with code? or just move it by hand?

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests