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
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Mon Jan 27, 2003 9:19 am   

Implementing Dashing
 
Hi,

I'm pretty much new to Zmud and muds so I'm hoping someone can help me out or point me to the right direction. I tried looking for similar topics but came up empty

There is this skill in the mud I play that is called dash. Whenever I dash to a certain direction (DASH direction) my character quickly moves through all the rooms in that direction until it reaches a room that has no exit in that direction. So let's say in room #1 there is only one exit to the east. 3 rooms east there is room #5 that has no exit east but one exit north. So when I dash east from room #1 I end up at room #5 since I cannot further dash east. When I dash, all the room names I dash pass scroll up until reaching room #5. What I want to do is whenever I dash, I update my current position in my map to the room I have dashed into. Is this possible? I was thinking maybe to capture the room name I dashed into, in this example room #5, and move my current position to that room in the map. What commands would I use?

Thanks in advance!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 27, 2003 1:09 pm   
 
Try using the #FIND command.

Kjata
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Mon Jan 27, 2003 2:10 pm   
 
All right! Thanks Kjata!

All the names of the rooms I dash scrolls down and finally the room itself in the following manner

room1
room2
room2 name.
Description (multiline)
You see exits leading (exits here)

the number of rooms I pass is random. So how will I know how to capture the last room name and what command would I use?

I also have one problem related to it. The name of the rooms in the mud end with a space. The automapper does not detect the spaces in the end. How can I add a space in the end of the name whenever I map?

I appreciate all the help. Thanks!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 27, 2003 2:19 pm   
 
The #FIND command by itself should be all you need to update you map position.

If the name of the last room is repeated twice (as it appears from your last reply), then you could use that to catch the name:
#TRIGGER {^(*)$(*)$} {#IF ("%1" = "%2") {#VAR roomName "%1"}}

Finally, does the extra space cause any problem when speedwalking or having the mapper follow you. I'd say that it doesn't, do go to any extra trouble to add it.

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Jan 27, 2003 6:06 pm   
 
Another idea is to capture your dash command and replace it with an alias so you can
know which direction you are dashing.

The you turn on a trigger which triggers on room name colour if you can and perform a
#MOVE direction. The trigger is turned off when the Exits line is found.

Ton Diening
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Tue Jan 28, 2003 3:46 am   
 
Thank you Gurus!

Although I will only get to try your suggestion later today, so I'll let you know how things work out.

Kjata,
yes the room name appears twice, one from the dash sequence, and one upon entry of the last room. I'm not so sure how your syntax works especially the #TRIGGER {^(*)$(*)$}, since I'm new to the script. I'll look at the help files and try it out when I get back home . Are there any other references I can read?

Regarding the spaces at the end of the room name, yes it does cause me a problem. Because if there are no spaces at the end of the room name, the mapper thinks it's a different room. If the room name had no space in the end, the mapper would not follow when I move. The rule for the naming convention is this:

Roomname.(<space after the period>)

the only exception is when the room is a road, then the room name will have this:

Roomname. (road)

there will always be the word (road) at the end after the space from the period of the room name.

I noticed this when my mapper would not follow when I was traversing normal rooms, but would follow when I was traversing on roads. So I need to make the mapper add a space to the roomname after the period if it isn't a road, and leave it as is if it is.

Ton,
move approach seems interesting. I'm also interested in the colour triggering. I noticed that when I dash and the room names scroll, all the names are in white, and the final room comes out in yellow (more mustard but does it matter?) just like if I took a quick look in the room. So it goes like this
line 1: You look at the distance (something like this, I can't remember)
Line 2: roomdashed (in white)
Line 3: roomdashed (in white)
Line 4: Same as room as in line 3 (in Yellow and description, just like as if I haev enterd the room walking into it).

I'll try to get a specific example when I get home and post it here.

I was also thinking maybe I can get the number of rooms I dashed by getting the number of lines and just move my position the same number of times in that direction? Similar to the idea you gave.

Anyway thank you for the exchange of ideas and algos, I can't wait to try them, I'll let you know how they work out. If there are some references you know that I can read aside from the help files let me know. Thanks again for all the help!
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Tue Jan 28, 2003 6:43 pm   
 
Okay once again thanks for the help, I tried out your suggestion, and seem to get the concept of the way the scripting here in zmud works. But still having problems with my script.

I plan to use the move command. Here's sample of a dash command where I dash past 2 rooms:

You look off to the southeast and dash speedily away.
Room1 name.
Room2 name.
Room3 name.
Room3 name.
description and exit(s) for Room3 here.

I noticed that the whole dash sequence is in white text and the second Room3 name is in yellow, just like if I looked into the room.

Just as Ton suggested, I was thinking of setting a trigger when the text "You look off to the" displays, and I set another trigger to keep calling the move command whenever white text scrolls. Then when there is the yellow room name I stop the trigger for the move.

Problem is I've been spending quite some time trying to script this with no luck. Can anyone help?

Can anyone also help with the my roomname problems in my post above?

Thanks, hoping to learn form you people
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Tue Jan 28, 2003 6:43 pm   
 
Okay once again thanks for the help, I tried out your suggestion, and seem to get the concept of the way the scripting here in zmud works. But still having problems with my script.

I plan to use the move command. Here's sample of a dash command where I dash past 2 rooms:

You look off to the southeast and dash speedily away.
Room1 name.
Room2 name.
Room3 name.
Room3 name.
description and exit(s) for Room3 here.

I noticed that the whole dash sequence is in white text and the second Room3 name is in yellow, just like if I looked into the room.

Just as Ton suggested, I was thinking of setting a trigger when the text "You look off to the" displays, and I set another trigger to keep calling the move command whenever white text scrolls. Then when there is the yellow room name I stop the trigger for the move.

Problem is I've been spending quite some time trying to script this with no luck. Can anyone help?

Can anyone also help with the my roomname problems in my post above?

Thanks, hoping to learn form you people
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Jan 28, 2003 11:49 pm   
 
the key here seems to be noticing when a line is repeated twice.

#alias move {
movedir = %1
#t+ roomcount
dash @movedir
}
#class roomcount
#tr {^(*)$} {
#if (%1 <> %line2) {#move @movedir} {#t- roomcount}
}
#class 0

here's what i'm trying to do:
move east
@movedir becomes "east" we enable our #move trigger and start the dash.
the trigger, on every line it recieves that is not an exact copy of the line before it, will perform a "#move east" effectively bumping you a mapper-spot to the east.
when the same line is recieved twice, it disables itself.

I don't really use the mapper much, so this is pretty much theoretical, but its a good starting place for you :). errors will come when a line is recieved after you input the alias that is not a room name (a chat message or something). to prevent this, maybe there is some way to retrieve from the mapper what the next expected room name in the direction will be, and double check the line to make sure a move isn't performed on erroneous input? try looking in the help reference under mapper commands and functions :)

--------

moon.icebound.net:9000
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Wed Jan 29, 2003 2:18 am   
 
Thanks Emit!

Your theory is sound and it would work. But upon experimentation, I noticed that there are some rooms with exactly the same name. I can dash east and pass 7 rooms to the east and some of those rooms are of the same name. The only thing I noticed is that the initial text of "you look off to the.." and all the room names I dash passed are in white. The destination room is of a different color. So if I can trigger moving the dash direction the number of white lines that pass after the "you look off to the" string, I think the script would work. What would the syntax be?

Thanks for the help!

Sorry about the last double post, I have no idea how that happened...
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Thu Jan 30, 2003 6:19 am   
 
Hi

Still no luck with my script, because I can't seem to set up my triggers properly. Here's what I plan to do:

trigger on "You look off to the %W and dash speedily away.", store %w in a variable called dashdir then turn on a trigger that fires #move @dashdir whenever a white room name appears

Turn off the move trigger when the dark yellow color of the roomname comes up.

I've been trying to make triggers to capture colored text, but I can't seem to get it to work. Can anyone show me how it's suppose to be done? How would I implement it with my plan above?

Thanks again for all the help!
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Jan 30, 2003 6:26 am   
 
#TRIGGEr {^You look off to the (%w) and dash speedily away.} {#VAR dashdir %1;#T+ DashingTrig}

Ansi trigs:
#TRIGGER DashingTrig {^%e[1;37m*} {#MOVE @dashdir;#T+ UnDashingTrig}
#TRIGGER UnDashingTrig {^%e[33m*} {#T- DashingTrig;#T- UnDashingTrig}

Something like that? Untested.

Ton Diening
Reply with quote
Grish
Beginner


Joined: 26 Jan 2003
Posts: 22

PostPosted: Thu Jan 30, 2003 1:40 pm   
 
Alright it works! Just had to change the ascii code for the colors a bit to match the ones in my mud.

I really learned alot from this one. Thanks again to everyone!
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