Core mapper function bug

Post Reply
Posts: 9
Joined: Tue Jun 14, 2016 8:32 pm

Core mapper function bug

Post by jgh713 »

setRoomArea() doesn't work properly for new areas on mudlet 3.0 (win10 and mac tested). If you create a new area, the area seems to exist properly, shows up on 'area list' through map loads/restarts, etc. The issue comes when you try to move a room into this new area.

3.0: setRoomArea() returns true when successful. It returns nil when you attempt to move a room into one of these new areas, but doesn't error.
2.1: setRoomArea() returns nil regardless, but works when moving rooms into new areas created on 2.1.

Could be an issue with mudlet 3.0's area creation, or an issue with the setRoomArea function not working properly for areas with 0 rooms in them. If someone could take a look into this and figure out what's off about this, that would be great. Or, if you can't replicate this and need more information, please ask here or poke Ahmet in-game.

User avatar
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Core mapper function bug

Post by SlySven »

As a general hint, for Lua functions that I have touched or otherwise fiddled with in my attempts to improve Mudlet if there is a failure caused by a value (e.g. a non-existent room number, or indeed a non-existent map) as well as the first nil there will be a second, hopefully descriptive, error string also returned. Invalid type (number/string/table/boolean) or missing (hence treated as nil) arguments will still throw Lua errors - and at least the ones I have touched will say WHICH argument is wrong! {There is a great many core Mudlet Lua functions so there are still plenty that have not received TLC from me though... :? }

So, for the 3.0.0 case above you could try something like:
Code: [show] | [select all] lua
local helpText, result
result, helpText = setRoomArea( roomId, areaId )
if result == nil then
    cecho("<red:white> ERROR: <white:red> \""..helpText.."\" <reset>\n")
Actually, there were bugs in earlier 3.0.0 previews and even the latest "delta" at the time of writing has some issues with XML maps downloaded from IRE servers. The latest Github repository version (if you can build Mudlet from source) should have fixed all but the XML map problem (map appears blank after downloading it). What 3.0.0 preview are you using?

Note that the latest, bleeding-edge code in the GitHub repo. (both "development" and "release_30") have recently added map "auditing" code designed to fix up the sort of problems that those earlier bugs may have introduced; and saving and reloading after getting a XML downloaded map should fix up a map even with the outstanding "missing rooms/blank map" bug in that feature?

BTW "Poking Ahmet" in game is a bit unlikely to happen as you have not said which of the hundreds of Muds out there that you are on...!

Post Reply