Basic Simple Mapping Script Thread
Re: Mapping
Are you trying to make a mapper script for the MUD Aardwolf?
Re: Mapping
No, its just looked the easiest script to start with.
This is the GMCP i get regarding a room.
This is the GMCP i get regarding a room.
Last edited by Silvine on Mon Dec 17, 2012 8:16 pm, edited 1 time in total.
Re: Mapping
Well, which mud do you want to map?
Re: Mapping
Ok let's see what it's like then ...
Re: Mapping
Did something change with test5 that affected the way mini consoles display? I've lost a couple from my build, that reappear if I resize them.
Re: Mapping
That's not related to mapping at all. See the end of http://forums.mudlet.org/viewtopic.php?f=5&t=1874 though.
Re: Mapping-Starter Script GMCP
Many thanks to Heiko for his assistance with this.
What I wanted was something really simple, everything I read had hundreds of lines of code. You will need to develop this and probably make some drastic changes, but this will at least allow you to play with the mapper.
This uses GMCP but if you can get the following from your mud by one means or another then this will probably work or at least not require a total overhaul to work.
RoomID, RoomName, ZoneName, ExitRooms
Also I used the Terrain to colour the map
the only scripts you need to make it work are mapSetup and roomEvent, the __ prefix just pretty it up a little.
helper functions - well it turned out I only made one and it just lists the rooms in a zone. What is handy is the ability to run lua from the command line and try to have a copy of the mapper API to hand.
the lua code is available on these forums i've copied it below but it isn't mine.
mudlet = mudlet or {}; mudlet.mapper_script = true tells mudlet a script exists
addMapEvent("unHighlighCurrent","__unHighlightRoom") adds an option to the right click menu to unhighlight rooms that have been highlighted because they collided i.e. 2 rooms have the same coordinates
The rest just to initialise a few things.
I should point out this doesn't use the preinstalled script. I think it works when you press the key to move, where as this works after you move by using the GMCP info.
I move using the keypad not the command line so I set lastmovedirection there. If the move fails, the GMCP doesnt get sent because I didn't move, so no harm done. Not to tricky so far so onto the guts of it, roomEvent
The mud sends info like this. I included the use of the lua alias as well to show it in use. a picture speaks 1000 words. And the script fires like this
__SetTerrainColor()--set the sector color
__roomCollision()--check for rooms in same coordinates
to start, but you will want them after about 30 minutes playing with the map though.
One thing to note is the script makes two exits, one each direction of travel, this will cause problems with one way doors, but this is just meant to start someone off who can't get the thing to work at all (i.e. me).
So here is what it all looks like after a we while playing.
I added the letter L to a couple of rooms using right click add letter. L for locked, I need to go back there... Its very simple and probably in itself limited but when faced with a blank screen it might help.
What I wanted was something really simple, everything I read had hundreds of lines of code. You will need to develop this and probably make some drastic changes, but this will at least allow you to play with the mapper.
This uses GMCP but if you can get the following from your mud by one means or another then this will probably work or at least not require a total overhaul to work.
RoomID, RoomName, ZoneName, ExitRooms
Also I used the Terrain to colour the map
the only scripts you need to make it work are mapSetup and roomEvent, the __ prefix just pretty it up a little.
helper functions - well it turned out I only made one and it just lists the rooms in a zone. What is handy is the ability to run lua from the command line and try to have a copy of the mapper API to hand.
the lua code is available on these forums i've copied it below but it isn't mine.
it works from an alias
the helper function is
Ok, so to the mapSetup
The only things to mention here are
mudlet = mudlet or {}; mudlet.mapper_script = true tells mudlet a script exists
addMapEvent("unHighlighCurrent","__unHighlightRoom") adds an option to the right click menu to unhighlight rooms that have been highlighted because they collided i.e. 2 rooms have the same coordinates
The rest just to initialise a few things.
I should point out this doesn't use the preinstalled script. I think it works when you press the key to move, where as this works after you move by using the GMCP info.
I move using the keypad not the command line so I set lastmovedirection there. If the move fails, the GMCP doesnt get sent because I didn't move, so no harm done. Not to tricky so far so onto the guts of it, roomEvent
The mud sends info like this. I included the use of the lua alias as well to show it in use. a picture speaks 1000 words. And the script fires like this
I put comments in the script where I thought they were needed. The other two functions are called at the end, you don't need them to get started just omit the lines
__SetTerrainColor()--set the sector color
__roomCollision()--check for rooms in same coordinates
to start, but you will want them after about 30 minutes playing with the map though.
One thing to note is the script makes two exits, one each direction of travel, this will cause problems with one way doors, but this is just meant to start someone off who can't get the thing to work at all (i.e. me).
only thing for the colours is keep your index above 16, 100 in my case, I spent ages wondering why green was maroon when the rest worked.
Lastly the collisions, it looks clumsy but it was the only way I could find to check if a table has more than 1 room in it.
So here is what it all looks like after a we while playing.
I added the letter L to a couple of rooms using right click add letter. L for locked, I need to go back there... Its very simple and probably in itself limited but when faced with a blank screen it might help.
Re: Mapping
I was wondering what is the best way to make the exits on rooms that run in loops, return to each other etc. Below is a small example of a few rooms that loop back to each other.
I'm not sure whats the best approach here. Do I just leave them linked up as the mapper shows it? I can still see where I am so its still easy to navigate but it doesn't look pleasing to my eye, any suggestions how to cope with this?
I assume this is where the custom exit lines come in. I don't see anything about them in the API. Is there a flag for them that I can test for, so they are not over written by a script?
When I map by hand if its more complicated than this I would draw an arrow out of the exit and put a letter on it. Then on the room I would mark it with the letter. If it returns to the same room I draw a return arrow.
Its hard to write with a touchpad I'm not sure whats the best approach here. Do I just leave them linked up as the mapper shows it? I can still see where I am so its still easy to navigate but it doesn't look pleasing to my eye, any suggestions how to cope with this?
I assume this is where the custom exit lines come in. I don't see anything about them in the API. Is there a flag for them that I can test for, so they are not over written by a script?
Re: Mapping
You can use custom exit lines to draw your arrows right on the map, actually!
Select a room, right-click and pick a line color. Click on the exit you'd like to draw the line from. Left-click on the map to draw points - and right-click to stop drawing.
Select a room, right-click and pick a line color. Click on the exit you'd like to draw the line from. Left-click on the map to draw points - and right-click to stop drawing.