undefined rooms??

All and any discussion and development of the Mudlet Mapper.
Post Reply
User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

undefined rooms??

Post by Omit » Fri Feb 04, 2011 7:18 am

I tried something this evening and at first it appeared to be a huge success....

I have been using a room to act as a placeholder in my mapping script (addRoom(1)) all rooms and exits that have not been used go here. this room has no position and has not been assigned to an area. (script catches this and updates it)
I noticed that one of the exits being mapped displayed a "room" where the exit was (the same as where map changes areas in 3d mode). I decided to exploit this behavior by using 13 rooms(1 for each std dir and 1 for all spec) with no position and no area... the effect was great,,, as you mapped a room green rooms would appear with the exits mapped. When you entered a room the script recognized it was one of the 13 rooms and created a new room in the right location and mapped the exits.(using the same 13 rooms) This all worked very very well but.....

Once the map was saved and restored.... whenever you entered 1 of the 13 (undefined rooms, no area, no location, no exits defined for those 13 rooms) the map went haywire! Goofy! I mean that connections were made between these 13 rooms and other rooms all over the map... I wouldn't have thought that what I had done would cause such chaos in the map(and makes me reconsider even using 1)....

I guess I don't fully understand what mudlet does when you assign an exit to a room and what changes when the map is restored??!??

(I almost posted this in whatever... )

Omit

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: undefined rooms??

Post by Omit » Fri Feb 04, 2011 11:12 pm

Thought I would post a couple screen shots of this... (not sure I explained it well)

before logging out my map looks something like this....
before_restore.png
before
before_restore.png (94.67 KiB) Viewed 2193 times
and after I restart mudlet and log back in, and enter an unmapped room, it looks like this....
after_restore.png
after

(the green rooms with the red dots are the undefined rooms)

(I still have not completely ruled out an error in my scripting and will look at that tonight.... the behavior would be awfully cool, if I can get the map to restore correctly)

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: undefined rooms??

Post by Omit » Sat Feb 05, 2011 12:45 am

The error appears to be mine... the count that tells me the next room ID that can be created is does not restore correctly... this is where it would be nice to have a function to return the MAX value of all room ID's. (so you can add one and create a new room without fear of a problem like this)

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: undefined rooms??

Post by Heiko » Sat Feb 05, 2011 10:26 am

Mudlet creates appropriate room IDs for you with id = createRoomID()

kakku
Posts: 42
Joined: Tue Feb 22, 2011 12:03 pm

Re: undefined rooms??

Post by kakku » Thu Mar 03, 2011 4:43 pm

how does that work?

createRoomID() just returns 1 for m everytime..
maybe i'm doing it wrong..

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

Re: undefined rooms??

Post by Vadi » Thu Mar 03, 2011 4:58 pm

Then you probably aren't using the roomID 1?

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: undefined rooms??

Post by Omit » Thu Mar 03, 2011 9:00 pm

Would be my guess too...
createRoomID() just returns the lowest unused room ID number

so....

local id = createRoomID()
createRoom(id)


..... if you create a room with that id.... and call createRoomID() again... it will give you a new id you can use

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest