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
MissFit
Newbie


Joined: 16 Oct 2003
Posts: 4
Location: USA

PostPosted: Thu Oct 16, 2003 1:08 am   

Mapping when following or pulled by currents
 
My mud has code for water and air currents. If you're sitting in a boat on a river, you might be there for 5-10 seconds, and then you see a phrase like

"The current pulls you east."

and you're in the next room. It'd be great if I could have the mapper be able to recognize this sort of thing, either when I'm creating a map, or walking around in an existing map. Any suggestions?

I get a similar problem when grouped and following someone else, but that one I don't expect to be able to solve. (If the person I'm following is sneaking, I won't even see a message that they left the room, I just get dragged along.
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Thu Oct 16, 2003 1:49 am   
 
Try
#tr {^The current pulls you (%w).} {#move %1}

Should work I think

It would be verrry nice to be able to detect that you have just received a new room description and find the location on the map. Might be a bit laggy though. I guess if you receive something like an exits line, it would be possible to rig up some triggers so that if you haven't entered a movement command and you get an exits line the trigger does a mapper look and puts you in the appropriate room. Could be a bit confusing when you are being shown round a maze like the Voids which occur so often though :)
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Oct 16, 2003 7:57 am   
 
what if you dont see a message saying what direction you got moved? like..... You are buffeted about by crosswinds.

My mud DOES have a sextant reading feature and every room (unless you are inside cities, in which case you dont need to worry about this) has a unique sextant reading. You are currently at position 435, 1226.

It would be nice if i could be on the ocean and have a trigger to accomidate for this. something along the lines of:

#CLASS {MapLocation}
#VAR Maplocation 0
#TR {You are buffeted about by crosswinds.} {get sextant bag;look sextant;put sextant bag}
#TR {You are currently at position (%d), (%d).} {#VAR Mapposition (%1, %2);#Position @maplocation}
#CLASS 0

the sextant reading is longitude/latitude. he is a wonderful example of an overview of the world with how the longitude/latitude works. i know this wouldnt work the way i have it scripted but it would be very handy if someone knew how to do this. http://www.clan-dragon.com/map.jpg
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Thu Oct 16, 2003 12:30 pm   
 
Not sure but you may be able to combine your longitude and latitude into a single number and treat it as a vnum, in which case your method would work...
use #teleport to move to a specific vnum on the map...(no mud I have played has vnums or coordinate systems so it wouldn't help me much, unless I hash (or better, godelize) the room name, description and exits into one number and use that - now there is an idea)
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Oct 16, 2003 9:48 pm   
 
i wont be able to play with this until the new version of zMUD is released and i can begin using the automapper. Im just trying to figure out a working solution before then. if i combined the longitude and latitude into a single number, wouldnt i then have to go through my map and label every single room with a different number in order to make it work that way? :(
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Thu Oct 16, 2003 10:50 pm   
 
Um yup I am afraid you would :-( And you would presumably need to visit the rooms to find the sextant readings for them. Can't think of a way around that I am afraid.

Look on it as an exciting challenge *grin*
Oh I think there is a way of setting the vnum for a room, so I guess you could do it by a trigger mechanism (still means visiting all the rooms - but then that is what they were designed for!)
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Thu Oct 16, 2003 11:27 pm   
 
i know the sextant readings of the rooms without visiting them.

how do i rename the room or input its vnum in such a manner that #teleport would realize what room im in?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Oct 16, 2003 11:49 pm   
 
On my mud there is a command to get a vnum. I use this capture vnums for every room while I map it. I always renumber every room while mapping as this allows me to detect mazes and pickup vnums for damaged/missed rooms when not mapping. The drawback to this method is that all map functions have to be prefixed with a %roomkey change so that I can ensure there is no duplication affecting how I address that room. I will post portions of my scriptbase, and hopefully you can work from there. Included is a lot of stuff your not talking about, but they are tied to the portions you wanted so I included them.

#CLASS {System}
#ALIAS onroomenter {#IF (%nextdir) {#PAUSE;WasWalking=1} { #IF (%trigger(AutoMapper)=0) { #IF (%roomnum=0) {#NOOP %maplocked(0);study}}}}
#ALIAS onroomcreate {#LOOPDB @ExitLine { #IF (%val!="") {#DOOR %key}};#NOOP %roomnum(,0);study}
#VAR WasWalking {0} {0}
#CLASS 0
#CLASS {System|AutoMapperAll}
#TRIGGER "AutoMapRemove" {^You {walk|run|fly|crawl} (%w).$} {#NOMAP;#IF (%lastdir="") { #IF (%roomlink(,%1)=-2) {#ECHO Room not mapped yet.} {#MOVE %1}}} "" {case|notrig}
#COND {===[ M A P ]===} {#NOMAP;#STATE AutoMapRemove 3} {within|param=4|case|verbatim|notrig}
#COND {*} {#STATE AutoMapRemove 0}
#COND {} {#NOMAP;#IF (%line="---------------") {#STATE AutoMapRemove 0}} {looplines|param=8}
#TRIGGER {^You pore over the room, noting each detail in turn until finally feeling$} {} "" {case|notrig}
#COND {^sufficient enough to ascertain its hidden features: (%d)$} {#IF (%roomnum(%1)) {#ECHO Room duplication!!!!;#IF (%maplocked=0) { #NOOP %maplocked(1)}} { #IF (%trigger(Automapper)) { #NOOP %roomnum(,%1)} { #IF (%maplocked=0) {#NOOP %roomnum(,%1);#NOOP %maplocked(1)}}}} {within|param=1|case|notrig}
#CLASS 0

Note the command on my mud to get a vnum is "study", I marked the triggers and aliases directly involved in that portion in green. If you need an explanation on what any of it does feel free to ask. Also of note, because all functions here work on the current room none have to utilize the %roomkey function. If you need an example of that beyond what the help provides I'll be here.
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Oct 17, 2003 3:42 am   
 
:( after staring at this for almost an hour now and i have no clue how to use it :(

%key
%maplocked
onroomenter (is this just an alias?) onroomcreate? (just an alias or actually a command used by the mud?
#NOOP? %trigger, %roomnum... *sigh* i suppose ill just have to wait until the new version is released and then make a new post and ask some questions then.
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Fri Oct 17, 2003 7:29 pm   
 
Well well well - I never knew that!
onroomenter and onroomcreate are special aliases you can set which work like event handlers. So in Vijilante's scripts above, every time he goes into a room (after the room script is processed) the onroomenter alias gets executed.
%maplocked controls whether the map can be altered.
%key I don't know about - I assume it must be a built in, but can't find help on it.
#NOOP does nothing (no op)
%trigger tells you whether a class is enabled or not
%roomnum is the meat of it - gets or sets the vnum of the room

It is well worth using the find function in the help :-)

I will now study Vij's script cos it introduces some nice ideas (cheers Vijilante)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Oct 17, 2003 11:29 pm   
 
%key is a Predefined Variable set by the #LOOPDB at each iteration. I didn't include the trigger that captures that info, since I forgot onroomcreate referenced it. Basically it just captures the exits of the room since that contains door and door state information. I hate having the mapper send 'open door' when the door is already open.

Again if you have questions, we have answers.
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