On Wed, 24 Jul 1996, Mark McArthey wrote: > I'm looking to create a room that will randomly load in a different zone > everytime the mud loads. Also, when a certain event occurs, this room > will, once again, be able to move to another location. Apart from the > initial problem of finding out how to 'randomly' load a room, I am also > wondering how I can locate an available position within the mud to place > this room. Well, off the top of my head, I'd say just do it the easy way and imp enterable objects... not difficult, make an obj type enterable and use one of the values (value 0) to point to a room number (unconnected) where people go to when they "enter <objname>" then just take a look at the teleport code and use something like that to drop the object off somewhere randomly on the mud. Theres several implementations of portal code floating around, you could probably just modify those to suit your needs for the enterable object code... I'm pretty sure its the same basic idea. If you MUST have a real room with actual exits to enter it, you should just go ahead and make the room and not connect it, then use some algorithm to find a suitable location (again, teleport would work fine) - once you find your random room, just check the exits and when you find one that doesnt exist, make a two-way exit to your unconnected room and from it to the room you've randomly chosen... that is, if it has any free exit's, else just ditch it and try for another random room until you find one with an unused exit direction... -Sky +-----------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://cspo.queensu.ca/~fletcher/Circle/list_faq.html | +-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/07/00 PST