(mapping script) 3kingdoms Mapper

All and any discussion and development of the Mudlet Mapper.
mgrommet
Posts: 25
Joined: Mon Feb 18, 2013 5:22 am

Quick defect (and fix) for 3k mapper

Post by mgrommet »

While playing around this again, I noticed that
tmap showexits wasn't working...

here is my code fix:
Code: [show] | [select all] lua
--show room exits
local exits = getRoomExits(tmap.lastId)
echo("Normal Exits:\n")
for k,v in pairs(exits) do
  echo("   " .. k .. " -> " .. v .. "\n")
end
tmap:echo("Special Exits:\n")
tmap:echo(getSpecialExitsSwap(tmap.lastId))
It might be worth noting that I don't have any special exits currently, in any of my rooms, so I'm not sure if the special exits call needs additional work.

M.

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

Re: (mapping script) 3kingdoms Mapper

Post by chris »

Thanks, I'll push that update

mgrommet
Posts: 25
Joined: Mon Feb 18, 2013 5:22 am

Re: (mapping script) 3kingdoms Mapper

Post by mgrommet »

Another item I've added in my own sandbox. Please let me know if I'm going about this the wrong way, or if there is an easier way to do it.

I was mapping science, and all of the similarly named rooms, with the similar cardinal exits are giving me fits.
When I try to connect rooms by moving into an older one from a newer one, the mapping scripts tend to
change the map spacing, and will create a new room, instead of connecting the old and new rooms as I would like.

I've not dug into the code much to look at the logic, but I've put together a command line alias to assist.
Using the UI to do this was just painfully slow, but using the alias, it's pretty straightforward

Alias Name: Manually Connect Rooms
Pattern : ^tmap connectroom (\d+) (\d+) (.+)$

Code:

local sourceRoom = tonumber(matches[2])
local targetRoom = tonumber(matches[3])
local dir = matches[4]
local dircode = tmap.dirtypes[dir]
setExit(sourceRoom, targetRoom, dircode)
setExit(targetRoom, sourceRoom, tmap.reversedir[dircode])


Example call:

tmap connectroom 500 510 east

would connect room 500 and 510, using the east stub from 500
It will also connect 510 to 500, using the west exit stub from 510

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

Re: (mapping script) 3kingdoms Mapper

Post by chris »

Something must be messing with your room description capture. Two ways to deal with this though are to connect exit stubs. Tmap connectstubs will do an entire area or you can set the variable tmap.connectStubs to true to autoconnect

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

Re: (mapping script) 3kingdoms Mapper

Post by chris »

You can type tmap config as well to do it through the interface

mgrommet
Posts: 25
Joined: Mon Feb 18, 2013 5:22 am

Re: (mapping script) 3kingdoms Mapper

Post by mgrommet »

I guess after reading your previous statement, It makes me wonder if there is a bug to track down, so I'm attaching screenshots of what's happening.

Step 1
Starting point in science.

Step 2
I move north, creating a new room

Step 3
I move west, hoping to connect the room created in step #2 to a room already existing in the map
Instead it give me messages that
a conflict exits
without matching exit
Changing map and scale and creating room

It doesn't at this point populate any of the exit stubs either in the room created in #2, or the existing room I was trying to connect.
Attachments
step1.png
step2.png
step3.png

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

Re: (mapping script) 3kingdoms Mapper

Post by chris »

Can you check the debug log when you do that and post whatever there is?

mgrommet
Posts: 25
Joined: Mon Feb 18, 2013 5:22 am

Re: (mapping script) 3kingdoms Mapper

Post by mgrommet »

Went west, created a new room, went north, created a new room, went east to connect new room to a previously existing room...

here is the debug output:

---------------------------------------------
new line arrived:You say: Start!!!

new line arrived:>

new line arrived: |

new line arrived: -O-

new line arrived: |

new line arrived: -O-

new line arrived: | | | | | | |

new line arrived:The Badlands (n,s,w,e) ¡ -1-O-O-@-O-O-O-

Trigger name=roomname(3?s?>?`?(.+)(\s+)?¡) matched.
capture group #1 = <The Badlands (n,s,w,e) ¡>
capture group #2 = <The Badlands (n,s,w,e) >

selectSection(0,60): line under current user cursor: The Badlands (n,s,w,e)
¡ -1-O-O-@-O-O-O-
P_begin(0/38), P_end(60/38) selectedText = The Badlands (n,s,w,e)


line under current user cursor: 38#:The Badlands (n,s,w,e) ¡ -
1-O-O-@-O-O-O-
P_begin(60/38), P_end(61/38) selectedText = ¡
LUA OK script roomname (Trigger16) ran without errors
new line arrived: | | | | | | |

new line arrived: -O-

new line arrived:

Trigger name=spacer(^$) matched.
LUA OK script spacer (Trigger17) ran without errors
new line arrived:

new line arrived:The Badlands

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:Dust whips through the air on harsh, burning winds. The low rolling

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:hills do nothing to stop the airborn grit from scouring the countryside

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:clean of life. The howl of the wind and the flying dust make it nearly

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:impossible to hear or see anything out here. You hope nothing comes

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:looking for you. Huge clouds of dust and ash rise in the distance,

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:whipped into a killing funnel by the torturous winds. To the west you

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:make out the continuation of the badlands.

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived: There are four obvious exits: north, south, west, east §

Trigger name=roomexits((((\s+There (are|is) \w+ obvious exit.?:) (.+))|No obvious exits.¡?))
matched.
capture group #1 = < There are four obvious exits: north, south, west, east §>
capture group #2 = < There are four obvious exits: north, south, west, east §>
capture group #3 = < There are four obvious exits: north, south, west, east §>
capture group #4 = < There are four obvious exits:>
capture group #5 = <are>
capture group #6 = <north, south, west, east §>

line under current user cursor: 52#: There are four obvious exits: north, south, west, east
§
P_begin(0/52), P_end(0/52) selectedText =
LUA OK script roomexits (Trigger14) ran without errors
new line arrived:>

new line arrived:A valithyn drifts in on a ghostly vapor.

new line arrived:

new line arrived: |

new line arrived: -O-

new line arrived: |

new line arrived: -O-

new line arrived: | | | | | | |

new line arrived:The Badlands (n,s,w,e) ¡ -O-O-O-@-O-O-O-

Trigger name=roomname(3?s?>?`?(.+)(\s+)?¡) matched.
capture group #1 = <The Badlands (n,s,w,e) ¡>
capture group #2 = <The Badlands (n,s,w,e) >

selectSection(0,60): line under current user cursor: The Badlands (n,s,w,e)
¡ -O-O-O-@-O-O-O-
P_begin(0/63), P_end(60/63) selectedText = The Badlands (n,s,w,e)


line under current user cursor: 63#:The Badlands (n,s,w,e) ¡ -
O-O-O-@-O-O-O-
P_begin(60/63), P_end(61/63) selectedText = ¡
LUA OK script roomname (Trigger16) ran without errors
new line arrived: | | | | | | |

new line arrived: -O-

new line arrived: |

new line arrived: -O-

new line arrived:

Trigger name=spacer(^$) matched.
LUA OK script spacer (Trigger17) ran without errors
new line arrived:

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:The Badlands

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:Destruction and desolation stretch as far as the eye can see. Dust

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:whips through the air on harsh, burning winds. The low rolling hills do

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:nothing to stop the airborn grit from scouring the countryside clean of

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:life. The howl of the wind and the flying dust make it nearly

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:impossible to hear or see anything out here. You hope nothing comes

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:looking for you.

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived: There are four obvious exits: north, south, west, east §

Trigger name=roomexits((((\s+There (are|is) \w+ obvious exit.?:) (.+))|No obvious exits.¡?))
matched.
capture group #1 = < There are four obvious exits: north, south, west, east §>
capture group #2 = < There are four obvious exits: north, south, west, east §>
capture group #3 = < There are four obvious exits: north, south, west, east §>
capture group #4 = < There are four obvious exits:>
capture group #5 = <are>
capture group #6 = <north, south, west, east §>

line under current user cursor: 78#: There are four obvious exits: north, south, west, east
§
P_begin(0/78), P_end(0/78) selectedText =
LUA OK script roomexits (Trigger14) ran without errors
new line arrived:>

new line arrived:A valithyn drifts in on a ghostly vapor.

new line arrived:

new line arrived: |

new line arrived: -O-

new line arrived: |

new line arrived: -O-

new line arrived: | | | | | | |

new line arrived:Southeastern Swamps (n,s,w,e) ¡ -O-O-O-@-O-O-O-

Trigger name=roomname(3?s?>?`?(.+)(\s+)?¡) matched.
capture group #1 = <Southeastern Swamps (n,s,w,e) ¡>
capture group #2 = <Southeastern Swamps (n,s,w,e) >

selectSection(0,60): line under current user cursor: Southeastern Swamps (n,s,w,e)
¡ -O-O-O-@-O-O-O-
P_begin(0/89), P_end(60/89) selectedText = Southeastern Swamps (n,s,w,e)


line under current user cursor: 89#:Southeastern Swamps (n,s,w,e) ¡ -
O-O-O-@-O-O-O-
P_begin(60/89), P_end(61/89) selectedText = ¡
LUA OK script roomname (Trigger16) ran without errors
new line arrived: | | | | | | |

new line arrived: -O-

new line arrived: |

new line arrived: -O-

new line arrived: |

new line arrived:

Trigger name=spacer(^$) matched.
LUA OK script spacer (Trigger17) ran without errors
new line arrived:

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:Southeastern Swamps

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:There is a mist that covers the ground here. It smells of sulfur. The

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:hot slimy swamp stretches out from here in every direction. The stench

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:of this swamp is almost unbearable. You don't think that you're going to

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:be able to make it through this thing. To the south you just make out

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:the continuation of the swampland.

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived:

LUA OK script roomdescription (Trigger15) ran without errors
new line arrived: There are four obvious exits: north, south, west, east §

Trigger name=roomexits((((\s+There (are|is) \w+ obvious exit.?:) (.+))|No obvious exits.¡?))
matched.
capture group #1 = < There are four obvious exits: north, south, west, east §>
capture group #2 = < There are four obvious exits: north, south, west, east §>
capture group #3 = < There are four obvious exits: north, south, west, east §>
capture group #4 = < There are four obvious exits:>
capture group #5 = <are>
capture group #6 = <north, south, west, east §>

line under current user cursor: 104#: There are four obvious exits: north, south, west, east
§
P_begin(0/104), P_end(0/104) selectedText =

line under current user cursor: 104#: There are four obvious exits: north, south, west, east
§
conflict exists

P_begin(0/104), P_end(0/104) selectedText =

line under current user cursor: 104#: There are four obvious exits: north, south, west, east
§
conflict exists
without matching exit


P_begin(0/104), P_end(0/104) selectedText =
LUA OK script roomexits (Trigger14) ran without errors
new line arrived:> You say: End!!!
-------------------------------------------------------------------

mgrommet
Posts: 25
Joined: Mon Feb 18, 2013 5:22 am

Re: (mapping script) 3kingdoms Mapper

Post by mgrommet »

Oh, the Changing Map Scale and Creating Room message appears on the screen, but NOT in the debug log... just thought I'd include that detail, in case it provides useful info.

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

Re: (mapping script) 3kingdoms Mapper

Post by chris »

Are you using the latest mapper as well (from github)?

Post Reply