Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Sat Feb 11, 2006 6:12 pm   

db and mazes
 
there's this maze on my mud, where it drops you randomly in any part of the maze when you enter it, anyone know how to set it such that the mapper will automatically update my location based on the exits(n,s,e,w).
i was thinking i could use the database, but nfi how to.
any help would be much appreciated. thanks
Reply with quote
Istroath
Novice


Joined: 11 Feb 2005
Posts: 39

PostPosted: Sat Feb 11, 2006 6:40 pm   
 
well youll need away to distinguish all the rooms that you might be droped into. so a list of all the rooms that it is possible to be droped into would help alot. one thing about useing the exits is sometimes tricky on some muds there random placement meaning somtimes youll see this "A room(e,w,n,s)" and othertimes youll see this "A room(n,e,s,w)" even though they are the very same room just sometimes the exits placements shift makeing the triggers much more complicated to sift through. also if you have 2 rooms that have the same name and same exits there well be no whay to tell witch one you got droped into without doing some traveling so in that case its probly best to be done in person and not by the client
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Feb 11, 2006 7:11 pm   
 
#FIND will become quite useless in the maze, I suggest not ever using it in such situations as it will only mess up your placement. Also, don't make any typos while mapping it. There are no guarantees that you will be able to get back to the room you came from using a simple reverse direction or even that it's the same room to begin with.
_________________
EDIT: I didn't like my old signature
Reply with quote
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Sun Feb 12, 2006 5:17 pm   
 
yeah, the idea was for the map to take a few rooms before it actually confirms where i am on the map. do you know how to do it?
Reply with quote
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Tue Feb 14, 2006 5:42 pm   
 
hmm, no one know how to do it? or is it even possible?
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Wed Feb 15, 2006 3:03 am   
 
Most mazes are random, so if there are some sort of pattern, you can use triggers within a particular class which then that class to be active only for the duration that you are in the area, and deactivated as you leave the area. Of course, as you enter into a room that leaves the area, you can have a trigger based on something with that generally speaking to #TE you into that room (provided you know which room specifically), and then you can use that room's script to deactivate the class.

Rooms within the random maze area, I generally leave with no sort of exits, and then I use the #TE command to move me from room to room within the area. Main reason why I have no exits is simply cause I use the follow mode as a general rule of thumb for navigation purposes, which then allows for me to continue without having to constantly clicking on the map to set my current position.

Of course, there are mazes that are fixed rather than random, which for those, it's easier to map hence the term fixed, but still can be somewhat difficult to map cause even those maps requires a lot of manual mapping.

Sincerely,

Dodgester
Reply with quote
sav
Wanderer


Joined: 09 Jan 2006
Posts: 86

PostPosted: Wed Feb 15, 2006 12:42 pm   
 
my maze is fixed. everything is constant, except the entrance points.
but what i wanted to know is , is it possible to use the database to update the room on the map. if yes, how?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Feb 15, 2006 2:22 pm   
 
It's possible, but painful. I sure wouldn't want to go through the hassle. If you're concerned about getting an accurate map of the maze, try dropping unique objects in each room to distinguish one from the other. If you just want a script to follow you accurately when walking through the maze, you may be out of luck unless you're willing to go through the torture of searching the database for a room name and exits that match and then teleporting to that room. Even then, finding more than one room that matches your current location will prevent it from ever truly being accurate.
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Fri Feb 17, 2006 4:48 am   
 
For fixed mazes, the same entry may not be a 2 way entry, so that's where I also had to go through the deal of dropping objects and/or creating objects that falls in the room that you are in. For random mazes, that of course isn't practical, so again, the #TE is the only way that I know of with matching room names and teleporting you into those rooms via #TE within triggers. Granted, this isn't necessarily the same room as the one you were just in, but it's about as close as one can expect to get for random mazes. This is certainly much easier than just trying to go through the DB itself, even if you are using SQL for the DB.

Sincerely,

Dodgester
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Feb 22, 2006 10:51 pm   
 
populate a variable with all current room exits, move east or whatever, populate a new variable with all rooms with matching exits, populate a variable with that match all rooms from var a with exits leading east or whatever that match var b, repeat with new var c until you narrow it down.
Reply with quote
ZealousAnonymous
Wanderer


Joined: 06 Jan 2006
Posts: 70

PostPosted: Thu Feb 23, 2006 5:18 am   
 
I do this after I have found my current zone using survey, current room exits in the all_room_exits variable, and capture the room name in the variable room_name

all_room_exits=%sort( @all_room_exits)
#CALL %mapfilter(%concat("[Name] LIKE '",%replace(@room_name,"'","''"),"%' and ZoneID = ",%zonenum( @my_current_location))))
#IF (%numrooms( ) > 50) {
#echo %ansi( gray, black)far to many rooms match, it may be an unmapped room
#ABORT 1
} {
#if (%numrooms=1) {#LOOP 1,%numrooms( ) {#tele %mapvnum( %i)}} {
#LOOP 1,%numrooms( ) {#additem all_possible_rooms %mapvnum( %i)}
#loop %numitems( @all_possible_rooms) {
exit_findme_temp=1
findme_exit_list_database=%null
#loop %numitems( %roomexit( %item( @all_possible_rooms, 1))) {
#additem findme_exit_list_database %db( @exit_key, %item( %roomexit( %item( @all_possible_rooms, 1)), @exit_findme_temp))
#add exit_findme_temp 1
}
findme_exit_list_database=%sort( @findme_exit_list_database)
#if (@findme_exit_list_database=@all_room_exits AND %numitems( @all_room_exits)=%numitems( %roomexit( %item( @all_possible_rooms, 1)))) {#additem possible_rooms %item( @all_possible_rooms, 1)}
#delnitem all_possible_rooms 1
}
#if (%numitems( @possible_rooms)=1) {#tele %item( @possible_rooms, 1)} {#if (%numitems( @possible_rooms)=0) {#echo Unmapped room?} {#forall @possible_rooms {#echo %ansi( gray, black)~=~= %i ~=~=}}}
}
}
#CALL %mapfilter("")
Reply with quote
ZealousAnonymous
Wanderer


Joined: 06 Jan 2006
Posts: 70

PostPosted: Thu Feb 23, 2006 5:21 am   
 
Oh, since zMUD replaces exits like ne with 1 character symbols I used a database file called exit_key to translate.
Reply with quote
ZealousAnonymous
Wanderer


Joined: 06 Jan 2006
Posts: 70

PostPosted: Thu Feb 23, 2006 5:22 am   
 
I usually have to run this twice for reasons that are beyond me. It pumps out -1 the first time then runs normally. Enjoy, it was a bitch to write.
Reply with quote
Petrograd
Novice


Joined: 08 Dec 2005
Posts: 35
Location: Sweden

PostPosted: Thu Feb 23, 2006 2:42 pm   
 
If there's a limited number of different options, I could imagine you turning on a class when you enter the room before the maze with a trigger in it that #teleport you to whatever room you enter based on what exits the room has. Could be as simple as a

#trigger {Exits: northeast southeast east} {#teleport 12005}

But obviously there will be problems if you have two rooms with same exits (and possibly problems if they are similar).

Oh, and turning off that class afterwards would be a part of the trigger too.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net