Hide rooms?

All and any discussion and development of the Mudlet Mapper.
Post Reply
Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Hide rooms?

Post by Nyyrazzilyss »

I've got the mudlet mapper somewhat working now, and it looks *good*. Thanks!

Something I think i've decided though is that i'm going to include primarily pre mapped areas, rather then forcing the player to go through the process of mapping/properly placing the rooms.

What i'd like to do is set every room to 'hidden' (i.e. not display it), until i've actually seen the player enter the room.

What's the best way to hide/unhide rooms?

Probably something else I should be re-reading the instructions for, but.... :)
screen6-24b-2015.jpg

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

Re: Hide rooms?

Post by chris »

Can you explain how this is different than a user manually using a customized mapper? This isn't as easy as it seems, since things like path-finding will have to be taken into account.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Hide rooms?

Post by Nyyrazzilyss »

The mud I play is a customized DIKU that doesn't provide room numbers. There's also a lot of areas with teleports/loops/non-grid design. I have > 50k rooms in a cmud mapfile, and have succesfully imported several test areas into mudlet from it. I did go as far as writing a couple aliases to interface with the mapper and manually add rooms, and something from the mud tends to break it quite often. When it comes to effort by the end user being able to just walk and have the map unfold would be much easier.

The main problem is the lack of room numbers from the mud, and they don't intend to provide that information.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Hide rooms?

Post by Nyyrazzilyss »

I think I might have figured out how to do this. I can store the correct areaid in the room's userdata, and just set the areaid for that room to a holding area. The room won't display on that map for the area it belongs to. On room entry, I can just move the room back to the correct area.

Question though: Setting the areaid to a non-existant number (0) didn't work. It looks like i'm going to have to create the holding area. Is there any way to mark an area hidden/not display it at all?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Hide rooms?

Post by Nyyrazzilyss »

Found it!

resetRoomArea(roomid) hides the room
setRoomArea(roomid, areaid) restores it to the map

I just need to store the correct area information in userdata

lockRoom(roomid, true) should prevent it from being used for speedwalks

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

Re: Hide rooms?

Post by SlySven »

I thought I had posted a response to this thread but it seems to have vaporised before it hit the forum server. The default/"reserved" area has an ID of -1 and all rooms added by lua scripts in current release and preview code versions place the newly created room there. You can reset a room to this area with the lua command "resetRoomArea( (number) roomID )" in the preview version code. Unfortunately the 2.1 release code does not have this and importantly has a nasty bug that will corrupt the Map (and possibly fatally crash the Mudlet Application) if you try to change the area a room is in after it has already been set the first time (and thus moved from the default area). :o

Although the "default" area cannot be selected for display by the "Area Selection Widget" on the mapper window, the "centerview" command is likely to show that area with the room in the preview code version - I'm not sure about how the 2.1 release version behaved.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Hide rooms?

Post by Nyyrazzilyss »

Didn't take long to add, and have it working perfectly. It basically makes an error-free automapper on the areas I setup that way. One of the big things it gets past is large or small rooms that throw off the grid/co-ordinates.

Now if only I could put animated rendered fog moving around the unknown areas of the map... :)

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

Re: Hide rooms?

Post by SlySven »

Or perhaps animated "Here be Dragons!" signs? :D

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Hide rooms?

Post by Nyyrazzilyss »

Animated signs, a lizard crawling around the border, maybe swirling smoke with occasionally glowing eyes showing...

Centerview does show -1 area rooms, I just had to make sure I had the unhide check before it got called.

I'm pretty sure i've got various parts of my package that just don't run at all with 2.1 - Not sure about the earlier 3.0 series, since I wrote it on 3.0-delta . Was there a command to retrieve the version number the package was running on that I could use to check version/ give a message to upgrade?

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

Re: Hide rooms?

Post by SlySven »

Remember the user can still call "centerview( <roomID> )" at the command line...

I'm not total surprised about some things not working on 2.1 - one reason why we are working on a "New, Improved, Washes Whiter" release but only Heiko has the necessary access on Source Forge I believe and he is not current active with Mudlet ATM - Real Life is probably getting in the way :) so we can't do much about the 2.x series...

Yep, getMudletVersion() which takes one optional argument, not in 2.1 release IIRC, see the on-line manual - though "officially" you should not rely on it. ;)

Post Reply